Caltech-AMBER / obelisk

A stable generic robot control interface.
https://caltech-amber.github.io/obelisk/
MIT License
5 stars 0 forks source link

Visualization Features and Ideas #39

Closed Zolkin1 closed 2 weeks ago

Zolkin1 commented 4 months ago

We want to interface with RVIZ easily. Most of this work has already been done since we are in the ROS ecosystem.

At the end of the day, the user can write code to support any visualization that ROS 2 can handle, so the question here is: what is the responsibility of Obelisk visualization?

I think we should provide ways to visualize any common Obelisk message types - this can happen one of three ways:

  1. The message type is already supported in RVIZ (see here)
  2. We provide a way to convert the Obelisk message to a supported message type
  3. We provide a custom RVIZ display that can show the message

(See here). The extent we can use option one, we should as that requires no code.

Consider the following two use cases for viz:

  1. The user wants to visualize a trajectory. To do this, they can compute the trajectory as normal in their controller node (or any node for that matter), then they will be responsible for publishing the message that holds the information to be visualized. We need to decide then if that message type is something that obelisk provides or not.
  2. The user has recorded hardware data and now wants to re-play it. In this case we assume the data is bagged, so if option 1 is in use, it is as simple as booting up rviz and playing the data. If they need a conversion, then we will need to launch a node that converts it for the replay, and lastly if there is a custom display then once again the user does not need to do anything.

We should also consider if we want any helper functions that translate objects in the world (i.e. stairs or stepping stones) into rviz objects so re-playing data makes more sense.

Is there any specific work we need to do to allow a user to visualize hardware and simulation data at the same time to see the difference?

The questions we need answered:

I think a very reasonable approach here is to just to provide some conversion functions to convert common data structures to messages that RVIZ supports and allowing ObeliskNodes to publish these.

Down the line we can implement custom displays if needed.

Other todos:

Zolkin1 commented 4 months ago

Publishing robot information to Rviz shouldn't be too hard, but we should use some other packages to make it easier.

We need to provide the urdf to Rviz too. I believe this can be done in a launch file.

Also see this tutorial.