Rotors control with matlab/simulink on Gazebo
Hi, I want to ask you a simple question: can I control rotors of a simulate drone on Gazebo, with matlab/simulink on ubuntu 14.04? I had installed all software components and they have a good communication (matlab-ros-gazebo). I can take some value of drone with matlab, but I don't understand how to control the velocity of drone's rotors. Thanks in advance.
Update
rosinit
$ rosinit
The value of the ROS_MASTER_URI environment variable, http://127.0.1.1:11311, will be used to connect to the ROS master.
The value of the ROS_HOSTNAME environment variable, 127.0.1.1, will be used to set the advertised address for the ROS node.
Warning: The IP address 127.0.1.1 in the "NodeHost" setting is not associated with any network
interface. It is possible that MATLAB cannot be reached by other ROS nodes.
In robotics.ros.internal.Net.generateNodeHost (line 368)
In robotics.ros.Node.parseArguments (line 313)
In rosinit (line 92)
Initializing global node /matlab_global_node_54033 with NodeURI http://127.0.1.1:37780/
rostopic
$ rostopic list
/clock
/command/motors
/command/rate
/diagnostics
/erlecopter/bottom/camera_info
/erlecopter/bottom/image_raw
/erlecopter/bottom/image_raw/compressed
/erlecopter/bottom/image_raw/compressed/parameter_descriptions
/erlecopter/bottom/image_raw/compressed/parameter_updates
/erlecopter/bottom/image_raw/compressedDepth
/erlecopter/bottom/image_raw/compressedDepth/parameter_descriptions
/erlecopter/bottom/image_raw/compressedDepth/parameter_updates
/erlecopter/bottom/image_raw/theora
/erlecopter/bottom/image_raw/theora/parameter_descriptions
/erlecopter/bottom/image_raw/theora/parameter_updates
/erlecopter/bottom/parameter_descriptions
/erlecopter/bottom/parameter_updates
/erlecopter/command/attitude
/erlecopter/command/motor_speed
/erlecopter/fix
/erlecopter/fix/position/parameter_descriptions
/erlecopter/fix/position/parameter_updates
/erlecopter/fix/status/parameter_descriptions
/erlecopter/fix/status/parameter_updates
/erlecopter/fix/velocity/parameter_descriptions
/erlecopter/fix/velocity/parameter_updates
/erlecopter/fix_velocity
/erlecopter/front/camera_front_info
/erlecopter/front/image_front_raw
/erlecopter/front/image_front_raw/compressed
/erlecopter/front/image_front_raw/compressed/parameter_descriptions
/erlecopter/front/image_front_raw/compressed/parameter_updates
/erlecopter/front/image_front_raw/compressedDepth
/erlecopter/front/image_front_raw/compressedDepth/parameter_descriptions
/erlecopter/front/image_front_raw/compressedDepth/parameter_updates
/erlecopter/front/image_front_raw/theora
/erlecopter/front/image_front_raw/theora/parameter_descriptions
/erlecopter/front/image_front_raw/theora/parameter_updates
/erlecopter/front/parameter_descriptions
/erlecopter/front/parameter_updates
/erlecopter/gazebo/command/motor_speed
/erlecopter/ground_truth/imu
/erlecopter/ground_truth/odometry
/erlecopter/ground_truth/pose
/erlecopter/ground_truth/pose_with_covariance
/erlecopter/ground_truth/position
/erlecopter/ground_truth/transform
Gio8, [6 gen 2019, 19:28:27]:
/erlecopter/imu
/erlecopter/motor_speed/0
/erlecopter/motor_speed/1
/erlecopter/motor_speed/2
/erlecopter/motor_speed/3
/erlecopter/motors
/erlecopter/waypoint
/erlecopter/wind
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/imu
/mavlink/from
/mavlink/to
/mavros/battery
/mavros/cam_imu_sync/cam_imu_stamp
/mavros/extended_state
/mavros/global_position/compass_hdg
/mavros/global_position/global
/mavros/global_position/local
/mavros/global_position/raw/fix
/mavros/global_position/raw/gps_vel
/mavros/global_position/rel_alt
/mavros/imu/atm_pressure
/mavros/imu/data
/mavros/imu/data_raw
/mavros/imu/mag
/mavros/imu/temperature
/mavros/local_position/odom
/mavros/local_position/pose
/mavros/local_position/velocity
/mavros/manual_control/control
/mavros/mission/waypoints
/mavros/radio_status
/mavros/rc/in
/mavros/rc/out
/mavros/rc/override
/mavros/setpoint_accel/accel
/mavros/setpoint_position/local
/mavros/setpoint_raw/attitude
/mavros/setpoint_raw/global
/mavros/setpoint_raw/local
/mavros/setpoint_raw/target_attitude
/mavros/setpoint_raw/target_global
/mavros/setpoint_raw/target_local
/mavros/setpoint_velocity/cmd_vel
/mavros/state
/mavros/time_reference
/mavros/vfr_hud
/mavros/wind_estimation
/rosout
/rosout_agg
/scan
/sonar_d
/sonar_front ...
I copied the information from your answer into your question since it's actually an update to your question and not an answer. I did my best to format your question, but please feel free to edit it as you see fit making sure to use the format (
101010
) button for code/output.The problem seems to be with re-creating the topic. Check my updated answer.