Closed adamkrawczyk closed 3 years ago
If nav2_msgs
is not a ROS2 build-in package (released with ROS2 package), I think you have to source its local_setup.bash
so the message generator could find this package and create the JS file for it.
@adamkrawczyk thx for sharing this issue.
nav2_msgs includes a number of actions. When support for actions was added earlier this year we missed updating interface_loader.loadInterfaceByPath()
to recognize actions.
The fix is to change line 84 from:
let pkg = { srv: {}, msg: {} };
to
let pkg = { srv: {}, msg: {}, action: {} };
Oh, I missed @adamkrawczyk has mentioned that
Nav2_msgs are generated.
So I think the .bash
has been sourced. Thanks for @wayneparrott's findings.
Yeah!
This is solving the issue. (rclnodejs/lib/interface_loader.js 84: let pkg = { srv: {}, msg: {}, action: {} };
)
When the npm version will be patched?
Thank you ;)
@minggangw I can submit a PR with fix and test case if no one else is planning to work this issue. Thoughts?
version: rclnodejs@0.16.0 ros: ros2 foxy
when:
const nav2_msgs = rclnodejs.require('nav2_msgs').msg;
what:
Why:
I have no idea why this occurs. Other messages are imported properly. Nav2_msgs are generated.