This package provides tools to work with snapdragon over ROS. Before being able to use all these ROS nodes, these dependencies have to be installed.
Install the dependencies
sudo apt-get install libspnav-dev libbluetooth-dev libcwiid-dev libusb-dev libeigen3-dev
Install ROS using this. This is the indigo version. Feel freee to install the version of your choice.
Create ROS workspace if needed
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ..
catkin_make
You alse need to have mavros installed on your computer. if not, follow this :
# For Ros Indigo
sudo apt-get install ros-indigo-mavros ros-indigo-mavros-extras
# For Ros Kinteic
sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras
Depending on if Eigen3 has his .cmake file in your current version of cmake, you may need to execute this:
sudo cp /usr/share/cmake-2.8/Modules/FindEigen3.cmake /usr/share/cmake-3.X/Modules/
Where X is your using version of cmake.
If already not done, add the following lines to the end of the .bashrc file:
export ROS_MASTER_URI=http://192.168.1.XX:11311
export ROS_IP=192.168.1.XX
where 'XX' is your own IP.
Clone the current repository not in the src file. The qcontrol_defs package have to be build before the other ROS package
cd ~/catkin_ws
git clone https://github.com/u-t-autonomous/PX4_ROS_packages.git
mv PX4_ROS_packages/qcontrol_defs src/
Then clone the following two catkin_packages and build
cd ~/catkin_ws/src
git clone https://github.com/ros-drivers/joystick_drivers.git
git clone https://github.com/ethz-asl/vicon_bridge
cd ..
catkin_make
source devel/setup.sh
Finally build the rest of the PX4_ROS_packages nodes
cd ~/catkin_ws/
mv PX4_ROS_packages/* src/
catkin_make
source devel/setup.sh
This sub package handles the low level interaction between the offboard computer and PX4 on the quad. Basically you can send using this package velocity, position , attitude setpoint to the quad. You can also request takeoff, land , switching between mode request etc...
Before launching this node, be sure the PX4 is launch on quad side and that vicon is already tracking the quad.
ssh linaro@192.168.1.XX
sudo ./px4 mainapp.config
where 'XX' is the IP of your snapdragon and the password for connection is linaro
.
Now launch the node that interacts with the quad
roslaunch offboard_control quadX_offboard.launch
where X is the vicon number you assigned to the quad. (More mprovement have to be taken her !!! Documentation will change)
When offboard_node is launched, the quad can be used via any other ros node.
A C++ example can be find HERE(joy control of the quad)
A Python example can be find here HERE(global methods for taking off,landing, switch to poctl, speedctl ...)
An example can be controlling the quad using a joy. Just launch the predefined launch file
roslaunch offboard_control quadX_joy.launch
where X is the name of the quad in vicon
example of launch file can be modified for a specific quad name or quad IP or udp mavros port. Just look at the ones in this repository if looking for example. Parameter are pretty self explanatory.