Gazebo | Ignition | Community
Ask Your Question

How to pass the topic data to external application directly via not ROS2

asked 2020-01-16 22:57:01 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi there I run the gazebo plugin like gazebo_ros joint_state_publisher on ROS2 as follows image. I would like to try to pass topic data to external python application directly via not ROS2.

Is there any good way?

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-01-23 09:37:18 -0500

Jose Luis Rivero gravatar image

Not sure if I fully understand your case. My first question is: do you need ROS at all for your use case or you just want the Gazebo simulation and send the data to other application?

If you don't need ROS one option could be writing a standalone application that subscribe to /gazebo/default/joint gztopic and in the callback transform the data from gazebo.msgs to a given format useful to send you to your application in python (not sure about the best way here but there should be plenty of options). To implement the application you can look into the stand_alone example of listener and change the code in the callback.

Another option using ROS could be to integrate rospy code inside your python code to subscribe to the joint_state ROS topic and use the information directly from there. This is probably the easiest approach.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-01-16 22:57:01 -0500

Seen: 146 times

Last updated: Jan 23 '20