-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
encodingRelated to message encoding/decoding (CDR, Protobuf, JSON)Related to message encoding/decoding (CDR, Protobuf, JSON)priority-P1High priority - core completenessHigh priority - core completeness
Description
Issue Description
Currently, Robocodec supports reading JSON-encoded messages but does not support writing them. A JSON encoder is useful for:
- Debugging and inspection
- Web API integration
- Human-readable data export
- Cross-system compatibility
Proposed Solution
Implement a JsonEncoder to complement the existing JsonDecoder.
Requirements
- Add encoder.rs module in src/encoding/json/
- Implement MessageCodec trait for JsonEncoder
- Support encoding from CodecValue to JSON format
- Handle all primitive types and nested structures
- Proper array/sequence serialization
- Handle ROS time types (Time, Duration) correctly
- Add unit tests for round-trip encoding/decoding
- Add integration tests
- Update documentation
Acceptance Criteria
- Can encode messages that were previously decoded by JsonDecoder
- Round-trip tests pass: decode → encode → decode produces equivalent JSON
- Output is valid, readable JSON
- Handles complex nested types (sequences, nested messages, time types)
References
- Existing decoder: src/encoding/json/decoder.rs
- Codec interface: src/encoding/codec.rs
- CDR encoder reference: src/encoding/cdr/encoder.rs
Priority: P1 - Core codec completeness
Estimated effort: Low-Medium
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
encodingRelated to message encoding/decoding (CDR, Protobuf, JSON)Related to message encoding/decoding (CDR, Protobuf, JSON)priority-P1High priority - core completenessHigh priority - core completeness