Closed dineshHarikrishnan closed 4 days ago
Any Immediate fix for this?
ROS2 action support is not in a relaeased version yet. You will need to build from source to use this feature. As you may have seen everything related to the ROS2 action is tagged with v2. And you can also see this is not released yet.
I have tried building from source like installing the ros2-actions-no-typescript branch roslib because it only has support to ros2-action-client I have used ros2 action classes only but still I am facing issues I am using expressJS backend and roslibjs
"roslib": "github:RobotWebTools/roslibjs#ros2-actions-no-typescript"
Also I have cloned this version of rosbridge_suite
git clone https://github.com/RobotWebTools/rosbridge_suite.git -b humble
const navigateToPose = (x, y, res) => {
//Create an action client
var actionClient = new ROSLIB.Action({
ros: ros,
name: "/navigate_to_pose",
actionType: "nav2_msgs/action/NavigateToPose",
});
//Goal message for navigateToPose
var goal = new ROSLIB.ActionGoal({
goalMessage: {
goal: {
// Add the goal field here
pose: {
header: {
frame_id: "map",
stamp: {
sec: Date.now(), // You can set the actual timestamp here
// nanosec: Date.now(), // You can set the actual timestamp here
},
},
pose: {
position: { x: x, y: y, z: 0.0 },
orientation: { x: 0.0, y: 0.0, z: 0.0, w: 1.0 },
},
},
behavior_tree: "",
},
},
});
console.log(goal);
// console.log(goal.pose.pose.position);
var goal_id = actionClient.sendGoal(
goal,
(result) => {
console.log("Result for action goal:", result.result.sequence);
res.status(200).send(result.result.sequence);
},
(feedback) => {
console.log(
"Feedback for action on " +
actionClient.name +
": " +
feedback.partial_sequence
);
}
);
console.log("Goal sent with ID: ", goal_id);
res.send("Goal sending...");
};
[rosbridge_websocket-1] [ERROR] [1726144153.273787272] [rosbridge_websocket]: [Client 401053d3-55c4-4472-a823-9e5061e8321a] send_action_goal NonexistentFieldException: send_action_goal:/navigate_to_pose:4
ROS2 action support is not in a relaeased version yet. You will need to build from source to use this feature. As you may have seen everything related to the ROS2 action is tagged with v2. And you can also see this is not released yet.
Oh no I just stumbled on this. I saw you in this issue: https://github.com/RobotWebTools/roslibjs/issues/646 show how to install a different branch:
pnpm install roslib@github:RobotWebTools/roslibjs#ros2-actions-no-typescript
Which branch would be ideal if I need ROS2? Is this the one? Also would you consider it stable enough to be used or is it still some highly WIP thing. UPDATE: I tried installing this branch and so far I didnt notice any problems. I only need to use actions and services so if that works I guess this will work. Thank you!
Description I am using ROSLIBJS for ROS2 actions I have referrred your examples also.
Steps To Reproduce
Actual Behavior
Node.js v18.20.4 [nodemon] app crashed - waiting for file changes before starting...
When I tried with Ros1 classes the app doesnt crashed but the actionCall doesnt happening.