kasperg3 / px4-offboard

Example of offboard control over microdds using python ROS 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

px4-offboard

This repository contains a python examples for offboard control on ROS2 with PX4

The px4_offboard package contains the following nodes

  • offboard_control.py: Example of offboard position control using position setpoints
  • visualizer.py: Used for visualizing vehicle states in Rviz

The source code is released under a BSD 3-Clause license.

  • Author: Jaeyoung Lim
  • Affiliation: Autonomous Systems Lab, ETH Zurich

Setup

Add the repository to the ros2 workspace

git clone https://github.com/Jaeyoung-Lim/px4-offboard.git

Running

You will make use of 3 different terminals to run the offboard demo.

On the first terminal, run a SITL instance from the PX4 Autopilot firmware.

make px4_sitl gazebo

On the second terminal terminal, run the micro-ros-agent which will perform the mapping between Micro XRCE-DDS and RTPS. So that ROS2 Nodes are able to communicate with the PX4 micrortps_client.

micro-ros-agent udp4 --port 8888

In order to run the offboard position control example, open a third terminal and run the the node. This runs two ros nodes, which publishes offboard position control setpoints and the visualizer.

ros2 launch px4_offboard offboard_position_control.launch.py

offboard

In order to just run the visualizer,

ros2 launch px4_offboard visualize.launch.py

About

Example of offboard control over microdds using python ROS 2

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


Languages

Language:Python 100.0%