This project is developed to enable velocity control using Radio Controller (RC) in offboard mode while using the ARPL Autonomy stack. The ROS-RC-Wrapper is a ROS Package that maps the RCin topics from Mavros to Body Velocity commands in the ARPL Quadrotor control.
This package mainly subscribes to Mavros and calls multiple services from the Mav_manager package. The following is a list Subscribers and Services used by the package.
Object Type | Topic Name | Description |
---|---|---|
Subscriber | /mavros/rc/in | Stick input from the RC streamed via Mavros |
Subscriber | /mavros/param/get | PX4 parameters set in the PX4 firmware |
Service | /mav_services/setDesVelInBodyFrame | Desired Velocity goals in Body frame |
Service | /mav_services/land | Land service |
Service | /mav_services/hover | Hover service |
Service | /mav_services/motors | Motors-on Service |
Service | /mav_services/takeoff | Takeoff Service |
The installation of the package is straight forward. Make sure to source setup.bash
before begining installation of the package.
cd ~/path/to/your/workspace/src
git clone https://github.com/arplaboratory/ROS-RC-Wrapper.git
catkin build rc_control
source ~/path/to/your/workspace/devel/setup.bash
You can run the package using rosrun
in the following way
rosrun rc_control rc_command
To send body velocity goals using the RC follow these steps,
- Once the ARPL Autonomy Stack is running you can start the ROS-RC-Wrapper package using
rosrun
- Follow the regular procedure until motors-on in the RVIZ interface.
- After motors-on is clicked, toggle
SWITCH F
on the RC toPOS 1
to switch to "Offboard" mode. - Toggle
SWITCH D
toPOS 1
to takeoff.
Note
At this point the robot will be flying and will be in offboard mode as usual.
- Toggle
SWITCH F
toPOS 0
to enable velocity control.
Important
Make sure both the sticks are centered before toggling to Velocity mode to avoid publishing any unnecesary goals during transition.
- Toggle the
SWITCH F
back toPOS 1
to disable Velocity control. - Toggle
SWITCH D
toPOS 0
to land the robot.
- To disarm the Robot, switch mode back to stabilize by toggling
SWITCH F
toPOS 2
- Then disarm by toggling the disarm switch
SWITCH A
toPOS 1
Warning
Make sure the THROTTLE STICK is set to ZERO before switching mode to stabilize. This is to avoid commanding high throttle during disarming.