viser icon indicating copy to clipboard operation
viser copied to clipboard

Feature request: add_arrow()

Open LaVieEstDure opened this issue 6 months ago • 2 comments

It would be useful to have arrows as a primitive. Arrows are extremely common to use in robotics and vision:

  • rays in perception
  • forces (contact forces between rigid bodies, actuator forces like from thrusters/propellers)
  • velocities (either commanded or actual)
  • axes of rotation/angular velocities

And many more I'm sure. They're also a core primitive marker in similar visualisation software like rviz.

I'm aware we can add our own arrows if we import them as mesh, but I suspect it's a common enough usecase and that's enough friction that it's preferable to add them to viser.

LaVieEstDure avatar Jul 09 '25 04:07 LaVieEstDure

Thanks!

Yeah, there are decisions that need to be made about how configurable we'd want this to be but I think we can/should do some variant of:

  • Implement add_arrow() and add_batched_arrows() (similar API to add_mesh_*() and add_batched_meshes_*())
  • Implement add_arrows() (similar API to add_line_segments)
  • Add an arrowheads: np.ndarray | None argument to add_line_segments (where the array input is a boolean mask? or perhaps a float array with arrowhead sizes?)

brentyi avatar Jul 09 '25 11:07 brentyi

My personal preference is option 2 for what it's worth 😊 I don't think of arrows as specialised line segments and it feels more in line with the rest of the API on the specificity/reuse of methods on the Scene handler

LaVieEstDure avatar Jul 10 '25 12:07 LaVieEstDure