0
$\begingroup$

Rosanswers logo

We created a hardware interface and controllers that we will be using for a real robot. The problem is, whenever we load Gazebo and our own custom controller manager, Gazebo unsubscribes from the 'joint_state_publisher' topic and so we only have our own custom controller manager subscribed to it so we can't monitor the activity on Gazebo. Is there a way to operate both simultaneously ? In other words, we need to simulate the activity of a real robot in Gazebo. Here's the rqt graph: https://ibb.co/gg90dG0


Originally posted by Lycanthropy on ROS Answers with karma: 11 on 2019-09-13

Post score: 0

$\endgroup$

2 Answers 2

1
$\begingroup$

Rosanswers logo

Figured out the solution. I just take the messages published to the joint_state topic, manipulate them into a gazebo_msgs/ModelState message and publish them to the /gazebo/set_model_state topic. Although the exact real life scenario and the gazebo simulation is different for the similar commands, it gives me an appropriate scenario to compare what should be happening (in gazebo) vs what is really happening (the real life robot). E.g. if I implement an odometry correction algorithm, if it is properly corrected in gazebo and not in the real robot, that would mean the real robot might have a mechanical or environment problem (keeping in consideration that the gazebo environment and the robot model is configured according to the desired situation). Refer to 'Gazebo subscribed topics' in this link for further help: http://gazebosim.org/tutorials?tut=ros_comm&cat=connect_ros


Originally posted by Lycanthropy with karma: 11 on 2019-09-13

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by jaiswalharsh on 2020-08-07:
Hi, I am in a similar situation. Can you elaborate a little bit more on how you did: "manipulate them into a gazebo_msgs/ModelState message"? And also just curious: Was syncing gazebo to a real robot useful?

$\endgroup$
0
$\begingroup$

Rosanswers logo

There is a theoretical problem with what you're trying to achieve. Gazebo is a simulation and is used to replace a real robot in your robotic system. If you want to control your real robot and a gazebo simulated robot you are in effect controlling two different robots not one. You should be able to set this up using namespaces, but I'm not sure this is what you're trying to do.

Why do you want to run Gazebo alongside the real robot?


Originally posted by PeteBlackerThe3rd with karma: 9529 on 2019-09-13

This answer was NOT ACCEPTED on the original site

Post score: 4


Original comments

Comment by Lycanthropy on 2019-09-13:
E.g. if we attain telemetry and odometry information from our real robot, and we're sitting in another room, and want to monitor it, kind of like a simulated monitoring program, we'd like to monitor the movement in Gazebo.

Comment by jayess on 2019-09-13:
Why not use RViz instead of Gazebo?

Comment by PeteBlackerThe3rd on 2019-09-13:
I agree, this is exactly what RVIZ is designed for. Gazebo is not designed to visualise anything apart from it's own internal simulation.

Comment by gvdhoorn on 2019-09-13:
@Lycanthropy: to add to what the previous posters wrote: consider Gazebo as a stand-in of your robot. It's not a visualisation tool.

See #q316396 for a related Q&A.

Comment by Lycanthropy on 2019-09-13:
Thank you so much for your responses. I figured it out. Putting it as the answer. Upvoting for help.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.