ethz-asl / rotors_simulator

RotorS is a UAV gazebo simulator
1.2k stars 756 forks source link

Feature/multimotor plugin #659

Open karenbodie opened 3 years ago

karenbodie commented 3 years ago

EDITED DESCRIPTION: Adds a multi-motor plugin that currently includes rotor and servo options.

URDF setup

All motors are added in one plugin via their corresponding joints, an example is in omav3_actuators.xacro. For a system with n rotors and m servos, Actuator numbers are (0 - n-1) rotors in order they are included in the xml, and (n - m-1) servos. Regardless of the order of servos or rotors blocks, rotors will come first.

Messages

Commands are received jointly in a mav_msgs::Actuators message. Missing fields are set to nan and extra fields are ignored. Rotors handle nan by setting to zero velocity. This could be adapted based on real actuator/esc behaviour. Servos do not update joint controllers if a nan is received.

Feedback

Feedback is published jointly in a mav_msgs::Actuators message which contains an array of positions, velocities, and efforts (e.g. torque), one for each motor. Rotors publish zero for position (angles).

Launch example

An example for OMAV3 is in omav_simulation.launch

resolves #492