Giter Site home page Giter Site logo

fucyuan / rtabmap_drone_example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matlabbe/rtabmap_drone_example

0.0 0.0 0.0 22.83 MB

Example of using move_base with mavros/px4 and rtabmap visual SLAM

License: BSD 3-Clause "New" or "Revised" License

Shell 28.36% C++ 28.66% Python 4.69% CMake 27.18% Dockerfile 11.10%

rtabmap_drone_example's Introduction

rtabmap_drone_example

2D navigation example of a drone using move_base with mavros/px4 and rtabmap visual SLAM.

Overview video (click to watch on Youtube):

Youtube

Install

Docker (recommended)

To make it simple, create the following docker image (nvidia GPU required):

git clone https://github.com/matlabbe/rtabmap_drone_example.git
cd rtabmap_drone_example
docker build -t rtabmap_drone_example -f docker/Dockerfile .

Host

Follow instructions from docker/Dockerfile to install dependencies.

Usage

Docker (recommended)

Launch the simulator:

XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -

docker run -it --rm \
  --privileged \
  --network=host \
  --env="DISPLAY=$DISPLAY" \
  --env="QT_X11_NO_MITSHM=1" \
  --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
  --env="XAUTHORITY=$XAUTH" \
  --volume="$XAUTH:$XAUTH" \
  --runtime=nvidia \
  rtabmap_drone_example \
  roslaunch rtabmap_drone_example gazebo.launch

Launch VSLAM:

XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -

docker run -it --rm \
  --privileged \
  --network=host \
  --env="DISPLAY=$DISPLAY" \
  --env="QT_X11_NO_MITSHM=1" \
  --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
  --env="XAUTHORITY=$XAUTH" \
  --volume="$XAUTH:$XAUTH" \
  --runtime=nvidia \
  rtabmap_drone_example \
  roslaunch rtabmap_drone_example slam.launch

Launch rviz:

XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -

docker run -it --rm \
  --privileged \
  --network=host \
  --env="DISPLAY=$DISPLAY" \
  --env="QT_X11_NO_MITSHM=1" \
  --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
  --env="XAUTHORITY=$XAUTH" \
  --volume="$XAUTH:$XAUTH" \
  --runtime=nvidia \
  rtabmap_drone_example \
  roslaunch rtabmap_drone_example rviz.launch

Arm and take off:

docker run -it --rm \
  --privileged \
  --network=host \
  rtabmap_drone_example \
  rosrun rtabmap_drone_example offboard

Host

roslaunch rtabmap_drone_example gazebo.launch
roslaunch rtabmap_drone_example slam.launch
roslaunch rtabmap_drone_example rviz.launch

rosrun rtabmap_drone_example offboard

Control

  • Autonomous control: use "2D Nav Goal" button in RVIZ to set a goal to reach
  • Manual control: If a joystick is plugged, you can send twists by holding L1 and moving the joysticks. Hold L1+L2 with left joystick down to land (be gentle to land smoothly), then hold left joystick in bottom-right position to disarm after the drone is on the ground.

rtabmap_drone_example's People

Contributors

matlabbe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.