osrf / vrx

Virtual RobotX (VRX) resources.
Apache License 2.0
389 stars 178 forks source link

Create competition_mode argument #710

Closed caguero closed 11 months ago

caguero commented 11 months ago

Fix issue #693.

This patch allows us to pass an extra competition_mode command line argument to enable/disable certain ROS 2 topics. As an example, I disabled the wind debug topics when competition_mode is enabled.

How to test it?

Run the simulation as usual:

ros2 launch vrx_gz competition.launch.py world:=practice_2023_stationkeeping2_task

Verify that the ROS 2 wind debug topics are available:

ros2 topic list

...
/vrx/debug/wind/direction
/vrx/debug/wind/speed
...

Now, stop the simulation and run it again in competition mode:

ros2 launch vrx_gz competition.launch.py world:=practice_2023_stationkeeping2_task competition_mode:=true

And verify again the ROS 2 debug wind topics:

ros2 topic list

You shouldn't see them now.

M1chaelM commented 11 months ago

The wind topics do not appear in competition mode, so that is working as expected. I still am seeing some topics that I thought would not show up, like

/vrx/stationkeeping/mean_pose_error
/vrx/stationkeeping/pose_error

Is this intended? Or is the plan to decide on the exact list of topics later on?

caguero commented 11 months ago

The wind topics do not appear in competition mode, so that is working as expected. I still am seeing some topics that I thought would not show up, like

/vrx/stationkeeping/mean_pose_error
/vrx/stationkeeping/pose_error

Is this intended? Or is the plan to decide on the exact list of topics later on?

If we know already which topics need to be excluded I can include them now.

M1chaelM commented 11 months ago

If we know already which topics need to be excluded I can include them now.

OK, I thought we could start by looking at what was excluded by the previous version of this command. In gazebo classic the variable was called non_competition_mode and it was passed to vrx.launch here's the line in VRX docker.

Unfortunately I don't see any such variable implemented on the VRX side for any previous version of VRX, so now I'm wondering whether this has ever been functional.

caguero commented 11 months ago

I just excluded some extra topics when vrx is in competition mode. 3553c48

M1chaelM commented 11 months ago

Checking competition mode for: