Skip to content

common: add Cylinder to the Geometry oneof - #949

Merged
Gabriel Gottlob (gabegottlob) merged 5 commits into
mainfrom
ggottlob/cylinder-geometry
Nov 23, 2026
Merged

Gabriel Gottlob (gabegottlob) merged 5 commits into
mainfrom
ggottlob/cylinder-geometry

Conversation

@gabegottlob

@gabegottlob Gabriel Gottlob (gabegottlob) commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Add a Cylinder message to the Geometry oneof so RDK cylinders can be sent over gRPC. RDK's Cylinder.ToProtobuf panics today because there is no message to encode into. Field names follow Capsule, so length_mm is the end-to-end length along the local Z axis.

❓ Open question: this overlaps #894, which uses height_mm. This PR uses length_mm to match Capsule, URDF, SDF and the RDK l config field. Which name should land?

Changes

  • uncapped: phrased negatively so the proto3 default (false) is a solid cylinder; a positive capped would decode every old or unset cylinder as an open tube
  • Geometry oneof: cylinder = 8 is additive; buf breaking --against main is clean
  • generated code: regenerated with mise r buf-go and mise r buf-web; most of the common.pb.go diff is shifted message indexes

Testing

Claude Code prompts used
  • "for right now we want cylinders working end to end in viam, even if they are not perfect. so we dont want to worry about the hairy collision math fo rnow."
  • "lets go with length_mm + uncapped. lets put up those 2 prs for now as drafts (this rdk one and the api one)"

🤖 Generated with Claude Code

@viambot viambot added the safe to test committer is a member of this org label Nov 17, 2026
@gabegottlob
Gabriel Gottlob (gabegottlob) force-pushed the ggottlob/cylinder-geometry branch 2 times, most recently from 02d83e4 to b549a21 Compare November 17, 2026 19:49
@gabegottlob Gabriel Gottlob (gabegottlob) added the ready-for-protos add this when you want protos to compile on every commit label Nov 17, 2026
@gabegottlob
Gabriel Gottlob (gabegottlob) marked this pull request as ready for review November 17, 2026 21:57
Comment thread proto/viam/common/v1/common.proto Outdated
double length_mm = 2;
// When true, the flat end caps are omitted: an open tube with no interior volume. Phrased
// negatively so the default (false) is a solid cylinder, matching URDF and SDF cylinders.
bool uncapped = 3;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is uncapped already in use in the code?

@gabegottlob Gabriel Gottlob (gabegottlob) Nov 23, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Technically does exist in the RDK but not really usable as of now. Going to leave them out of the proto for now until we are sure we want them. Also now that we are only dealing with solid/capped cylinders, let me know if you want me to change the mesh representation so that it encloses the underlying cylinder (more conservative representation).

@NickPPC Nicolas Palpacuer (NickPPC) removed the ready-for-protos add this when you want protos to compile on every commit label Nov 23, 2026
Adds a Cylinder message (radius_mm, length_mm, uncapped) as field 8 of
the Geometry oneof so RDK's spatialmath.Cylinder can be sent over gRPC.
length_mm matches Capsule; uncapped defaults to a solid cylinder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open (uncapped) cylinders have no confirmed users over the wire, so the
message stays solid-only for now. A field can be added later as
`bool uncapped` so an unset value still decodes as solid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabegottlob Gabriel Gottlob (gabegottlob) added the ready-for-protos add this when you want protos to compile on every commit label Nov 23, 2026
@NickPPC Nicolas Palpacuer (NickPPC) removed the ready-for-protos add this when you want protos to compile on every commit label Nov 23, 2026
@gabegottlob Gabriel Gottlob (gabegottlob) added the ready-for-protos add this when you want protos to compile on every commit label Nov 23, 2026
@gabegottlob Gabriel Gottlob (gabegottlob) removed the ready-for-protos add this when you want protos to compile on every commit label Nov 23, 2026
@gabegottlob
Gabriel Gottlob (gabegottlob) merged commit f7d26ea into main Nov 23, 2026
11 of 14 checks passed
@gabegottlob
Gabriel Gottlob (gabegottlob) deleted the ggottlob/cylinder-geometry branch November 23, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

protos-compiled safe to test committer is a member of this org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants