JSON sensor issue - SITL/GAZEBO

Hi,

I’m trying to have Arduplane/SITL/Gazebo “Garden” on a WSL Ubuntu 22.04
I followed the doc https://ardupilot.org/dev/docs/sitl-with-gazebo.html

  • To have Gazebo running, I had to change the command (it’s due to a graphic card issue, I found that in the Gazebo forum)
gz sim -v4 -r zephyr_runway.sdf

I use this one instead:

gz sim zephyr_runway.sdf ign gazebo --render-engine ogre

And Gazebo seems to work

For SITL, in the doc:

sim_vehicle.py -v ArduPlane -f gazebo-zephyr --model JSON --map --console

SITL/Mavproxy is starting , but it seems that the JSON sensor are not working, so nothing happen and I’ve got these errors messages:

Usually I’m not using JSON for SITL, first time because of Gazebo, I didn’t find a way to make it work, so thanks for your help
Nico

Hello @Nicolas_T, it appears that the SITL instance is not connecting to the simulation running in Gazebo. It could be that the ardupilot_gazebo plugin is not being found.

Could you run the Gazebo server and GUI separately with the following commands and post the logs:

server:

gz sim -v4 -s -r --render-engine ogre zephyr_runway.sdf

gui:

gz sim -v4 -g --render-engine ogre

If you see a message saying the ArduPilotPlugin is not found you’ll need to export
GZ_SIM_SYSTEM_PLUGIN_PATH with the path to the plugin.

Also note the -r flag on the server - this starts the simulation running. There will be no connection while the simulation is paused (which is the default start state).

2 Likes

Hi Rhys,

It works fine, that’s so great, many thanks for your help !!

Nico

1 Like

hello, i tried to run gazebo and ardupilot sitl and it works , similarly matlab with sitl and this too works but im having issue running gazebo and matlab at once with sitl. i see that gazebo and matlab are configured to same port 9002. is there any way i can make this both work together.