Thanks to visit codestin.com
Credit goes to github.com

Skip to content

aerorobotics/ros2basilisk

Repository files navigation

ROS Basilisk

ROS Basilisk is a wrapper that provides ROS2-interface for Basilisk Astrodynamics Simulation Framework. Tested on Ubuntu 20.04 LTS, ROS2 Galactic. This package aims to support the numerical verification and validation of spacecraft GNC and higher level authonomy software implemented with ROS2.

The main functionality of ROS Basilisk is to run (1) Basilisk simulation side by side with other ROS nodes and (2) provide examples for how Basilisk messages can be translated to ROS messages and vice versa.

ROS Basilisk Diagram

Docker

We provide the docker container with ROS2 and Basilisk pre-installed. Please see the docker instruction here.

Manual Instruction

In this instruction, we assume Basilisk is installed at /home/UserName/basilisk (home directory) and ROS2 workspace is created at /home/UserName/basilisk_ws. The choice of installation location for Basilisk and other software is up to the user but paths should be changed appropriately.

The repo also provides basic attitude control and formation keeping algorithms implemented in ROS2 for the demonstration purpose.

Prerequisites

  1. Install ROS2 Galactic
  2. Install Basilisk. We assme Basilisk is installed in home directory /home/UserName/. Some tips regarding Basilisk installation:
    1. Make sure you are in a venv!
    2. Install using this command: python3 conanfile.py --clean --opNav True --vizInterface True --buildProject True
    3. For debug mode: python3 conanfile.py --clean --buildType Debug --opNav True --vizInterface True --buildProject True.
      1. Debug mode allows for more descriptive error messages in gdb or other C debuggers. Can also debug in Release. Could use CLion too, use these instructions to debug in CLion: https://www.jetbrains.com/help/clion/debugging-python-extensions.html#attach-py

Setup ROS2 workspace

  1. If the workspace does not already exists, create one mkdir -p basilisk_ws/src
  2. Clone this repo into workspace cd basilisk_ws/src && git clone https://github.com/aerorobotics/ros2basilisk
  3. Install Python pre-requisites within the virtual environment source ~/basilisk/.venv/bin/activate && pip3 install -r ros2basilisk/requirements.txt

Running Demo

  1. Build workspace at the top of workspace directory cd ~/basilisk_ws && colcon build
  2. Source the envrionment source ~/basilisk/.venv/bin/activate && source ~/basilisk_ws/install/setup.bash
  3. Add python paths. Launch needs the Basilisk python location: export PYTHONPATH=$PYTHONPATH:/home/$(id -un)/basilisk/.venv/lib/python3.8/site-packages && export PYTHONPATH=$PYTHONPATH:/home/$(id -un)/basilisk/dist3
  4. Launch ROS2Basilisk: ros2 launch ros2basilisk demo_launch.py ws:="/home/UserName/basilisk_ws/" This creates output data in data/runs/default_run
  5. Visualize the simulation result: python src/ros2basilisk/script/data_analysis.py

Customization

Creating ROS/Basilisk messages

This is same as creating a ROS2 message.

  1. Create a file in the msg folder. Call it YOUR_MESSAGE_NAME.msg, then fill it out.
  2. Add "msg/YOUR_MESSAGE_NAME.msg" into CMakeLists.txt, add it into the function where it starts with rosidl_generate_interfaces(${PROJECT_NAME} where all the other messages are.

Creating new simulation scenarios

  1. Modify RosBasilisk.py, RosBskTask.py, and Simulation.py to modify Basilisk simulation scenario.

Citation

If you use this repository, please make sure to cite our work.

@inproceedings{matsuka2023high,
  title={High-Fidelity, Closed-Loop Simulation of Spacecraft Vision-Based Relative Navigation in ROS2},
  author={Matsuka, Kai and Zhang, Leo and Ragheb, Isabelle and Ohenzuwa, Christine and Chung, Soon-Jo},
  year={2023},
  publisher={AIAA},
  booktitle={2023 33rd AAS/AIAA Space Flight Mechanics Meeting}
}

This work was presented at 33rd AAS/AII Space Flight Mechanics Meeting in a paper titled "High-fidelity, closed-loop simulation of spacecraft vision-based relative navigation in ROS2." Our paper can be found here.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •