Skip to content

Temasek-Dynamics/gestelt2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

451 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gestelt2

A Receding Horizon Planning (RHP) framework with a focus on multi-UAV navigation in cluttered environments.

Architecture

The architecture below illustrates the high-level architecture of Gestelt. Communication between the flight controller unit and the onboard computer uses the MICROXRCE-DDS protocol, with sensors such as the Vilota VK180Pro and VK180 using the eCAL protocol. Gestelt Architecture

The sections below go into more detail about each module and links are provided to their inner workings.

PlannerServer

Plugin-based server that generates a global plan.

Currently implemented plugins include astar_planner::AStarPlanner of base class gestelt_core::GlobalPlanner. Implementation found here

More Documentation

ControllerServer

Plugin-based server that generates a control input given a reference plan from the PlannerServer

Currently implemented plugins include linear_mpc_controller::LinearMPCController of base class gestelt_core::GlobalPlanner. Implementation found here

More Documentation

Trajectory Server

Interface between high level planning/control nodes and Flight Controller.

  • Handles take off, landing, emergency stop, mission mode etc.
  • Processes and filters command setpoints from ControllerServer

More Documentation

Vilota Bridge

This is a third party repo developed to bridge the eCAL topics from the Vilota sensors to ROS2 DDS. The eCAL topics being bridged includes the Visual Inertial Odometry (VIO) and the disparity map which is converted to a point cloud topic as input to the Occupancy map in the PlannerServer and ControllerServer module.

OccMap (Occupancy Map)

A probabilistic mapper that uses Bonxai at it's core.

More Documentation

MissionManager

MissionManager is an abstraction that allows us to take-off, land and send goals to multiple drones via a Python API. One example can be found at gestelt_commander/gestelt_commander/test_take_off_goal.py

The MissionManager class is located at gestelt_commander/gestelt_commander/mission_manager.py.

More Documentation

Installation and Setup for Simulation

0. Dependencies:

1. Install ROS2 and associated dependencies

# Install the Desktop version of ROS2 at https://docs.ros.org/en/humble/Installation.html 

# After installation, add the following commands to your .bashrc to enable colorized output and unbuffered output
export ROS_DISTRO="humble"
export RCUTILS_LOGGING_USE_STDOUT=1
export RCUTILS_LOGGING_BUFFERED_STREAM=0
export RCUTILS_COLORIZED_OUTPUT=1

# Install Package dependencies
sudo apt-get update && sudo apt-get install --no-install-recommends -y \
    vim curl wget tmux build-essential software-properties-common \
    python3-pip python3-vcstool \
    nlohmann-json3-dev \
    libasio-dev \
    libeigen3-dev \
    ros-$ROS_DISTRO-navigation2 \
    ros-$ROS_DISTRO-nav-2d-utils \
    ros-$ROS_DISTRO-message-filters 

sudo apt-get install -y ros-$ROS_DISTRO-geometry*
sudo apt-get install -y ros-$ROS_DISTRO-tf2*
sudo apt-get install -y ros-$ROS_DISTRO-pcl*
# Install ROS2 to Gazebo bridge
sudo apt-get install -y ros-$ROS_DISTRO-ros-gzharmonic*

2. Clone repos, including PX4-Autopilot repo and px4_msgs

mkdir -p ~/gestelt_ws/src/
git clone https://github.com/Temasek-Dynamics/gestelt2.git
cd ~/gestelt_ws/src/gestelt2
# Clone PX4-SITL Simulation
vcs import < simulation.repos --recursive --debug
# Clone px4_msgs library
vcs import < thirdparty.repos --recursive --debug

# Build OSQP and OSQP-Eigen libraries
mkdir -p ~/libraries/
cd ~/libraries
git clone https://github.com/osqp/osqp.git \
&& cd osqp \
&& git checkout e8fe4de264d167a67b2e704a2c03807c97af2080 \
&& mkdir build \
&& cd build \
&& sudo cmake -G "Unix Makefiles" .. \
&& sudo cmake --build . --target install

cd ~/libraries
git clone https://github.com/robotology/osqp-eigen.git \
&& cd osqp-eigen \
&& git checkout e4cb498faad37f03579f81f10c941f334a2a282f \
&& mkdir build \
&& cd build \
&& cmake ../ \
&& sudo make \
&& sudo make install 

3. Install dependencies for communication with FCU via MicroXCRE-DDS

(a) XRCE DDS installation

git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git --recursive -b v2.4.3
cd Micro-XRCE-DDS-Agent
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib/

4. (OPTIONAL, build if doing PX4 SITL Simulation) Build PX4-autopilot

# DO NOT CLONE THE PX4-AUTOPILOT REPO in the `src` folder of your colcon workspace. 
# The cloning step should be handled by the earlier installation instruction "vcs import < simulation.repos --recursive --debug"
git clone https://github.com/PX4/PX4-Autopilot.git --recursive 
cd ~/PX4-Autopilot
git checkout 3d36c8519de83afd7b4617c3496d0304fb17cc28 

# Install system dependencies 
bash ./Tools/setup/ubuntu.sh 
# Make SITL target for simulation
# NOTE: Enter 'u' to update all submodules when prompted
make px4_sitl
# IF you fail to build, run 'make distclean'
# Make x500 model, and check if it works successfully
make px4_sitl gz_x500

5. Build ROS2 workspace

# Assuming your workspace is named as follows
cd ~/gestelt_ws/ && colcon build --symlink-install

Quick start

To ease repeatability of experiments. We make use of scenarios which are configurations of drone spawn locations and environments stored in gestelt_mission/scenarios.json. Refer to gestelt_mission/README.md for more information.

For more details on what each launch file does, refer to gestelt_bringup/README.md

With PX4-SITL

To run a simulation with a dynamical model (with physics).

# Start QGroundControl, get it from https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html
# This is because the PX4 parameters are such that a ground control station is required for operation, but it can be disabled
# via a PX4 parameter.
/QGroundControl.AppImage

# Launch the simulation.
# To change the scenario, modify the `SCENARIO_NAME` in the launch file 
ros2 launch gestelt_bringup multi_drone_sim_launch.py 

# Command take-off and sending of goals
ros2 launch gestelt_bringup test_point_goal_sim.py

# Land the drone after it is done
ros2 run gestelt_commander land_sim

Known Issues

  • Drone cannot take off

    • Look at QGroundControl logs, are there missing sensors? If so, it could be a compatability with the ros_gz_bridge, of which there is no known solution, only a workaround.
    • The workaround is to launch gazebo using the PX4-SITL executable. In the simulation launch file multi_drone_sim_launch.py, make sure PX4_GZ_STANDALONE=1 is commented out. Relaunch and check if the sensors can be detected in QGroundControl.
  • Drone executes most of the path but is not able to move towards the goal when within 0.5m of it.

    • The suspicion is that the controller and planner algorithm is working as expected but the controller server might not have been calling the controller properly.
    • The fact is that the commands that are output from the controller server looks to be in the correct magnitude and sign but the drone is not executing them.

Actual drone

To test a single drone together with ground control computer (for visualization and mission commands), the following helper scripts are provided (TMUX required).

# Change directory to root of this repository

# On the drone
gestelt_integration/avetics/startup_scripts/gestelt_startup.sh

# On the ground control computer
gestelt_integration/avetics/startup_scripts/gcs_startup.sh

About

Gestelt on ROS2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors