ROS 2 message definitions automatically converted from the Basilisk astrodynamics framework C/C++ message definitions.
This package provides the ROS 2 message interface used by the Basilisk-ROS 2 Bridge to enable communication between Basilisk and ROS 2 nodes. It includes a conversion tool that can be re-run to update message definitions as Basilisk evolves.
cd your_ros2_workspace/src
git clone https://github.com/DISCOWER/bsk-msgs.git
cd ..
colcon build --packages-select bsk-msgs
source install/setup.bashOnce built and sourced, import the message types in your ROS 2 nodes:
Example:
from bsk_msgs.msg import CmdForceBodyMsgPayload, CmdTorqueBodyMsgPayload, SCStatesMsgPayloadAll converted messages should include a builtin_interfaces/Time stamp field for ROS 2 compatibility, along with the original Basilisk fields and preserved documentation comments.
The conversion tool regenerates the ROS 2 .msg files from the JSON payload metadata that Basilisk writes to dist3/autoSource/cMsgMeta/ during its build. It handles C/C++ to ROS 2 type mapping (including enums, std::vector, std::string and Eigen types), array sizes and nested payload structs, and comment preservation from the original headers. Multi-dimensional arrays are flattened in row-major order.
export BSK_PATH=<your-basilisk-path>
python3 tools/bsk_json_message_converter.pytools/bsk_message_converter.py is the previous converter, which parses the Basilisk headers directly. It works without a Basilisk build or with Basilisk versions that predate the JSON metadata, but skips fields it cannot parse, such as enums, multi-dimensional arrays and arrays sized by macro expressions.