Pose

Pose sensor

Pose sensor script enables you to get accurate position, orientation, linear and angular velocities of the object in simulator. This script can be used as ground truth in the development of algorithms (e.g. localization, path following) but also can have noise included if necessary.

Add script to any game object. Set Measured Object element to the game object you want to get position from. In the image above this parameter is set to object Boat. If you set this object with pose script as the child of an object with a Vehicle tag, name of that object will be automatically inserted as namespace to Frame Id parameter. In the image above Parent object of Pose sensor is called “Boat”. This object has a Tag set to Vehicle as visible in the next image. The frequency at which pose measurements are received is set with the Sample Frequency parameter. If a Debug option is set measurements will be displayed in the inspector under the Pose and Twist header. It is possible to set different noise distributions to pose, orientation, linear and angular velocities using noise parameters under the Noise header.

Pose Sensor ROS

Pose Sensor ROS script publishes Pose measurements to the ROS topic.

This script should be added to a game object which has Pose Sensor script attached to it. If Pose Sensor script does not exist in the object it will be automatically added together with Pose Sensor ROS script. Tf streamer script will also be included automatically, even though it is not required for Pose Sensor ROS script to work.

Pose Sensor ROS script has only two parameters that need to be set. Address parameter in the name of the ROS topic and Update Frequency is the frequency at which it will be published.

To get topic back to ROS make sure ROS server is launched. This is included in grpc_ros_adapter (link) package and can be called from terminal with roslaunch grpc_ros_adapter launch_server.launch.

Server should be live when simulation is started. At this point you should be able to see your topic being published in ROS.