### Start Gazebo Source: https://www.yuque.com/xtdrone/manual_en/docker?language=zh-cn Command to start Gazebo in a new pane after the simulation has started. ```bash roslaunch gazebo_ros empty_world.launch ``` -------------------------------- ### Starting PX4 Simulation Source: https://www.yuque.com/xtdrone/manual_en/vslam?language=en-us This bash command initiates the PX4 simulation, using indoor scene one as an example. ```bash roslaunch px4 posix_sitl.launch ``` -------------------------------- ### Start the emulator Source: https://www.yuque.com/xtdrone/manual_en/vehicle_config?language=zh-cn This command starts the emulator for the solo multirotor UAV. ```bash roslaunch px4_control solo.launch ``` -------------------------------- ### Start Simulation Source: https://www.yuque.com/xtdrone/manual_en/docker Command to start the simulation within a Docker pane. ```bash roslaunch px4_control px4_keyboard_control.launch ``` -------------------------------- ### Start Simulation Source: https://www.yuque.com/xtdrone/manual_en/uav_formation_hardware-in-the-loop_simulation Command to start the XTDrone simulation on the host. ```bash python ~/XTDrone/control.py --drone iris --world ~/PX4_Firmware/worlds/iris_formation.world ``` -------------------------------- ### Install AprilTag_ROS Source: https://www.yuque.com/xtdrone/manual_en/precise_landing?language=en-us Installs the AprilTag ROS library and builds the apriltag_ros package. ```bash sudo apt install ros-melodic-apriltag cp ~/XTDrone/sensing/object_detection_and_tracking/apriltag/apriltag_ros/ ~/catkin_ws/src/ cd ~/catkin_ws/ catkin build apriltag_ros #or catkin_make ``` -------------------------------- ### Install some necessary packages Source: https://www.yuque.com/xtdrone/manual_en/fixed_wing_formation_control Command to install necessary packages. ```bash sudo apt install ros-noetic-mavros ros-noetic-mavros-extras ``` -------------------------------- ### SITL Startup Script Example Source: https://www.yuque.com/xtdrone/manual_en/udp_matching?language=en-us An example of a SITL startup script used in a multi-machine simulation environment. ```bash #!/bin/bash export ROS_MASTER_URI=http://localhost:11311 export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/usr/local/share/xtdrone roslaunch xtdrone multi-UAV-sitl.launch ``` -------------------------------- ### Start Multi-UAV SITL Source: https://www.yuque.com/xtdrone/manual_en/multi_uav_search Command to start multi-UAV SITL simulation. ```bash python3 tools/sim_multi_vehicle.py -n 4 ``` -------------------------------- ### Test Docker Installation Source: https://www.yuque.com/xtdrone/manual_en/docker?language=zh-cn This command tests if Docker is installed successfully. ```bash docker version ``` -------------------------------- ### Start the communication script Source: https://www.yuque.com/xtdrone/manual_en/self_driving Start the communication script to control the vehicle. ```bash python communication/communication.py ``` -------------------------------- ### Start Docker Container Source: https://www.yuque.com/xtdrone/manual_en/docker Command to start the Docker container. It's recommended to run 'xhost local:root' beforehand. ```bash docker run -it --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix xtdrone:1.3 /bin/bash ``` -------------------------------- ### Start Unmanned Vehicle Simulation Source: https://www.yuque.com/xtdrone/manual_en/ugv_config Command to start the unmanned vehicle simulation. ```bash roslaunch px4_sitl_gazebo px4_sitl_gazebo_realsense_r200_depth.launch ``` -------------------------------- ### Install Dependencies Source: https://www.yuque.com/xtdrone/manual_en/ugv_config?language=en-us Installs the necessary dependencies for the UGV model. ```bash cd ~/ export TURTLEBOT3_MODEL=burger roslaunch racecar_simulator racecar_sim.launch ``` -------------------------------- ### Start Simulation in Docker Source: https://www.yuque.com/xtdrone/manual_en/docker?language=zh-cn Command to start the simulation within a Docker pane, likely using tmux. ```bash roslaunch simulation_control main.launch ``` -------------------------------- ### Start Docker Container Source: https://www.yuque.com/xtdrone/manual_en/docker?language=zh-cn Command to start the Docker container. It's recommended to run 'xhost local:root' before this command to avoid Gazebo startup issues. ```bash docker run -it --gpus all -v /home/xtdrone:/home/xtdrone -p 10000:10000 xtdrone:1.3 /bin/bash ``` -------------------------------- ### Install Dependencies Source: https://www.yuque.com/xtdrone/manual_en/ugv_config Commands to install necessary dependencies for the UGV model. ```bash sudo apt update sudo apt install python3-empy pip3 install future pip3 install --upgrade pip pip3 install -r requirements.txt ``` -------------------------------- ### Start EGO-Planner Swarm Source: https://www.yuque.com/xtdrone/manual_en/swarm_motion_planning Command to start the EGO-Planner Swarm. ```bash cd ~/XTDrone/motion_planning/3d python ego_planner_swarm.py ``` -------------------------------- ### Install HectorSLAM Source: https://www.yuque.com/xtdrone/manual_en/ans9lg Command to install HectorSLAM using apt. ```bash sudo apt install ros-noetic-hector-slam ``` -------------------------------- ### Start simulation Source: https://www.yuque.com/xtdrone/manual_en/fixed_wing_formation_control Command to start the simulation using bash files. ```bash bash ~/catkin_ws/src/fixed_wing_formation_control/scripts/start_simulation.sh ``` -------------------------------- ### Start the simulation Source: https://www.yuque.com/xtdrone/manual_en/ugv_planning?language=en-us Command to launch the PX4 outdoor simulation environment for the UGV. ```bash roslaunch px4 outdoor1_ugv.launch ``` -------------------------------- ### Start HectorSLAM Source: https://www.yuque.com/xtdrone/manual_en/ans9lg Command to start HectorSLAM. ```bash # Start HectorSLAM ``` -------------------------------- ### Multi-UAV Launch File Example Source: https://www.yuque.com/xtdrone/manual_en/udp_matching?language=en-us Example configuration for multi-UAV launch files. ```xml ``` -------------------------------- ### VINS-Fusion Simulation - Configuration Example Source: https://www.yuque.com/xtdrone/manual_en/vio?language=zh-cn Example configuration parameters for VINS-Fusion SITL with stereo IMU. ```yaml imu_topic: "/iris_0/imu_gazebo" image0_topic: "/iris_0/stereo_camera/left/image_raw" image1_topic: "/iris_0/stereo_camera/right/image_raw" output_path: "/home/robin/catkin_ws/vins_output" . . . pose_graph_save_path: "/home/robin/catkin_ws/vins_output/pose_graph/" # save and load path ``` -------------------------------- ### Start YOLO Source: https://www.yuque.com/xtdrone/manual_en/target_detection_tracking Launch command for YOLO. This loads network parameters and waits for image input. ```bash roslaunch ``` -------------------------------- ### Start the pure tracking node Source: https://www.yuque.com/xtdrone/manual_en/ugv_planning?language=en-us Command to start the pure pursuit node for path tracking. ```bash rosrun pure_pursuit pure_pursuit_test_node ``` -------------------------------- ### Start PX4 Simulation Source: https://www.yuque.com/xtdrone/manual_en/ans9lg Command to start PX4 simulation. ```bash # Start PX4 simulation ``` -------------------------------- ### Install map server Source: https://www.yuque.com/xtdrone/manual_en/cartographer?language=en-us Installs the map server package for saving maps. ```bash sudo apt install ros-melodic-map-server ``` -------------------------------- ### Establish ROS Communication Source: https://www.yuque.com/xtdrone/manual_en/docker?language=zh-cn Command to establish ROS communication after Gazebo has started. ```bash python3 communication.py ``` -------------------------------- ### Start communication script Source: https://www.yuque.com/xtdrone/manual_en/pose_groundtruth Starts the communication script to transfer pose topics from Gazebo. ```bash roslaunch px4_bringup communication.launch ``` -------------------------------- ### Build the Project Source: https://www.yuque.com/xtdrone/manual_en/ugv_config?language=zh-cn Build the UGV project after installing dependencies. ```bash cd catvehicle ./build.sh ``` -------------------------------- ### Start Simulation Source: https://www.yuque.com/xtdrone/manual_en/swarm_motion_planning Command to launch the PX4 multi-vehicle simulation. ```bash cd ~/PX4_Firmware roslaunch px4 multi_vehicle.launch ``` -------------------------------- ### Starting ORBSLAM2 Source: https://www.yuque.com/xtdrone/manual_en/vslam?language=en-us This command starts the ORBSLAM2 node. It requires a brief waiting period for the vocabulary bag to load. ```bash roslaunch orb_slam2_ros mono.launch ``` -------------------------------- ### Start GMapping and hybrid A* path planning nodes Source: https://www.yuque.com/xtdrone/manual_en/ugv_planning?language=en-us Commands to start the GMapping node for localization and the hybrid A* path planning node. ```bash roslaunch catvehicle gmapping.launch roslaunch hybrid_astar_test manual.launch ``` -------------------------------- ### Start Communication Script Source: https://www.yuque.com/xtdrone/manual_en/ans9lg Command to start the communication script. ```bash # Start communication script ``` -------------------------------- ### Install SSH Service Source: https://www.yuque.com/xtdrone/manual_en/uav_formation_hardware-in-the-loop_simulation Command to install the SSH service on Debian-based systems. ```bash sudo apt update sudo apt install openssh-server ``` -------------------------------- ### Start simulation Source: https://www.yuque.com/xtdrone/manual_en/cartographer?language=en-us Starts the PX4 simulation environment. Ensure the sdf in indoor3.launch is set to iris_2d_lidar. ```bash roslaunch px4 indoor3.launch ``` -------------------------------- ### Start Simulation Source: https://www.yuque.com/xtdrone/manual_en/usv?language=en-us Command to start the simulation. If the simulation speed is slow, reducing the number of UAVs can help. ```bash roslaunch vrx_gazebo vrx_competition.launch ``` -------------------------------- ### Start Unmanned Vehicle Simulation Source: https://www.yuque.com/xtdrone/manual_en/ugv_config?language=en-us Launches the simulation for unmanned ground vehicles. ```bash roslaunch racecar_simulator racecar_sim.launch ``` -------------------------------- ### Start VINS-Fusion and Transfer Topics Source: https://www.yuque.com/xtdrone/manual_en/swarm_motion_planning Commands to start VINS-Fusion and convert its output topics for PX4 compatibility. The 'bias' value in multi_vins_transfer.py should be adjusted based on the initial drone positions. ```bash cd ~/catkin_ws roslaunch vins xtdrone_run_vio.launch ``` ```bash cd ~/XTDrone/sensing/slam/vio python multi_vins_transfer.py iris 4 # 4 representatives the number of iris ``` -------------------------------- ### Install Map Server Source: https://www.yuque.com/xtdrone/manual_en/ans9lg Command to install the map server for saving maps. ```bash sudo apt install ros-noetic-map-server ``` -------------------------------- ### Tmux installation Source: https://www.yuque.com/xtdrone/manual_en/formation_with_communication_model?language=en-us Command to install tmux, a terminal multiplexer, which is used to run all scripts required by the demo. ```bash sudo apt install tmux ``` -------------------------------- ### Start the automatic driving script Source: https://www.yuque.com/xtdrone/manual_en/self_driving Start the automatic driving script for the vehicle to drive forward. ```bash python perception/lane_detection/auto_driving.py ``` -------------------------------- ### Algorithm program installation Source: https://www.yuque.com/xtdrone/manual_en/ugv_planning?language=en-us Commands to install necessary ROS packages, copy UGV planning source code, and modify a configuration file. ```bash sudo apt install ros-melodic-gmapping sudo apt install ros-melodic-ompl cp -r ~/XTDrone/motion_planning/ugv_planning/* ~/catkin_ws/src/ cd ~/catkin_ws/ gedit src/ugv_planning/hybrid_astar_test/include/hybrid_astar_test/global_definition/global_definition.h Change the pathname in the file, and then compile ``` ```bash catkin_make #或catkin_build ``` -------------------------------- ### Start Keyboard Control Scripts Source: https://www.yuque.com/xtdrone/manual_en/multi_vehicle?language=zh-cn After communication is established, start the keyboard control scripts for individual vehicles. ```bash # ... in the control directory, so that the keyboard can be used to control multiple vehicles at the same time. ``` -------------------------------- ### Install tmux Source: https://www.yuque.com/xtdrone/manual_en/formation_with_communication_model Command to install tmux, a terminal multiplexer useful for running multiple scripts simultaneously for the demo. ```Bash sudo apt-get update -y && sudo apt-get install tmux -y ``` -------------------------------- ### Start simulation Source: https://www.yuque.com/xtdrone/manual_en/precise_landing?language=zh-cn This section outlines the steps to start the simulation with three iris UAVs equipped with downward cameras and a UGV with AprilTag. It also includes commands to start multi-UAV communication and control, and to launch apriltag_ros for visualization. ```bash roslaunch px4 multi_uav_mavros_sitl_mavros_iris.launch ``` ```bash roslaunch px4 multi_uav_mavros_sitl_mavros_iris.launch ``` ```bash roslaunch apriltag_ros apriltag.launch ``` -------------------------------- ### Start simulation environment Source: https://www.yuque.com/xtdrone/manual_en/accelerate_sim_and_large_swarm This command starts the simulation environment after modifying the world file to set gravity to 0. ```bash roslaunch multi_vehicle_without_PX4.launch ``` -------------------------------- ### Start RViz Source: https://www.yuque.com/xtdrone/manual_en/swarm_motion_planning Command to launch RViz with the specified configuration for swarm visualization. ```bash rviz -d ego_swarm_rviz.rviz ``` -------------------------------- ### Install AprilTag_ROS Source: https://www.yuque.com/xtdrone/manual_en/precise_landing Instructions for installing the AprilTag ROS library, which is used for estimating the 3D position, direction, and ID of AprilTags relative to a camera. ```bash sudo apt-get update sudo apt-get install ros-kinetic-apriltag-ros ``` -------------------------------- ### Start simulation environment Source: https://www.yuque.com/xtdrone/manual_en/accelerate_sim_and_large_swarm?language=en-us This command starts the simulation environment after the world file has been modified and the environment has been generated. ```bash roslaunch coordination_launch_generator outdoor2.launch ``` -------------------------------- ### Start Multi-Vehicle PX4 Simulation Source: https://www.yuque.com/xtdrone/manual_en/multi_vehicle Command to start the multi-vehicle PX4 simulation after the launch file has been generated and copied. ```bash make px4_sitl_rtps_udp_external ``` -------------------------------- ### VINS-Fusion Simulation - Odometry Output Example Source: https://www.yuque.com/xtdrone/manual_en/vio?language=zh-cn Example of the Odometry type topic published by VINS-Fusion, showing pose information. ```text header: seq: 69 stamp: secs: 1844 nsecs: 205000000 frame_id: "map" pose: position: x: -0.00769823836163 y: -0.00358746759593 z: -0.00920653529465 orientation: x: 0.00903992677157 y: -0.00832445364273 z: -0.000201883404367 w: -0.999924540027 ``` -------------------------------- ### Start PX4 Outdoor Scene Simulation Source: https://www.yuque.com/xtdrone/manual_en/target_detection_tracking Command to start the PX4 outdoor simulation. YOLO will then receive images and begin target detection. ```bash roslaunch px4_control px4_pos_control_node.launch ``` -------------------------------- ### Build Project Source: https://www.yuque.com/xtdrone/manual_en/ugv_config?language=en-us Builds the UGV project after dependencies are installed. ```bash cd ~/catvehicle ./build.sh ``` -------------------------------- ### Start Cartographer Source: https://www.yuque.com/xtdrone/manual_en/cartographer?language=en-us Launches Cartographer for 2D SLAM. ```bash roslaunch cartographer_ros xtdrone_2d.launch ``` -------------------------------- ### Start simulation Source: https://www.yuque.com/xtdrone/manual_en/precise_landing?language=en-us Launches the precision landing simulation with three iris UAVs and a UGV with AprilTag. ```bash roslaunch px4 outdoor2_precision_landing.launch ``` -------------------------------- ### Install Cartographer Source: https://www.yuque.com/xtdrone/manual_en/cartographer?language=en-us Installs the Cartographer ROS package. ```bash sudo apt install ros-melodic-cartographer-ros ``` -------------------------------- ### Import Docker Image Source: https://www.yuque.com/xtdrone/manual_en/docker?language=zh-cn Command to import the Docker image. ```bash docker load -i xtdrone_docker.tar.gz ``` -------------------------------- ### Modify Launch File Source: https://www.yuque.com/xtdrone/manual_en/uav_formation_hardware-in-the-loop_simulation Example of modifying the generated launch file to use iris instead of iris_stereo_camera. ```bash sed -i 's/iris_stereo_camera/iris/g' ~/PX4_Firmware/launch/iris_formation.launch ``` -------------------------------- ### Open Hosts File Source: https://www.yuque.com/xtdrone/manual_en/uav_formation_hardware-in-the-loop_simulation Command to open the hosts file for editing. ```bash sudo nano /etc/hosts ``` -------------------------------- ### Run Demo Scripts with tmux (Keyboard Control) Source: https://www.yuque.com/xtdrone/manual_en/formation_with_communication_model Example of running demo scripts using tmux for keyboard control. The script 'communication_keyboard_pc.sh' is used, and specific commands within the script can be run individually if tmux is not used. ```Bash tmux new-session -d -s communication './communication_keyboard_pc.sh' ``` -------------------------------- ### SITL Startup Script Source: https://www.yuque.com/xtdrone/manual_en/udp_matching The path to the SITL startup script for PX4 firmware versions later than v1.9. ```plaintext /Firmware/ROMFS/px4fmu_common/init.d-posix/rcS ``` -------------------------------- ### Label Data with labelimg Source: https://www.yuque.com/xtdrone/manual_en/target_detection_tracking Instructions for setting up labelimg for data annotation. ```bash Set the input directory to just ~/catkin_ws/src/darknet_ros/darknet/data/xtdrone/VOC2007/JPEGImages/ through "Open Directory", and set the output directory to ~/catkin_ws/src/darknet_ros/darknet/data/xtdrone/VOC2007/Annotations through "Change Save Directory". ``` -------------------------------- ### Fixed-wing Setpoint Hover Example Source: https://www.yuque.com/xtdrone/manual_en/vehicle_config Example of setting a waypoint for a fixed-wing UAV to hover at a specific altitude. ```text Set the waypoint (0,0,21) ``` -------------------------------- ### Control USV Example Source: https://www.yuque.com/xtdrone/manual_en/usv This example demonstrates how to control the USV by setting the same thrust for the left and right propellers. ```python rospy.init_node('usv_control_node', anonymous=True) # Create a publisher for the USV velocity command topic vel_pub = rospy.Publisher('/usv_velocity_cmd', Twist, queue_size=10) # Create a Twist message to control the USV velocity_cmd = Twist() # Set the linear and angular velocities (example values) velocity_cmd.linear.x = 1.0 # Forward velocity velocity_cmd.angular.z = 0.0 # No angular velocity # Publish the velocity command vel_pub.publish(velocity_cmd) # Keep the node running to continue publishing (or implement a more sophisticated control loop) rospy.spin() ``` -------------------------------- ### Open Gazebo World for Dataset Creation Source: https://www.yuque.com/xtdrone/manual_en/target_detection_tracking Command to open a Gazebo world file for creating a dataset. ```bash gazebo /home/robin/catkin_ws/src/darknet_ros/darknet/data/xtdrone/robocup.world ``` -------------------------------- ### Load some packages Source: https://www.yuque.com/xtdrone/manual_en/fixed_wing_formation_control Command to load necessary packages. ```bash roslaunch px4_control fixed_wing_formation_control.launch ``` -------------------------------- ### Start Simulation Source: https://www.yuque.com/xtdrone/manual_en/precise_landing Command to start the SITL simulation with three iris UAVs equipped with downward cameras and a UGV carrying AprilTags. ```bash roslaunch px4_control multi_uav_sitl_mavros.launch ``` -------------------------------- ### Check Docker Images Source: https://www.yuque.com/xtdrone/manual_en/docker?language=zh-cn Command to check the current Docker images and find the xtdrone image. ```bash docker images ``` -------------------------------- ### Start Tracking Script Source: https://www.yuque.com/xtdrone/manual_en/target_detection_tracking Command to start the tracking script after closing the multirotor keyboard control. Ensure the script path is correctly set. ```bash python /home/robin/catkin_ws/src/darknet_ros/darknet_ros/scripts/multi_object_tracking.py --weights /home/robin/catkin_ws/src/darknet_ros/darknet_ros/yolo_model.pt --config /home/robin/catkin_ws/src/darknet_ros/darknet_ros/cfg/yolov4-tiny.cfg --input /camera/image_raw --output /camera/depth/image_raw ``` -------------------------------- ### Run Demo Scripts with tmux (XTDGroundControl) Source: https://www.yuque.com/xtdrone/manual_en/formation_with_communication_model Example of running demo scripts using tmux for XTDGroundControl. The script 'communication_XTDGroundControl_pc.sh' is used, and specific commands within the script can be run individually if tmux is not used. ```Bash tmux new-session -d -s communication './communication_XTDGroundControl_pc.sh' ``` -------------------------------- ### Start keyboard control script (Fixed-wing) Source: https://www.yuque.com/xtdrone/manual_en/vehicle_config?language=zh-cn This command starts the keyboard control script for a fixed-wing UAV, with 1 indicating the aircraft number. ```bash roslaunch px4_control keyboard_control.launch vehicle=plane id:=1 ``` -------------------------------- ### Start ORBSLAM2 Source: https://www.yuque.com/xtdrone/manual_en/vslam Command to start ORBSLAM2 in a separate terminal after the PX4 simulation has begun. It notes that the system needs time to load the word bag. ```bash cd ~/catkin_ws/scripts/ sh xtdrone_run_stereo.sh ``` -------------------------------- ### Enter Leader-Follower Mode and Start Collaboration Source: https://www.yuque.com/xtdrone/manual_en/uav_formation After UAVs have hovered, press 'g' on the keyboard to enter leader-follower mode and then start the multi-camera collaboration script. ```bash rosrun multi_uav_formation multi_uav_formation_control.py ``` -------------------------------- ### Generate Launch File Source: https://www.yuque.com/xtdrone/manual_en/formation_with_communication_model Instructions on generating a launch file for UAV formation control, emphasizing the replacement of iris_stereo_camera with iris for efficiency and ensuring initial positions match the formation pattern. The example launch file 'iris20_exam1.launch' is provided in the 'formation_communication' folder. ```Bash roslaunch px4_bringup iris20_exam1.launch ``` -------------------------------- ### Start keyboard control script (Multirotor) Source: https://www.yuque.com/xtdrone/manual_en/vehicle_config?language=zh-cn This command starts the keyboard control script for the solo multirotor UAV, with 1 indicating the aircraft number and 'vel' for speed control. ```bash roslaunch px4_control keyboard_control.launch vehicle=solo id:=1 control_mode:=vel ``` -------------------------------- ### Generate Launch Files Source: https://www.yuque.com/xtdrone/manual_en/uav_formation_hardware-in-the-loop_simulation Command to generate 3x2 array of iris launch files for XTDrone simulation. ```bash python ~/XTDrone/tools/generate_launch.py --model iris --num 6 --output ~/PX4_Firmware/launch ``` -------------------------------- ### Modify Startup Script for Communication Source: https://www.yuque.com/xtdrone/manual_en/multi_vehicle Modify the startup script to establish communication between multiple vehicles. ```bash sed -i 's/exec uorb start -s etc\/init.d-posix\/rcS/exec uorb start -s etc\/init.d-posix\/rcS\n\n#Multi-vehicle communication\nexec uorb start -s etc\/init.d-posix\/rcS_multi_vehicle/g' Firmware\/launch\/px4.launch ``` -------------------------------- ### Modify Startup Script for Communication Source: https://www.yuque.com/xtdrone/manual_en/multi_vehicle?language=en-us Modify the startup script to establish communication for multiple vehicles. ```bash Modify the number of vehicles accordingly. ``` -------------------------------- ### Disable Multi-Vehicle Communications Source: https://www.yuque.com/xtdrone/manual_en/multi_vehicle Command to disable the multi-vehicle communication setup. ```bash sed -i 's/\n#Multi-vehicle communication\nexec uorb start -s etc\/init.d-posix\/rcS_multi_vehicle//g' Firmware\/launch\/px4.launch ``` -------------------------------- ### Import Docker Image Source: https://www.yuque.com/xtdrone/manual_en/docker Command to import the downloaded Docker image. ```bash docker load -i xtdrone_1.3.tar.gz ```