Communication between Unity and ROS
Unity and ROS communicate via ROS Topics. Unity publishes the environment data and metrics to topics read by ROS, and ROS publishes the navigation plan to topics read by Unity. Topics are translated between Unity and ROS via a TcpServer. The full list of topics can be found in the TcpServer implementation. Descriptions of the key topics follows.
ROS to Unity
Topics that send information from ROS to Unity allow for the control of the robot in simulation.
Controlling the simulator
Topics that allow control of the simulation from ROS.
/social_sim/control/task/new
(type: Bool): Publishing true to this topic will start a new task in the simulator.
Controlling the robot
/mobile_base_controller/cmd_vel
(type: Twist): Command the default navigation controller on the simulated mobile base to move at a desired velocity, contains two 3d vectors: linear and angular velocity.
Unity to ROS
Topics that send information from Unity to ROS allow the processing and recording of data.
-
/clock
(type: Clock): Unity publishes simulated time which in turns controls the ROS clock. -
/social_sim/scene_info
(type: SceneInfo): Includes information about the current Scenario such as the name of the scenario, the number of people, and groups; Task including the robot's start and goal poses; and the name of the current Environment. -
/social_sim/metrics
(type: TrialInfo): Performance metrics for the robot, published once at the end of an Interaction -
/social_sim/agents
(type: AgentArray): Current pose and velocity of each agent in the scene. -
/social_sim/agent_positions
(type: PoseArray): Current pose of each agent in the scene. -
/social_sim/group_positions
(type: PoseArray): Current pose (centroid) of each group in the scene. -
/social_sim/trigger
(type: Bool): The user needs to hold down the left trigger of the gaming controller to send command. This returns true if the user is holding down the trigger. -
/social_sim/cmd_vel
(type: Twist): Command velocity input by the user, contains two 3d vectors, linear and angular velocity. -
/social_sim/situations/rule_based/cross_path
,/social_sim/situations/rule_based/down_path
,/social_sim/situations/rule_based/empty
,/social_sim/situations/rule_based/join_group
,/social_sim/situations/rule_based/leave_group
(type: Float32): The probability that the current situation is of a given social situation (out of the five situations) classfied by handcrafted rules. The five values should add up to 1. -
/map_to_odom
,/map_to_base_link
,/base_link_to_firstperson_rgb_link
... : Use RosTFBroadcaster (based on tf.TransformBroadcaster to send a transform between frames. Here, transforms are sent from map to the robot's odometry, from map to the robot's base_link (pivot point), from the robot's base_link to the rgb camera of the robot's eyes, and so on. -
/robot_odom
(type: Odometry): Publishes the robot's odometry, contains a pose in the header frame and a twist in the child frame. -
/short_map/compressed
(type: CompressedImage): Publishes the short map,which is the navigable area near ground level -
/tall_map/compressed
(type: CompressedImage): Publishes the tall map, which is the navigable area higher above the ground -
/center_depth/camera_info
,/robot_firstperson_rgb/camera_info
,/robot_thirdperson_rgb/camera_info
,/robot_overhead_rgb/camera_info
,/agent_rgb/camera_info
(type: CameraInfo): Publishes the meta information of a camera used for its calibration. Here the cameras are the robot's depth camera, the robot's three rgb cameras, and the agent's camera. -
/center_depth/compressed
,/robot_firstperson_rgb/compressed
,/robot_thirdperson_rgb/compressed
,/robot_overhead_rgb/compressed
,/agent_rgb/compressed
(type: CompressedImage): Publishes the compressed images from the robot's and the agent's cameras. -
/laser_raycast
(type: LaserScan): Publishes the scan data from the robot's laser sensor in its belly. -
/wheel_left_joint_cmd
(type: Float64): Subscribes to the low level ROS controller for the command for the left wheel. -
/wheel_right_joint_cmd
(type: Float64): Subscribes to the low level ROS controller for the command for the right wheel. -
/move_base_simple/goal
(type: PoseStamped): Publishes the pose (position and orientation) of the goal. -
/move_base/GlobalPlanner/plan
(type: Path): Subscribes to the basic ROS global planner for the planned path of the robot, which consists of an array of poses.