feat(msgs): add PointStamped geometry message type#1388
feat(msgs): add PointStamped geometry message type#1388spomichter wants to merge 7 commits intodevfrom
Conversation
Greptile SummaryThis PR adds Key changes:
The implementation is clean, follows established patterns in the codebase (similar to Confidence Score: 5/5
Important Files Changed
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
Last reviewed commit: 222137f |
| 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 |
There was a problem hiding this comment.
hardcoded absolute paths will fail in CI and other environments. tests should import from the module directly
| 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 |
c0b7143 to
6c0bd5d
Compare
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
7622abe to
17c5c19
Compare
- 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
|
@greptile |
Point is a separate LCM message type, should have its own file like Vector3, Quaternion, Pose, etc.
|
|
||
| msg_name = "geometry_msgs.Point" | ||
|
|
||
| def __init__(self, x: float = 0.0, y: float = 0.0, z: float = 0.0) -> None: |
There was a problem hiding this comment.
this is good, given it inherits from LCMPoint we just have a nice init but no need to redefine lcm_encode/decode
There was a problem hiding this comment.
I know i initially had as Vector3 which is functionally the same as Point
There was a problem hiding this comment.
But knew we'd need eventually
4322d81 to
222137f
Compare
adds
geometry_msgs.PointStampedfollowing the PoseStamped pattern.what
new message type for 3d point coordinates with timestamp and frame_id. follows the rviz
/clicked_pointconvention.why
the rerun viewer fork (dimensionalOS/rerun#1) publishes click coordinates as
PointStampedvia LCM to/clicked_point. this type lets any dimos module subscribe natively viaLCMTransport("/clicked_point", PointStamped)and convert toPoseStampedfor navigation.changes
PointStamped.pytest_PointStamped.py__init__.pyfeatures
plum.dispatchconstructors:(x,y,z),(Vector3),([list]),(kwargs)lcm_encode()/lcm_decode()— binary roundtripto_rerun()→rr.Points3Dto_pose_stamped()→ PoseStamped with identity orientationDimosMsgprotocolTimestampedmixin (ts, frame_id)usage
tests
DIM-643