Gazebo | Ignition | Community
Ask Your Question

How to interface a C program with Gazebo (without ROS) ?

asked 2022-06-16 08:58:17 -0500

Clement gravatar image


Is there a way to interface a C program with Gazebo ? Let's say I have a C program for making autonomous navigation with my robot, and I want to validate it in simulation.
I just need to replace the sensor input by a subscription to the sensor data coming from gazebo, and to export the actuators commands to gazebo.
Is it possible to do that ? I don't see any C API for Gazebo.
I don't want to use ROS, because it means that I would have to rewrite the sequencer in the ROS node.

Thanks in advance

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2022-06-24 02:45:54 -0500

Clement gravatar image

I think the best way is to use sockets to make the C program communicate with a ROS node that will make the bridge with Gazebo.

edit flag offensive delete link more

answered 2022-06-22 08:37:31 -0500

this post is marked as community wiki

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

I think there is a gazebo transport system that allows you to interact with the gazebo server using messages.

I also have a hard time finding good documentation.

edit flag offensive delete link more


The doc says: "C++ is the native implementation and so far the only way to use the library. We hope to offer different wrappers for the most popular languages in the future."

Clement gravatar imageClement ( 2022-06-24 02:45:03 -0500 )edit

You can interact with gazebo using the C++ library. I finally managed to get it to work.

Here is my c++ script to set the pose of an object in gazebo.

marc-marc gravatar imagemarc-marc ( 2022-06-30 09:08:39 -0500 )edit

Question Tools

1 follower


Asked: 2022-06-16 08:58:17 -0500

Seen: 204 times

Last updated: Jun 24 '22