-
download dependencies (px4_msgs and traj_gen):
- px4_msgs : checkout the right version. For px4 v1.15, main branch of px4_msgs throws serialization errors and there is no branch in px4_msgs for px4 v1.15. We checkout a specific commit instead.
cd ros2_code git clone https://github.com/PX4/px4_msgs.git src/px4_msgs cd src/px4_msgs git checkout bd9dc0fae0162960a31af8f232a9e9f85522ae73 cd ../..
- traj_gen (optional): used to generate desired trajectory to be executed by the UAV
cd ros2_code git clone https://github.com/TareqAlqutami/traj_gen.git src/traj_gen
- px4_msgs : checkout the right version. For px4 v1.15, main branch of px4_msgs throws serialization errors and there is no branch in px4_msgs for px4 v1.15. We checkout a specific commit instead.
-
source ROS2
You can use a script to source ros2. We already have one script to source foxy:
source ../scripts/source_ros2.bash
-
Build
ros2_code
colcon workspaceAdd the
symlink-install
flag to allow us to modify the python code and rerun without the need to rebuildcolcon build --symlink-install
You may see some warnings. But as long as there are no errors it should be OK.
-
Test the code by launching rviz visualization of robot urdf
source install/setup.bash ros2 launch am_description display.launch.py
you can specify the urdf model using
urdf_model
. Note that you will need to provide complete path such asros2 launch am_description display.launch.py urdf_model:=src/am_description/urdf/tilted_hex_arm.urdf
-
Explore using kinematics with KDL library in am_description/scripts/kdl_testing.ipynb
-
More details of each ROS2 package and nodes within is found in the ros2 workspace readme here. Running full SITL simulation with offboard control is described there.