Collection of json message schemas which bridges the C++ and python components of RMF to the web interface
Compile with colcon is recommended
colcon build --packages-select rmf_api_msgs source install/setup.bashSubsequently, to access the schemas, the user just needs to include/import the cpp header or py module into their source code.
- C++ example:
#include<rmf_api_msgs/schemas/task_state.hpp> nlohmann::json schema = rmf_api_msgs::schemas::task_state- Python example:
fromrmf_api_msgsimportschemas# get schemaschema=schemas.task_state()To generate the data models based on the schemas, install datamodel-code-generator
pip3 install datamodel-code-generatorRecompile with colcon
colcon build --packages-select rmf_api_msgs source install/setup.bashThe generated data models can then be accessed and used for development,
fromrmf_api_msgs.modelsimporttask_state# create task_state modelbooking=task_state.Booking(id="id0001") task_state=task_state.TaskState(booking=booking)