- Add ssh key of your PC to github.I recommend you may use github cli which is installable through
sudo apt-get install -y ghand rungh auth loginto automatically add ssh to your github account. - You can git clone using ssh or github cli using the following commands
SSH:
git clone --recursive git@github.com:AerialRobotics-IITK/Robofest25.gitGithub CLI:gh repo clone --recursive AerialRobotics-IITK/Robofest25 - Now run following commands for use
Single Drone make uav1
Gazebo Single Drone iris: make gziris
Only Ardupilot make swarm
First Run: make gzswarm
Next Run in a different terminal: make ardugzswarm
MAVROS(if required) make mavswarm
- Build the image using
make image - Get a working environment by running
make local
- Open up Raspberry Pi's UART port and identify which device belongs to which port you can make use of the photo below
- Place this folder either through zipping and sending it over ssh or git clone the repo (you may remove the --recursive or else it will only cause it to take a little more space)
- Add the ip address of all the drones or zenoh systems you want to connect to in
./zenoh/router_config.json5 - Build image using
make image - Now run one of the following commands
USB:
make usb MAV_ID=2or leave if MAV_ID required is 1make usbgpio(UART0) (raspi 5):make gpiogpio4(UART0) (raspi 4):make gpio4custom:make custom DEVICE=/dev/{your_device} BAUD={value} - Now if using mavros then run
ros2 launch swarm mavros.launch.pyinside tmux - Run your code as you did on simulation
- This system uses zenoh so you need to start zenoh router on any before running any other ROS command. This can either be done by directly running it via the
ros2 run rmw_zenoh_cpp rmw_zenohdcommand or if you run any of the launch files in the swarm package it will automatically be done for you. - Running the
lazyexecutable in theswarm_cpporswarm(which was actually tested on ground and was the basis of swarm_cpp) package will publish the position of the drone wrt to uav1's home position on the topic/uav_{MAV_ID}/local_poswhere MAV_ID is the id of the drone on which the node is running. And publish the offset of it this position of the drone's own home position on the topic/uav_{MAV_ID}/offset. - This lazy executable is already run by the
leader.launch.pyfile and thefollower.launch.py, so if you want to understand how to build on top of this system you can modify these files or create your own launch files. - It works by subscribing the global position of all the drones in the swarm and then calculating the offset from its own home position and publishing it. So any node can subscribe to this offset topic and get the relative position of the drone wrt to uav1.
- The home position of the uav's are not the their home position per say but it is the average position of 5 seconds of the drones once the GPS initializes.
- We are using Zenoh Router instead of default DDS,default DDS chokes the system and is not made for mesh network
- Remove the ip address of the system on which zenoh router is running from
router_config.json5 - Give a unique
tgt_systemparameter in mavros launch command andSYSID_THISMAVparameter for each drone - Sleep for few seconds between takeoff and set_position/local
- Never run Zenoh router twice on any device (even when in container and outside container both count as the same device)
- You need to add how to install you dependencies inside
Dockerfilein this folder for your code to compile - Nvidia users might want to install Nvidia Container Tookit and then add the parameter
RUNTIME=dockerwhile running the make command - You need to set
WIFI_PASSWDenvironment variable in .env file for make hotspot to work - If you once connected with USB then gpio (or vice versa) make sure to use
REPLACE=1env variable while running make command
