Depth¶
Depth Sensor¶
This script is a primitive simulation of the Depth sensor measurements.
This script will measure the depth of the object in relation to the Ocean Element parameter. The depth is simply calculated as a difference in y-values. This script can be added to any game object. If you set the object with Depth sensor 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 Depth sensor is called “Boat”. This object has a Tag set to Vehicle and therefore Frame Id parameter has Boat namespace included. 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 Depth read-only element. it is possible to add noise to the depth measurements using Noise parameters.
Depth Sensor ROS¶
Depth Sensor ROS script publishes Depth measurements to the ROS topic.
This script should be added to a game object which has Depth Sensor script attached to it. If Depth Sensor script does not exist in the object, it will be automatically added together with Depth Sensor ROS script. Tf streamer script will also be included automatically, even though it is not required for Depth Sensor ROS script to work.
Depth 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. Published messages will be of type geometry_msgs/PoseWithCovarianceStamped.