Skip to content

Repository files navigation

SRFV Controller

ROS 2 and PX4/Gazebo control stack for a caged spherical drone used for GPS-denied confined-space inspection.

Description

SRFV Controller is built for a Spherical Rolling Flying Vehicle, a caged drone intended for hazardous inspection tasks in tunnels, chimneys, ducts, and other confined spaces. Normal drones struggle in these environments because GPS is unavailable and the space is too narrow for safe free flight. The spherical cage protects the vehicle during contact with walls and obstacles, making it a better platform for inspection in GPS-denied areas.

This project implements and tests the controller in simulation. It includes a custom PX4/Gazebo caged X500 model, a rotor-plane-normal controller, rolling odometry from gimbal and attitude data, trajectory generation, Gazebo-to-ROS bridges, RViz path visualization, and unit tests.

Built With

  • Language: C++17
  • Framework: ROS 2, ament_cmake
  • Simulation: PX4 SITL, Gazebo Harmonic
  • Middleware: Micro XRCE-DDS Agent, ros_gz_bridge
  • Math Library: Eigen
  • Visualization: RViz, MATLAB ROS Toolbox

Prerequisites

Before running this project, ensure you have the following installed:

  • ROS 2 with a colcon workspace
  • PX4-Autopilot checkout
  • Gazebo Harmonic and ros_gz_bridge
  • Micro XRCE-DDS Agent
  • px4_msgs
  • Eigen

Installation & Setup

  1. Clone or place this package inside your ROS 2 workspace:

    cd ~/ros2_ws/src
    git clone <repository-url> srfv_controller
  2. Install the custom PX4 model:

    cd ~/ros2_ws/src/srfv_controller
    ./scripts/install_px4_model.sh
  3. Build and source the package:

    cd ~/ros2_ws
    colcon build --packages-select srfv_controller --symlink-install
    source install/setup.bash
  4. Run tests:

    colcon test --packages-select srfv_controller --event-handlers console_direct+

Usage

Start the system in separate terminals:

source ~/ros2_ws/install/setup.bash
cd ~/PX4-Autopilot
make px4_sitl gz_x500_custom
cd ~/Micro-XRCE-DDS-Agent/build
MicroXRCEAgent udp4 -p 8888
source ~/ros2_ws/install/setup.bash
source install/setup.bash
ros2 launch srfv_controller srfv_universal_bridge.launch.py

Then run a trajectory and the controller. Full commands for hold, square, circle, figure-eight, RViz, MATLAB, and validation are in docs/usage.md.

Results

The controller was implemented and tested in a PX4/Gazebo simulated environment. The custom caged X500 model can be launched in PX4 SITL, connected to ROS 2 through the bridge, and commanded using hold, square, circle, and figure-eight reference trajectories.

The desired path, estimated rolling-odometry path, and Gazebo cage ground-truth path can be compared in RViz. Current validation is simulation-based; real-world inspection, sensor-based navigation, and larger tunnel-like environments remain future work.

Project Structure

  • src/paper_controller.cpp - paper dynamics, RPN control, wrench generation, and motor allocation.
  • src/rpn_position_controller.cpp - main controller node, rolling odometry, safety checks, motor commands, and RViz paths.
  • src/trajectory_reference_node.cpp - hold, square, circle, and figure-eight reference generator.
  • src/cage_ground_truth_node.cpp - Gazebo cage-link ground truth publisher.
  • model/x500_base_custom - cage, gimbals, drone body, sensors, and rolling-resistance model.
  • model/x500_custom - PX4 motor-plugin wrapper around the custom model.
  • launch/srfv_universal_bridge.launch.py - Gazebo-to-ROS bridge launch file.
  • docs/usage.md - detailed run commands and validation notes.

TODO

  • Gimbal-lock avoidance
  • Power/normal-force optimization
  • Negative/bidirectional thrust
  • Full auxiliary-objective allocation
  • Remaining paper-level validation

Author

Atharv Nawale - atharvnawale74@gmail.com

Acknowledgement

This work was done under the Dynamics and Control Lab, Department of Aerospace Engineering, IIT Bombay, with Prof. Hemendra Arya as PI.

About

ROS 2 and PX4/Gazebo controller for a caged spherical drone.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages