ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

SDF with Gazebo and ROS

asked 2022-11-02 16:20:58 -0500

Darko gravatar image

Hi ROS developers, I have a question. I made a Delta robot (Parallel robot) for my school project. Because delta is a closed kinematics chain I made an SDF model to simulate in Gazebo. I can spawn SDF in the Gazebo but I can not find a way to simulate my ROS code on the SDF model. I tried to use "gazebo" tags to add the SDF part in URDF but that is not working, I know for converting SDF to URDF, but I can't use that because of a closed loop. My question is, how to simulate SDF in the Gazebo? If you know another simulator, like CoppeliaSim or something else I can use, please help!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2022-11-08 04:40:45 -0500

IgararA gravatar image

Hi Darko.
I have been doing similar work recently. Trying to write Gazebo Modelplugin click there.If you want to establish connection with ROS just creating a node in Loadfunction.

edit flag offensive delete link more


Yes, i want to connect ROS and Gazbeo. If I create ROS node in a plugin, I need to use robot_state_publiser to move joints, is that true? But robot_state_publiser can not bee launch with SDF?

Darko gravatar image Darko  ( 2022-11-09 07:56:20 -0500 )edit

Hi Darko. In my opinion, It's impossible to use robot_state_publisher for sdf file. But, I found an easier way to achieve Parallel Robot Simulation.(I can launch tf by robot_state_publisher) Firstly, you need to have an urdf file and take gazebo tag for your parallel joints e.g(Your joint description should be sdf format):

    <joint name='left_wheel_Joint2' type='revolute'>  
    <pose relative_to='left_rear_hipleg_Link'>0.119824 0 -0.0315 0 0 -0.730771</pose>  

Then launch your urdf file. Robot model can not display in rviz/rviz2 but gazebo could display rightly. It's

IgararA gravatar image IgararA  ( 2022-11-11 04:39:30 -0500 )edit

In addition, you joint tf can not be handled correctly in gazebo tag. The gazebo tag can only help you connect parent_link and child_link in gazebo

IgararA gravatar image IgararA  ( 2022-11-11 05:16:40 -0500 )edit

Hi, I am a little bit confused, /tf topic is from robot_state_publisher, from /tf i can only read messages, and I can not publish on them, is the truth? Actually, I can publish but /tf is going nowhere. And one more question, can I use gazebo_ros_control plugin to connect ROS and Gazebo, or do I need to create my plugin? Thank you very much for your help so far.

Darko gravatar image Darko  ( 2022-11-19 11:33:33 -0500 )edit

Hi Darko.I think you do not need publish /tf directly. You can try to use joint_state_publisher_gui that can publish joint_state, then /tf can be published by robot_state_publisher automatically. If /tf can not be changed as you described there may be errors about launch file or urdf.Contrarily, if /tf can be changed by joint_state_gui, there is a problem with your publisher node. I have an uncertain conjecture that tf can not be changed because joint_state not changed, your tf published by robot_state_publisher that depended joint_state,so every tf you publish is covered by joint_state pass robot_state_publisher.I am reading ros2_control and ros2_gazebo_control(ros2) source code, i think it is feasible that use gazebo_ros_control to connect ROS and Gazebo(if gazebo_ros_control could do something like ros2_gazebo_control).It could provides gazebo hard_interface for you.

IgararA gravatar image IgararA  ( 2022-11-20 20:16:29 -0500 )edit

No thanks, I am also in the process of studying, please forgive me if there is something wrong above

IgararA gravatar image IgararA  ( 2022-11-20 20:17:48 -0500 )edit

answered 2022-11-08 05:12:00 -0500

aarsh_t gravatar image

You can try webots as it does support the joint without the actuation also 2 (perpendicular) hinge joint plus a sphere joint.

edit flag offensive delete link more

Question Tools



Asked: 2022-11-02 16:20:58 -0500

Seen: 374 times

Last updated: Nov 08 '22