|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |
Launch files
Messages
Services
Plugins
Recent questions tagged ros2_medkit_serialization at Robotics Stack Exchange
|
ros2_medkit_serialization package from ros2_medkit reporos2_medkit_diagnostic_bridge ros2_medkit_fault_manager ros2_medkit_fault_reporter ros2_medkit_gateway ros2_medkit_integration_tests ros2_medkit_msgs ros2_medkit_serialization |
ROS Distro
|
Package Summary
| Version | 0.3.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/selfpatch/ros2_medkit.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-03-05 |
| Dev Status | DEVELOPED |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- bburda
Authors
ros2_medkit_serialization
Runtime JSON ↔ ROS 2 message serialization library for the ros2_medkit gateway.
Overview
This package provides dynamic message serialization using dynmsg, enabling JSON ↔ ROS 2 message conversion at runtime without compile-time type dependencies. It eliminates CLI fallbacks in the gateway by providing native C++ APIs for all message operations.
Features
- JSON Serialization: Convert ROS 2 messages to/from JSON (via YAML bridge)
-
CDR Serialization: Serialize JSON to CDR format for
GenericPublisherandGenericClient -
CDR Deserialization: Deserialize CDR data from
GenericSubscriptionto JSON - Type Caching: Thread-safe caching of type introspection data with LRU eviction
- Service/Action Types: Helper functions for request/response/goal type derivation
- Schema Generation: Generate JSON schemas for ROS 2 message types
Dependencies
-
dynmsg- OSRF dynamic message introspection library -
nlohmann_json- JSON library -
yaml_cpp_vendor- YAML library (for dynmsg compatibility) -
rclcpp- ROS 2 client library (for SerializedMessage)
Usage
#include "ros2_medkit_serialization/json_serializer.hpp"
#include "ros2_medkit_serialization/type_cache.hpp"
// Get type info (cached)
auto& cache = ros2_medkit_serialization::TypeCache::instance();
auto type_info = cache.get("std_msgs", "String");
// Create serializer
ros2_medkit_serialization::JsonSerializer serializer;
// Serialize JSON to CDR for GenericPublisher
nlohmann::json msg_json = {{"data", "Hello World"}};
auto serialized = serializer.serialize("std_msgs/msg/String", msg_json);
// Use with: generic_publisher->publish(serialized);
// Deserialize CDR to JSON from GenericSubscription
nlohmann::json result = serializer.deserialize("std_msgs/msg/String", serialized_msg);
// Convert in-memory message to JSON
nlohmann::json json = serializer.to_json(type_info, message_ptr);
// Generate schema for a type
nlohmann::json schema = serializer.get_schema("geometry_msgs/msg/Twist");
API Reference
JsonSerializer
| Method | Description |
|---|---|
serialize(type, json) |
Serialize JSON to CDR SerializedMessage
|
deserialize(type, msg) |
Deserialize CDR to JSON |
to_json(type_info, ptr) |
Convert in-memory message to JSON |
from_json(type, json) |
Create message from JSON |
get_schema(type) |
Get JSON schema for type |
get_defaults(type) |
Get default values as JSON |
yaml_to_json(yaml) |
Convert YAML node to JSON (static) |
TypeCache
| Method | Description |
|---|---|
instance() |
Get singleton instance |
get(pkg, name) |
Get cached type info |
get(type_string) |
Get cached type info from full type string |
clear() |
Clear all cached entries |
Building
cd /path/to/ros2_medkit
colcon build --packages-select ros2_medkit_serialization
Testing
colcon test --packages-select ros2_medkit_serialization
colcon test-result --verbose
Design Documentation
See the design documentation for architecture details.
License
Apache-2.0
Changelog for package ros2_medkit_serialization
0.3.0 (2026-02-27)
0.2.0 (2026-02-07)
- Initial rosdistro release
- Runtime JSON to ROS 2 message serialization using vendored dynmsg C++ API
- TypeCache - thread-safe caching of ROS type introspection data with shared_mutex for read concurrency
- JsonSerializer - bidirectional JSON <-> ROS message conversion via dynmsg YAML bridge, including CDR serialization/deserialization for GenericClient/GenericSubscription
- ServiceActionTypes - helper utilities for resolving service and action internal types (request/response, goal/result/feedback)
- SerializationError exception hierarchy for structured error handling
- Contributors: Bartosz Burda
Package Dependencies
System Dependencies
| Name |
|---|
| nlohmann-json-dev |
Dependant Packages
| Name | Deps |
|---|---|
| ros2_medkit_fault_manager | |
| ros2_medkit_gateway |