I am also doing a similar project in trying to simulate a single erlecopter in gazebo with Matlab/Simulink. I am trying to send the velocity commands from simulink to erlecopter in gazebo with the Ros topic /erlecopter/command/motor_speed with message type mav_msgs/CommandMotorSpeed.
However when I publish this to gazebo, the motors of my erlecopter model in gazebo stop/freeze and I recieve the following error:
F021414 0000::484802:.200000.2188582100530 23823 gazebo_motor_model.cpp:127] Check failed: rot_velocities->motor_speed.size() > motor_number_ You tried to access index 0 of the MotorSpeed message array which is of size 0.
Hoping if you could advise on how you managed to simulate your erlecopter in gazebo with Matlab/Simulink
Thanks in advance