Hi there,
First things first, I am using Ubuntu 18.04 with Gazebo 9.
I am trying to develop a differential drive robot that interfaces with gazebo using mavlink. I am using Firmware/Tools/sitl_gazebo/models/rover as a guide and inside it I have found the libgazebo_mavlink_interface.so plugin file which seems to handle all of the communication between gazebo topics and the PX4 SITL daemon using mavlink over UDP. The specific code block is below:
<plugin name='mavlink_interface' filename='libgazebo_mavlink_interface.so'>
<robotNamespace></robotNamespace>
<imuSubTopic>/imu</imuSubTopic>
<gpsSubTopic>/gps</gpsSubTopic>
<magSubTopic>/mag</magSubTopic>
<baroSubTopic>/baro</baroSubTopic>
<mavlink_addr>INADDR_ANY</mavlink_addr>
<mavlink_udp_port>14560</mavlink_udp_port>
<serialEnabled>false</serialEnabled>
<serialDevice>/dev/ttyACM0</serialDevice>
<baudRate>921600</baudRate>
<qgc_addr>INADDR_ANY</qgc_addr>
<qgc_udp_port>14550</qgc_udp_port>
<hil_mode>false</hil_mode>
<hil_state_level>false</hil_state_level>
<enable_lockstep>true</enable_lockstep>
<use_tcp>true</use_tcp>
<motorSpeedCommandPubTopic>/gazebo/command/motor_speed</motorSpeedCommandPubTopic>
<control_channels>
<channel name="rear_left_wheel_drive">
<input_index>5</input_index>
<input_offset>0</input_offset>
<input_scaling>40</input_scaling>
<zero_position_disarmed>0</zero_position_disarmed>
<zero_position_armed>0</zero_position_armed>
<joint_control_type>velocity</joint_control_type>
<joint_name>rear_left_wheel_joint</joint_name>
<joint_control_pid>
<p>50</p>
<i>20</i>
<d>2</d>
<iMax>800</iMax>
<iMin>-800</iMin>
<cmdMax>1200</cmdMax>
<cmdMin>-1200</cmdMin>
</joint_control_pid>
</channel>
I’m most interested in the motor speed data subscription and would like to know how I can change this from accepting motor information for an ackerman drive rover, to accepting motor information for a two-wheel differential drive robot. In PX4, I have a mixer file defined in ROMFS that can be used to generate the appropriate control values for the motors - how would I get that information across mavlink so that this plugin can read it and actuator the motors in Gazebo?