# note that all ROS2 topics must be prefixed:
#   rt/ (ROS Topic): Prefixed to all standard ROS 2 topics.
#   rq/<service_name>Request (ROS Service Request): Prefixed to the request topic of a ROS 2 service.
#   rr/<service_name>Reply (ROS Service Reply): Prefixed to the reply topic of a ROS 2 service.
#   rs/ (ROS Service): Reserved for systems where services are handled as a single entity rather than separate request/reply topics. 
#   [action_topic]/_action/status: A topic for goal status updates.
#   [action_topic]/_action/feedback: A topic for feedback during execution.
#   [action_topic]/_action/send_goal: A service to initiate the action.
#   [action_topic]/_action/get_result: A service to retrieve the final result.
#   [action_topic]/_action/cancel_goal: A service to cancel an active goal. 

# all topics are bidirectional by default. See https://eprosima-dds-router.readthedocs.io/ for more details

# onboard_all DDS Router
participants:
  - name: "robot"
    kind: "local"
    domain: $(env ROS_DOMAIN_ID)
  - name: "gcs"
    kind: "local"
    domain: $(var gcs_domain)

allowlist:
  # state information
  - name: "rt/$(env ROBOT_NAME)/odometry_conversion/odometry"
  - name: "rt/$(env ROBOT_NAME)/interface/mavros/global_position/raw/fix"

  # behavior tree
  - name: "rt/$(env ROBOT_NAME)/behavior/behavior_tree_commands"
  - name: "rt/$(env ROBOT_NAME)/behavior/behavior_tree_graphviz"

  # # allow all services
  # - name: "rq/*"
  #   type: "*"
  # - name: "rr/*"
  #   type: "*"

  # behavior tree services
  - name: "rq/$(env ROBOT_NAME)/interface/robot_commandRequest"
  - name: "rr/$(env ROBOT_NAME)/interface/robot_commandReply"

  - name: "rq/$(env ROBOT_NAME)/trajectory_controller/set_trajectory_modeRequest"
  - name: "rr/$(env ROBOT_NAME)/trajectory_controller/set_trajectory_modeReply"

  - name: "rq/$(env ROBOT_NAME)/takeoff_landing_planner/set_takeoff_landing_commandRequest"
  - name: "rr/$(env ROBOT_NAME)/takeoff_landing_planner/set_takeoff_landing_commandReply"

  - name: "rq/$(env ROBOT_NAME)/behavior/global_plan_toggleRequest"
  - name: "rr/$(env ROBOT_NAME)/behavior/global_plan_toggleReply"

  # bag recording status
  - name: "rt/$(env ROBOT_NAME)/bag_record/bag_recording_status"
  - name: "rt/$(env ROBOT_NAME)/bag_record/set_recording_status"

  # control commands
  - name: "rt/$(env ROBOT_NAME)/fixed_trajectory_generator/fixed_trajectory_command"
