osrf / vrx

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

Initialize acoustic perception score #747

Closed caguero closed 8 months ago

caguero commented 8 months ago

This is a bug fix for the acoustic perception task. While running phase 2, I noticed an issue with the scoring. The score should be equal to the elapsed time needed to reach the pinger. However, if the team doesn't reach the pinger, the plugin was reporting a score of 0. Keep in mind that the lower the score the better. Instead, in that case the score should equal to the total running time (e.g. 300).

How to test it?

Run this task and let it timeout while watching the score.

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

And then:

ros2 topic echo /vrx/task/info
j-herman commented 8 months ago

@caguero This doesn't seem to be working as intended. The score stays at zero when I run the acoustic perception task. I didn't dig in too far, but it looks like SetScore isn't available until we get to the running state, and the remaining time stays at zero for the first couple of task message updates. Maybe use the timeout score?

caguero commented 8 months ago

6ac1771

Sorry, wrong code. It should work now.