Skip to content

Collection of messages which bridges the C++ components of RMF to the web interface

License

Notifications You must be signed in to change notification settings

cwrx777/rmf_api_msgs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rmf_api_msgs

Collection of json message schemas which bridges the C++ and python components of RMF to the web interface

Usage

Compile with colcon is recommended

colcon build --packages-select rmf_api_msgs
source install/setup.bash

Subsequently, to access the schemas, the user just needs to include/import the cpp header or py module into their source code.

  1. C++ example:
#include <rmf_api_msgs/schemas/task_state.hpp>

nlohmann::json schema = rmf_api_msgs::schemas::task_state
  1. Python example:
from rmf_api_msgs import schemas

# get schema
schema = schemas.task_state()

Python data model generation

To generate the data models based on the schemas, install datamodel-code-generator

pip3 install datamodel-code-generator

Recompile with colcon

colcon build --packages-select rmf_api_msgs
source install/setup.bash

The generated data models can then be accessed and used for development,

from rmf_api_msgs.models import task_state

# create task_state model
booking = task_state.Booking(id = "id0001")
task_state = task_state.TaskState(booking = booking)

About

Collection of messages which bridges the C++ components of RMF to the web interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 36.1%
  • Python 34.3%
  • CMake 29.6%