Skip to content

feat(msgs): add PointStamped geometry message type#1388

Open
spomichter wants to merge 7 commits intodevfrom
feat/pointstamped-msg
Open

feat(msgs): add PointStamped geometry message type#1388
spomichter wants to merge 7 commits intodevfrom
feat/pointstamped-msg

Conversation

@spomichter
Copy link
Contributor

adds geometry_msgs.PointStamped following the PoseStamped pattern.

what

new message type for 3d point coordinates with timestamp and frame_id. follows the rviz /clicked_point convention.

why

the rerun viewer fork (dimensionalOS/rerun#1) publishes click coordinates as PointStamped via LCM to /clicked_point. this type lets any dimos module subscribe natively via LCMTransport("/clicked_point", PointStamped) and convert to PoseStamped for navigation.

changes

file what
PointStamped.py dimos msg type — inherits from dimos_lcm + Timestamped
test_PointStamped.py 30 unit tests
__init__.py export PointStamped

features

  • plum.dispatch constructors: (x,y,z), (Vector3), ([list]), (kwargs)
  • lcm_encode() / lcm_decode() — binary roundtrip
  • to_rerun()rr.Points3D
  • to_pose_stamped() → PoseStamped with identity orientation
  • conforms to DimosMsg protocol
  • Timestamped mixin (ts, frame_id)

usage

from dimos.msgs.geometry_msgs import PointStamped

# construct
pt = PointStamped(1.5, 2.5, 3.5, frame_id="/world/grid")

# convert to nav goal
pose = pt.to_pose_stamped()

# subscribe via LCM (from rerun viewer clicks)
from dimos.core.transport import LCMTransport
transport = LCMTransport("/clicked_point", PointStamped)

tests

30 passed in 2.02s

DIM-643

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 1, 2026

Greptile Summary

This PR adds PointStamped and Point message types to the geometry_msgs module, enabling 3D point coordinates with timestamps and frame IDs. The implementation follows a simplified architecture where Point inherits directly from LCMPoint and PointStamped uses multiple inheritance from both Point and Timestamped.

Key changes:

  • New Point class wrapping geometry_msgs.Point with clean inheritance from LCMPoint
  • New PointStamped class combining 3D coordinates with timestamp and frame metadata
  • LCM binary encoding/decoding for wire protocol compatibility
  • Conversion methods: to_rerun() for visualization and to_pose_stamped() for navigation
  • Comprehensive test coverage for inheritance, LCM roundtrip, and conversions

The implementation is clean, follows established patterns in the codebase (similar to TwistStamped), and provides the functionality needed for integrating Rerun viewer click coordinates into the dimos navigation system.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is clean and well-tested. It follows established patterns in the codebase (matching TwistStamped's architecture), uses proper inheritance hierarchy, and includes test coverage for core functionality. The code is straightforward with no complex logic, security concerns, or breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
dimos/msgs/geometry_msgs/PointStamped.py New file implementing Point and PointStamped message types with LCM encoding/decoding and conversion methods
dimos/msgs/geometry_msgs/init.py Adds Point and PointStamped to module exports
dimos/msgs/geometry_msgs/test_PointStamped.py Unit tests covering Point inheritance, LCM roundtrip encoding, and PoseStamped conversion

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class LCMPoint {
        +float x
        +float y
        +float z
    }
    
    class Point {
        +string msg_name
        +__init__(x, y, z)
        +__repr__()
    }
    
    class Timestamped {
        +float ts
        +string frame_id
        +dt()
        +ros_timestamp()
    }
    
    class PointStamped {
        +string msg_name
        +__init__(x, y, z, ts, frame_id)
        +lcm_encode() bytes
        +lcm_decode(data) PointStamped
        +to_rerun() Archetype
        +to_pose_stamped() PoseStamped
        +__str__()
        +__repr__()
    }
    
    class PoseStamped {
        +position
        +orientation
    }
    
    LCMPoint <|-- Point : inherits
    Point <|-- PointStamped : inherits
    Timestamped <|-- PointStamped : inherits
    PointStamped ..> PoseStamped : converts to
Loading

Last reviewed commit: 222137f

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 21 to 28
sys.path.insert(0, "/home/ubuntu/dimos")

from dimos.msgs.geometry_msgs.Vector3 import Vector3
from dimos.msgs.protocol import DimosMsg

# Import from local file (same directory)
sys.path.insert(0, "/home/ubuntu/.openclaw/workspace/engineering/DIM-643/lcm_integration")
from PointStamped import PointStamped
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcoded absolute paths will fail in CI and other environments. tests should import from the module directly

Suggested change
sys.path.insert(0, "/home/ubuntu/dimos")
from dimos.msgs.geometry_msgs.Vector3 import Vector3
from dimos.msgs.protocol import DimosMsg
# Import from local file (same directory)
sys.path.insert(0, "/home/ubuntu/.openclaw/workspace/engineering/DIM-643/lcm_integration")
from PointStamped import PointStamped
from dimos.msgs.geometry_msgs import PointStamped

@spomichter spomichter force-pushed the feat/pointstamped-msg branch from c0b7143 to 6c0bd5d Compare March 1, 2026 14:42
adds geometry_msgs.PointStamped following the PoseStamped pattern:
- inherits from dimos_lcm PointStamped + Timestamped mixin
- lcm_encode/lcm_decode for binary roundtrip
- to_rerun() → rr.Points3D
- to_pose_stamped() → PoseStamped with identity orientation
- plum.dispatch constructors (x/y/z, Vector3, list, kwargs)
- conforms to DimosMsg protocol
- 30 unit tests

enables the rerun viewer click-to-navigate pipeline: viewer publishes
PointStamped to /clicked_point via LCM, any module subscribes via
LCMTransport and converts to PoseStamped for navigation.

DIM-643
@spomichter spomichter force-pushed the feat/pointstamped-msg branch from 7622abe to 17c5c19 Compare March 1, 2026 16:05
spomichter and others added 4 commits March 1, 2026 16:12
- replace multi-dispatch constructors with single __init__(x, y, z, ts, frame_id)
- inherit from Point(LCMPoint) instead of Vector3(LCMVector3)
- add Point wrapper class for geometry_msgs.Point
- simplify tests to focus on LCM roundtrip per review feedback

addresses review comments from leshy on PR #1388
3 focused tests: lcm roundtrip, Point inheritance, PoseStamped conversion
@spomichter
Copy link
Contributor Author

@greptile

Point is a separate LCM message type, should have its own file
like Vector3, Quaternion, Pose, etc.
leshy
leshy previously approved these changes Mar 1, 2026

msg_name = "geometry_msgs.Point"

def __init__(self, x: float = 0.0, y: float = 0.0, z: float = 0.0) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is good, given it inherits from LCMPoint we just have a nice init but no need to redefine lcm_encode/decode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know i initially had as Vector3 which is functionally the same as Point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But knew we'd need eventually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants