# amr_bridge.yaml
#
# Maps Gazebo Harmonic topics produced by the AMR model + world plugins to
# ROS 2 topics on the names the real-robot AgenticROS plugin already expects.
# Used by ros_gz_bridge's parameter_bridge node via the `config_file` arg.
#
# Key invariant: the camera topic names below match the RealSense ROS driver
# defaults (`/camera/camera/color/image_raw`, `/camera/camera/depth/image_rect_raw`)
# so plugin code that targets real hardware works against sim without any
# config change. Same for /cmd_vel, /odom, /scan, /imu/data, /tf.
#
# Direction notation: GZ_TO_ROS  — gazebo publishes, ros subscribes (sensors)
#                     ROS_TO_GZ  — ros publishes, gazebo subscribes (cmd_vel)
#                     BIDIRECTIONAL — rare, /tf for example
#
# Field reference: https://github.com/gazebosim/ros_gz/blob/humble/ros_gz_bridge/README.md

# ---------------- cmd_vel (ROS -> GZ) ----------------
- ros_topic_name: "/cmd_vel"
  gz_topic_name: "/model/agenticros_amr/cmd_vel"
  ros_type_name: "geometry_msgs/msg/Twist"
  gz_type_name: "gz.msgs.Twist"
  direction: ROS_TO_GZ

# ---------------- odometry (GZ -> ROS) ----------------
# Prefer OdometryWithCovariance from the OdometryPublisher system (see
# model.sdf). Humble ros_gz_bridge historically failed to convert bare
# gz.msgs.Odometry from DiffDrive; covariance messages map cleanly to
# nav_msgs/Odometry. DiffDrive still publishes /odometry + /tf for TF.
- ros_topic_name: "/odom"
  gz_topic_name: "/odometry_with_covariance"
  ros_type_name: "nav_msgs/msg/Odometry"
  gz_type_name: "gz.msgs.OdometryWithCovariance"
  direction: GZ_TO_ROS

# ---------------- /tf  (GZ -> ROS) ----------------
- ros_topic_name: "/tf"
  gz_topic_name: "/tf"
  ros_type_name: "tf2_msgs/msg/TFMessage"
  gz_type_name: "gz.msgs.Pose_V"
  direction: GZ_TO_ROS

# ---------------- pose info (GZ -> ROS) ----------------
- ros_topic_name: "/tf_static"
  gz_topic_name: "/model/agenticros_amr/pose_static"
  ros_type_name: "tf2_msgs/msg/TFMessage"
  gz_type_name: "gz.msgs.Pose_V"
  direction: GZ_TO_ROS

# ---------------- joint states (GZ -> ROS) ----------------
- ros_topic_name: "/joint_states"
  gz_topic_name: "/joint_states"
  ros_type_name: "sensor_msgs/msg/JointState"
  gz_type_name: "gz.msgs.Model"
  direction: GZ_TO_ROS

# ---------------- Depth camera (GZ -> ROS) ----------------
# The rgbd_camera plugin publishes under <topic>camera</topic>, which becomes:
#   /camera/image          (RGB)
#   /camera/depth_image    (depth, 32FC1)
#   /camera/points         (PointCloud2)
#   /camera/camera_info    (CameraInfo)
# We remap each to the RealSense layout the real-robot plugin expects.
- ros_topic_name: "/camera/camera/color/image_raw"
  gz_topic_name: "/camera/image"
  ros_type_name: "sensor_msgs/msg/Image"
  gz_type_name: "gz.msgs.Image"
  direction: GZ_TO_ROS

- ros_topic_name: "/camera/camera/color/camera_info"
  gz_topic_name: "/camera/camera_info"
  ros_type_name: "sensor_msgs/msg/CameraInfo"
  gz_type_name: "gz.msgs.CameraInfo"
  direction: GZ_TO_ROS

- ros_topic_name: "/camera/camera/depth/image_rect_raw"
  gz_topic_name: "/camera/depth_image"
  ros_type_name: "sensor_msgs/msg/Image"
  gz_type_name: "gz.msgs.Image"
  direction: GZ_TO_ROS

- ros_topic_name: "/camera/camera/depth/camera_info"
  gz_topic_name: "/camera/depth_image/camera_info"
  ros_type_name: "sensor_msgs/msg/CameraInfo"
  gz_type_name: "gz.msgs.CameraInfo"
  direction: GZ_TO_ROS

- ros_topic_name: "/camera/camera/depth/points"
  gz_topic_name: "/camera/points"
  ros_type_name: "sensor_msgs/msg/PointCloud2"
  gz_type_name: "gz.msgs.PointCloudPacked"
  direction: GZ_TO_ROS

# ---------------- 2D LIDAR (GZ -> ROS) ----------------
- ros_topic_name: "/scan"
  gz_topic_name: "/scan"
  ros_type_name: "sensor_msgs/msg/LaserScan"
  gz_type_name: "gz.msgs.LaserScan"
  direction: GZ_TO_ROS

# ---------------- IMU (GZ -> ROS) ----------------
- ros_topic_name: "/imu/data"
  gz_topic_name: "/imu"
  ros_type_name: "sensor_msgs/msg/Imu"
  gz_type_name: "gz.msgs.IMU"
  direction: GZ_TO_ROS

# ---------------- Clock (GZ -> ROS) ----------------
- ros_topic_name: "/clock"
  gz_topic_name: "/clock"
  ros_type_name: "rosgraph_msgs/msg/Clock"
  gz_type_name: "gz.msgs.Clock"
  direction: GZ_TO_ROS
