I am doing a similar project whereby I am trying to control the Erlecopter in Gazebo via Matlab/SImulink. The output of my controller are also motor velocities which Iam publishing to 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.
Also, you mentioned above that you managed to do the simulation by modifying the .launch file hence I was hoping if you could please show which lines to modify in the .launch file which would be very helpful.
Hoping if you could advise on how you managed to simulate your erlecopter in gazebo with Matlab/Simulink
Thanks in advance