ROS 2 message definitions converted from the Basilisk Astrodynamics Framework (BSK) C/C++ message definitions.
This repository contains ROS 2 message definitions that have been automatically converted from Basilisk Astrodynamics Framework's (BSK) C/C++ message definitions. The conversion tool ensures compatibility between BSK's internal messaging system and ROS 2, enabling seamless integration of BSK modules within ROS 2 environments.
- Automatic Conversion: Includes a tool to automatically convert BSK's message definitions to ROS 2
.msg
files - Future-Proof: The conversion tool can be re-run to update message definitions as BSK evolves
- Type Mapping: Intelligent mapping from C/C++ types to ROS 2 message types
- Comment Preservation: Maintains documentation and comments from original BSK headers
- Macro Support: Handles BSK macro definitions for array sizes and constants
-
Clone the repository into your ROS 2 workspace:
cd your_ros2_workspace/src git clone https://github.com/DISCOWER/bsk-msgs.git
-
Build the package:
cd .. colcon build --packages-select bsk-msgs
-
Source the workspace:
source install/setup.bash
Once built and sourced, you can import and use the BSK message types in your ROS 2 nodes:
from bsk_msgs.msg import CmdForceBodyMsgPayload, CmdTorqueBodyMsgPayload, SCStatesMsgPayload
# Use the message types in your ROS 2 nodes
The repository includes a conversion tool that can regenerate the ROS 2 message definitions from BSK source code.
-
Ensure the
BSK_PATH
environment variable points to your Basilisk installation:export BSK_PATH=/path/to/basilisk
-
Run the conversion tool:
python3 tools/bsk_message_converter.py
The conversion tool (tools/bsk_message_converter.py
) provides:
- Type Mapping: Converts C/C++ types to appropriate ROS 2 types
- Array Handling: Processes fixed-size arrays using BSK macro definitions
- Comment Conversion: Preserves documentation from BSK headers
- Timestamp Addition: Automatically adds ROS 2 timestamp fields
- Macro Resolution: Resolves BSK macro definitions for array sizes and constants
All converted messages include:
- Timestamp:
builtin_interfaces/Time stamp
field for ROS 2 compatibility - Original Fields: All fields from the BSK message definition
- Documentation: Preserved comments and documentation from BSK headers
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test the conversion tool if modifying it
- Submit a pull request
This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.
Elias Krantz
Email: eliaskra@kth.se