-
Notifications
You must be signed in to change notification settings - Fork 11
sensors
This tutorial describes the sensor suite available in the CoRa model and how to visualize sensor information.
The CoRa model is equipped with a set of sensors including a stereo camera, a 3D lidar, a GPS, an IMU and an acoustic sensor. Refer to the technical guide for a complete specification of all the sensors and their API.
If you're a VORC participant is not allowed to modify the position of specification of any sensor. For other purposes, feel free to tweak the parameters used in cora_description/urdf/cora.xacro
to add, remove or modify any sensors.
RViz is a standard ROS tool for visualizing messages. This tutorial explains how to run RViz to display the CoRa model and sensors that you are simulating with Gazebo.
If you have not done so already, first run the simulation:
roslaunch vorc_gazebo marina.launch
Leave this simulation running for the remainder of the tutorial. In the steps below, you will use the robot_state_publisher to make the simulated data available to RViz.
RViz depends on TF for understanding where to display everything.
This is usually accomplished with the robot_state_publisher. This program will publish all the fixed joints in your URDF to the TF tree along with non-fixed joints based on messages published to /JointStates (like the propeller rotations).
There are (at least) two options for doing this:
If you are using the example cora.urdf, you can simply run:
roslaunch vorc_gazebo localization_example.launch
This will run robot_state_publisher along with a localization node which fuses the GPS and IMU into the robot's global pose and publishes it to the odom frame.
If you are using a custom URDF without the standard GPS/IMU configuration, you can run the robot_state_publisher alone:
rosrun robot_state_publisher robot_state_publisher
To open RViz with a configuration made for the CoRa model, open a third terminal and run:
roslaunch vorc_gazebo rviz.launch
RViz should open and display the robot and a camera! Try driving around to see the robot move both in Gazebo and RViz.
The example launch file above runs RViz with a preconfigured set of topics. You can add, remove, and edit topics and more from within the RViz GUI to better visualize your robot.
The example RViz config starts with "odom" set as the frame everything is displayed in. If you are using the example URDF with a GPS and IMU and running the localization_example.launch, this frame should exist. However, if you are using a custom URDF/localization which does not publish an odom frame, you can always switch the frame to base_link to display messages relative to the robot: