-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JointPositionController topic name is not suitable for ROS2 topic name #447
Comments
Oh interesting. Does ROS at least let the user remap that topic to another valid one? In any case, we should make the topic configurable for that system, so ROS users can set custom topics that match their requirements. |
ROS remap does not work fine in this case. In ROS2 Foxy,
errors:
When remapping from launch file
also fails to parse global arguments. |
I also came across this error this morning. I was trying to send joint commands from ROS 2 to Ignition Gazebo. I'll have a look at what I can do. If I come up with a solution, I will post here afterwards. |
Okay, so I came up with a work around to get the plugin to work with ROS 2 via the
std::string topic = transport::TopicUtils::AsValidTopic("/model/" +
this->dataPtr->model.Name(_ecm) + "/joint/" + this->dataPtr->jointName +
"/_" + std::to_string(this->dataPtr->jointIndex) + "/cmd_pos"); This will change the package's topic from
mkdir -p ~/ign_gazebo/build
cd ~/ign_gazebo/build
cmake ..
cmake --build .
ign gazebo robot_world.sdf This will start Gazebo Ignition with your SDF world with a model that uses the
ros2 run ros_ign_bridge parameter_bridge /model/robot_assembly/joint/joint_3/_0/cmd_pos@std_msgs/msg/Float64@ignition.msgs.Double This will start the bridge.
ros2 topic pub /model/robot_assembly/joint/joint_3/_0/cmd_pos std_msgs/msg/Float64 '{data: -0.7804}' This will move the Here's a before and after picture: I hope this helps anyone else wanting to use the |
Thank you for sharing the workaround, @drfknoble . I opened a PR making the topic configurable for that plugin: #584 This way, ROS users can specify the topic through the SDF file and don't need to change the source code. |
@chapulina: No worries, happy to help! I think being able to specify the topic in the SDF will make things a lot easier. |
Hello Frazer Noble
|
I can move the position of But I can't do this with ROS2. What is wrong? |
我也是这样的,请问你怎么解决的 |
JointPositionController topic name is "/model/<model_name>/joint/<joint_name>/<joint_index>/cmd_pos",
however ROS2 topic name must not start with a numeric character.
(https://design.ros2.org/articles/topic_and_service_names.html)
So topic name "/<joint_index>" leads to error when using the ros_ign_bridge.
The text was updated successfully, but these errors were encountered: