Skip to content

idra-lab/mav-px4-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PX4 ROS2 SIMULATION ENVIRONMENT

Dependencies

sudo apt install libompl-dev

Components:

  • PX4 Autopilot

Follow installation guidelines from PX4 Autopilot ROS2

  • QGround Control FOllow installation guidelines from QGroundControl

  • ROS2 Humble

  • Gazebo

Use gazebo version such that it uses gz command.

  • UNSEEN ORB-SLAM3 Follow installation guidelines from ORB-SLAM3

Submodules

Update all submodules in the repository:

git submodule update --init --recursive

Set global paths:

In order to run the components, it is necessary to set global paths for PX4, QgroundControl and ORB-SLAM3.

PX4

Link the executable to the path here

QGroundControl

Link the executable to the path here

ORB-SLAM3 Node

Link the CMake configuration file to the global path of your orb slam implementation here

Launch demo

Build

source /opt/ros/<ROS_DISTRO>/setup.bash

colcon build

colcon build --symlink-install --packages-select orbslam3

source install/local_setup.bash

Launch

Terminal 1

ros2 launch uncertain_planner drone_planner.launch.py

Terminal 2

ros2 run traj offboard_takeoff --ros-args -p altitude:=4.0

Terminal 3

ros2 launch traj sim_demo.launch.py

Adding models to PX4

Launch simulation environment

Starting the simulation environment with the drone model and the world:

gz service -s /world/warehouse/control --reqtype gz.msgs.WorldControl --reptype gz.msgs.Boolean --timeout 3000 --req 'pause: false'
data: true
ros2 launch traj px4_sim.launch.py

Takeoff

ros2 run traj offboard_takeoff --ros-args -p  altitude:=4.0

OFFBOARD MODE

ros2 run traj offboard_control

Land

ros2 run traj land_disarm

Launch planner

ros2 run uncertain_planner drone_planner slam_map

Experiments

Rock 4c+

Everything is taken care of by running:

px4_modules

Raspberry Pi 4

Currently only run streaming of the camera and depth data:

rs_launch

All terminals on the commander computer

source aliases

Terminal 1

This command launches all necessary nodes to run the hardware:

run_hardware

Terminal 2

Once the drone has taken off (either manually or enabling the takeoff sequence with takeoff), run the following command to start the planner:

run_hardware_planner

Terminal 3

To record the bag file:

record_experiment

About

Custom Simulation with ROS2 and PX4 for mav

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors