robotology / idyntree-yarp-tools

Tools based on the iDynTree library that depend on YARP.
GNU Lesser General Public License v2.1
6 stars 2 forks source link

Visualizer configuration #5

Closed S-Dafarra closed 3 years ago

S-Dafarra commented 3 years ago

It allows configuring the visualizer from the command line. Run

idyntree-visualizer --help

to have a set of possible parameters.

Since it can be used with models that can be very different, I avoided adding a configuration file, and I rather resorted to a series of default values that can be overwritten.

What is still missing:

Note that I avoided using the ReadOnlyRemoteControlBoard as I figured out that an RPC command reconnectToRobot was enough to reconnect the visualizer in case the communication with the robot gets interrupted. This allows us to not know how the joints are divided in the control boards, hence it should be more scalable. I don't know if we want to remove that plugin later on.

traversaro commented 3 years ago

Note that I avoided using the ReadOnlyRemoteControlBoard as I figured out that an RPC command reconnectToRobot was enough to reconnect the visualizer in case the communication with the robot gets interrupted. This allows us to not know how the joints are divided in the control boards, hence it should be more scalable. I don't know if we want to remove that plugin later on.

Just to clarify, the use of ReadOnlyRemoteControlBoard was useful to permit to visualize also the state as published when played back by the yarpdataplayer. In any case, this is not a big issue, and if anyone/any group wants to have that feature he/she can work on it, no need to prevent this from being merged.

traversaro commented 3 years ago

If you don't have any more modification we can merge.

S-Dafarra commented 3 years ago

Note that I avoided using the ReadOnlyRemoteControlBoard as I figured out that an RPC command reconnectToRobot was enough to reconnect the visualizer in case the communication with the robot gets interrupted. This allows us to not know how the joints are divided in the control boards, hence it should be more scalable. I don't know if we want to remove that plugin later on.

Just to clarify, the use of ReadOnlyRemoteControlBoard was useful to permit to visualize also the state as published when played back by the yarpdataplayer. In any case, this is not a big issue, and if anyone/any group wants to have that feature he/she can work on it, no need to prevent this from being merged.

Ah, you are right. The main problem is that I wanted to avoid setting the joint names manually every time. Hence, the trick was to consider all the joints in the URDF. The problem then is to understand how these joints are distributed in the control boards. With the RemoteControlBoardRemapper, this came easy since it is not necessary to divide the joints per control board. With the ReadOnlyRemoteControlBoard, this is not possible since it requires to set the axes names for each control board. As far as I understood, this information is considered absolute truth, and the input vector values are mapped to the joints according to the input order. Hence, not only I needed to get all the sets right, but also their order. This is ok once you know the robot, but I did not want to limit the usage of this tool to a specific set of robots. Do you envision any other way to circumvent this issue? How would be possible to use the RemoteControlBoardRemapper in conjunction with the ReadOnlyRemoteControlBoard?

If you don't have any more modification we can merge.

I don't have any other commits in the queue. If you want, I can change the name as per https://github.com/robotology/idyntree-yarp-tools/issues/1#issuecomment-816617352

S-Dafarra commented 3 years ago

After some more thinking, I believe we can simply add a command --connectToStateExt (cb1, (j1, j2), cb2, (j3, j4)) specifying the detailed list of joint for each control board. If you think it makes sense, I can deal with that in another PR.

traversaro commented 3 years ago

Do you envision any other way to circumvent this issue? How would be possible to use the RemoteControlBoardRemapper in conjunction with the ReadOnlyRemoteControlBoard?

These are good points, I think you can open a separate issue for this.

traversaro commented 3 years ago

I don't have any other commits in the queue. If you want, I can change the name as per #1 (comment)

Yes, thanks!

S-Dafarra commented 3 years ago

I don't have any other commits in the queue. If you want, I can change the name as per #1 (comment)

Yes, thanks!

Done in https://github.com/robotology/idyntree-yarp-tools/pull/5/commits/2863ba4a06d1724c8e5cf5a8ea4d7f0563446540 and https://github.com/robotology/idyntree-yarp-tools/pull/5/commits/e29e3a7fa0ddf0db37e6733665f0fb5aadeaebd8