GithubHelp home page GithubHelp logo

hpaul360 / mocap_to_px4 Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 29 KB

MOCAP to PX4 position publisher in ROS2.

License: MIT License

Python 25.75% CMake 7.20% C++ 67.05%
mocap px4 odometry position-tracking optitrack px4-autopilot px4-ros2 ros2 ros2-humble

mocap_to_px4's Introduction

Mocap to PX4 ROS2 Package

Overview

The Mocap to PX4 ROS2 package is designed to bridge motion capture (MOCAP) data with the PX4 flight controller. It subscribes to MOCAP rigid body data, transforms the information, and publishes it as odometry data compatible with PX4.

Prerequisites

  • ROS2 (Robot Operating System 2)
  • PX4 firmware configured to receive odometry data

Installation

  1. Clone this repository to your ROS2 workspace:

    git clone https://github.com/hpaul360/mocap_to_px4.git
  2. Build the package:

    colcon build --symlink-install
  3. Source the ROS2 setup file:

    source install/setup.bash

Usage

  1. Ensure your PX4 flight controller is configured to receive odometry data.

  2. Launch the mocap_to_px4 converter node only:

    # if body_id argument is not passed, the default body_id=1 is used
    ros2 launch mocap_to_px4 converter_launch.py body_id:=5

    OR

    Launch the mocap_to_px4 with mocap_client (Requires mocap_ros2 package):

    # if body_id argument is not passed, the default body_id=1 is used
    ros2 launch mocap_to_px4 mocap_launch.py body_id:=5
  3. The node will subscribe to MOCAP data, transform it, and publish odometry data to PX4.

Parameters

  • Set the ID of the rigid body (body_id) to subscribe from MOCAP, as argument when launching the node. Adjust as needed.

Transforms

  • Adjusts the sign of the MOCAP position along the Y-up frame to match PX4's coordinate frame.
  • Adjusts the quaternion orientation to match PX4's expectations.

VehicleOdometry Message Fields

  • timestamp, timestamp_sample, pose_frame, position, q: Representing the odometry data.
  • velocity_frame, velocity, angular_velocity, position_variance, orientation_variance, velocity_variance: Additional information.

License

This software is released under the MIT License. See the LICENSE file for details.

Author

Issues and Contributions

  • Report any issues or contribute to the development of this package on GitHub.

Contact

  • For questions or further assistance, feel free to contact the author Hannibal Paul.

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.