Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch yarprobotinterface manually instead of when spawning the robot in simulation #193

Open
SimoneMic opened this issue Nov 20, 2023 · 9 comments
Labels
domain-software Related to Software prj-ergocub Related to ErgoCub Project team-fix Related to Team Fix

Comments

@SimoneMic
Copy link
Contributor

Since there are two different versions of the "basic" configuration of the yarprobotinterface: namely ergocub.xml and ergocub_ros2.xml it would be nice to have the possibility to select which one to launch. Now, the robot interface it's launched when the robot spawns in simulation, via robot urdf

The main issue is that is not possible to launch the ROS2 remappers separately in a different file, at a different time.

For simplicity, I think that removing it from the URDF would be the easiest path. Then the user can launch whichever configuration suits him best via yarprobotinterface --config <path/to/xml>

Would this be a feasible option?
I am also open to other solutions, if anything comes to mind.

Thank you

@SimoneMic SimoneMic added domain-software Related to Software prj-ergocub Related to ErgoCub Project team-fix Related to Team Fix labels Nov 20, 2023
@Nicogene
Copy link
Member

Specifically for running the ROS2 nws a possibility is to run a separate yarprobotinterface that, for each part, runs a nwc and a ros2 nws that attach to it. I think that this should be doable for both control boards or sensors/cameras.

This could introduce an overhead in performances (@elandini84 and @randaz81 know it better)

cc @traversaro

@randaz81
Copy link

randaz81 commented Nov 22, 2023

For simplicity, I think that removing it from the URDF would be the easiest path. Then the user can launch whichever configuration suits him best via yarprobotinterface --config <path/to/xml>

No, I think this is not a viable solution. The nws should run in the same process space of the device, inside gzserver.

@randaz81
Copy link

randaz81 commented Nov 22, 2023

The best solution that comes to my mind is to use two different urdfs.
Or you can use a single urdf with a parameter which is replaced, depending on which yarprobotinterface xml is required. For example:

ergocub.sh

sed 's/YARPROBOTINTERFACEFILE/ergocub.xml/g' model.urdf > run.urdf
gazebo run.urdf

ergocub_ros2.sh

sed 's/YARPROBOTINTERFACEFILE/ergocub_ros2.xml/g' model.urdf > run.urdf
gazebo run.urdf

@traversaro
Copy link
Member

Ideally it would be cool to be able to pass some kind of parameter from a Gazebo world, and then launch a different world based on the kind of ergocub you want to run. Would it be a suitable solution for you @SimoneMic ? How are you launching the simulation and/or adding the model to a running simulation?

@SimoneMic
Copy link
Contributor Author

Hi @traversaro, I am launching the simulation using this command: export YARP_CLOCK=/clock && gazebo -s libgazebo_yarp_clock.so -s libgazebo_ros_init.so (usually I also specify a world file) then I drag and drop the robot from the models menu.

@traversaro
Copy link
Member

then I drag and drop the robot from the models menu.

Would it be a problem if you inserted the model directly in the world instead of drag and drop manually it?

@SimoneMic
Copy link
Contributor Author

SimoneMic commented Nov 22, 2023

Would it be a problem if you inserted the model directly in the world instead of drag and drop manually it?

On my side I don't have any problems

@traversaro
Copy link
Member

Cool, thanks! I try to understand how we can pass parameters to gazebo_yarp_robotinterface via the .world file.

@traversaro
Copy link
Member

Cool, thanks! I try to understand how we can pass parameters to gazebo_yarp_robotinterface via the .world file.

Done, a proposal is ready in robotology/gazebo-yarp-plugins#672 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain-software Related to Software prj-ergocub Related to ErgoCub Project team-fix Related to Team Fix
Projects
None yet
Development

No branches or pull requests

4 participants