osrf / vorc

Virtual Ocean Robot Challenge (VORC) resources
Apache License 2.0
38 stars 11 forks source link

Gymkhana scoring plugin #22

Closed mabelzhang closed 4 years ago

mabelzhang commented 4 years ago

Runs station-keeping + navigation scoring plugins at the same time. Takes the score from station-keeping if the channel has been passed.

Depends on https://github.com/osrf/vrx/pull/224 The goal for the blackbox is specified in Cartesian coordinates, since the pinger YAML is specified in Cartesian. This places the red marker for station-keeping above the pinger.

These are the topics associated with the scoring plugin. The gymkhana is from the new top-level VORC scoring plugin. The gymkhana_blackbox is from a VRX station-keeping scoring plugin. The gymkhana_channel is from a VRX navigation scoring plugin.

$ rostopic list
...
/vorc/gymkhana/debug/contact
/vorc/gymkhana/task/info
/vorc/gymkhana_blackbox/debug/contact
/vorc/gymkhana_blackbox/goal
/vorc/gymkhana_blackbox/pose_error
/vorc/gymkhana_blackbox/rms_error
/vorc/gymkhana_blackbox/task/info
/vorc/gymkhana_channel/debug/contact
/vorc/gymkhana_channel/task/info
...

To test:

Keep this command running in a terminal:

$ rostopic echo /vorc/gymkhana/task/info

Initially, the score is always 0.

Use keyboard / joystick to move the boat into the channel. Once the boat crosses the last gate (determined by /vorc/gymkhana_channel/task/info fields state == "finished" and timed_out == false), non-zero scores should pop up (taken directly from score from /vorc/gymkhana_blackbox/task/info).

Essentially, the score is invalid until the boat crosses the last gate.

The only drawback with this invalidation approach is that, if two users do not cross the last gate, but one got farther than the other, they will both get 0. One possible way we can have their scores be differentiated is to put something different in the state field of the top-level plugin Task info topic /vorc/gymkhana/task/info. Currently it's "running" or "finished". Maybe if we want to give such users non-zero scores, we can indicate in the state whether they crossed the gate? Then that can be used in combination with the raw score to place the user, if we want.

mabelzhang commented 4 years ago

Comments should have been addressed. Wiki has been updated with topics of the task https://github.com/osrf/vorc/wiki/Tasks#4-black-box-gymkhana-task