Skip to content

Competition APIs

Ian Chen edited this page Apr 12, 2022 · 12 revisions

The simulator offers a number of topics to retrieve information and feedback on the competition run, such as run time remaining, current phase, and current score. It also provides 2 important endpoints needed for the identification and intervention phases of the competition: One for streaming live video from the vehicles back to the operator, and another for report target vessels, small objects, and large objects.

ROS Topic Description Message type
/clock Current sim time rosgraph_msgs/msg/Clock
/mbzirc/run_clock Count down clock to indicate end of setup phase / run rosgraph_msgs/msg/Clock
/mbzirc/score Current score (time elapsed + penalty) std_msgs/msg/Float32
/mbzirc/phase Current phase std_msgs/msg/String
/mbzirc/target/stream/start Endpoint to stream live video imagery to sensor_msgs/msg/Image
/mbzirc/target/stream/report Endpoint for reporting targets ros_ign_interfaces/msg/StringVec
/mbzirc/target/stream/status Status of target stream reports std_msgs/msg/String

Phase

The /mbzirc/phase phase topic provides status on the current phase of the simulation. The phases are:

  • setup: Initial phase of the competition in which the simulator starts spawning robots in the start gate. The default time allowed for setup is 10 mins and the /mbzirc/run_clock topic outputs the time remaining in this phase.
  • started: The run officially starts once the setup time counts down to 0 or when a robot moves for more than 5 meters from its spawn location. The default time for the competition is 60 mins, and the /mbzirc/run_clock topic will now output the time remaining in this phase.
  • vessel_id_success: The target vessel has been successfully identified.
  • small_object_id_success: The small target object has been successfully identified.
  • large_object_id_success: The large target object has been successfully identified.
  • small_object_retrieve_success: The small target object has been successfully retrieved.
  • large_object_retrieve_success: The large target object has been successfully retrieved.
  • finished: Competition ended. All targets have been identified / retrieved. Simulation should now be paused.

Stream status

Ignition Topics and Services

You may notice instructions that reference Ignition topics or services in the tutorials. These are meant for use during local development and testing. These Ignition topics and services will not be available during the competition run.