REMINDER: configure your environment before starting this tutorial.
Download and compile the ROS node in your workspace
cd ~/simulation/ros_catkin_ws/src git clone https://github.com/erlerobot/ros_erle_teleoperation cd .. catkin_make --pkg ros_erle_teleoperation
This node is able to:
APM requires setup FCU param SYSID_MYGCS to match mavros system id. Set the parameter
NOTE: Be carreful to use in automatic control because lack of safety mechanisms
source ~/simulation/ros_catkin_ws/devel/setup.bash rosrun ros_erle_teleoperation ros_erle_teleoperation
This GUI shows the current flight mode and status (armed or disarmed). With the combo box is possible to change the flight mode (LOITER, STABILIZE, GUIDED, AUTO, ...). The other two widgets are the joystick, left joystick controls yaw and throttle and right joystick controls roll ad pitch. The following window will appear:
Check if the node is overriding the RC. Go to Initial Setup -> Mandatory Setup -> Radio Calibration
Using MAVROS we are going to be able to override a 8 channel RC. Filling the 8 values of the array channels
# Override RC Input # Currently MAVLink defines override for 8 channel uint16 CHAN_RELEASE=0 uint16 CHAN_NOCHANGE=65535 uint16 channels
In this code it shows how to override roll, pitch, throttle and yaw channels. The other 4 channels are not going to be override, this mean that this channels will get the value from the RC.
msg_override.channels = share_memory->getRoll(); msg_override.channels = share_memory->getPitch(); msg_override.channels = share_memory->getThrottle(); msg_override.channels = share_memory->getYaw(); msg_override.channels = 0; msg_override.channels = 0; msg_override.channels = 0; msg_override.channels = 0;