Hi all,
I am trying to manually send HIL_ACTUATOR_CONTROLS MAVLink messages directly to Gazebo through a Python script to control a drone. I am sending MAVLink messages through the pymavlink library.
When I start Gazebo, through ROS, it starts, and hangs with a black screen until I start a TCP MAVLink connection with
connection = mavutil.mavtcp("localhost:4560")'
At which point Gazebo will finish starting up, and run for 5 seconds, until it hangs again.
According to the simulation documentation, because Gazebo is running in Lockstep mode, Gazebo should be freewheeling HIL_SENSOR messages to me until it receives its first HIL_ACTUATOR_CONTROLS message. However, when I check the_connection.messages (as is suggested to check the messages received), the only messages that I see Iāve gotten are a āMAVā message and a āHOMEā message, neither of which are valid messages. I have tried sending HIL_ACTUATOR_CONTROLS messages nonetheless, but Gazebo does not respond.
Note that I have been able to connect and control a drone in Microsoft AirSim this way (by connecting with connection.mavtcp(ālocalhost:4560ā) and manually sending HIL_ACTUATOR_CONTROLS messages.)
To summarize, my questions are as follows:
- Why isnāt Gazebo sending me any HIL_SENSOR messages?
- Why isnāt Gazebo listening to my HIL_ACTUATOR_CONTROLS messages?
EDIT: Iāve found where the HIL_SENSOR messages are. Instead of calling connection.messages
, I need to call connection.recv_match()
or connection.recv_msg()
. Not sure why connection.messages
doesnāt work, though.