Visible to the public Launch Gazebo with the CAT VehicleConflict Detection Enabled

The goal of this tutorial is to ensure that your simulation runs, which helps to verify that all necessary packages are correctly installed.

Setup

cd catvehicle_ws
source devel/setup.bash

You must do this for every tab that you open, or you may instead elect to put a line in your .bashrc file that will source this file.

roslaunch catvehicle catvehicle_skidpan.launch

A bunch of launch messages will fly by, and then....nothing else will happen. If you see errors about components dying, you will want to investigate whether you are missing a package. Otherwise, your simulation is actually running OK---we just can't see anything because the simulation does not run the gazebo visualization client by default (this enables you to save processor for other tasks, later, and turn on or off the visualization engine).

Ensure simulation is running

So how can we know whether things are running correctly? Open a new tab, and list all of the topics currently in the simulation. This is performed by the command `rostopic list`

$ rostopic list
/catvehicle/camera_left/camera_left_info
/catvehicle/camera_left/image_raw_left
/catvehicle/camera_left/image_raw_left/compressed
/catvehicle/camera_left/image_raw_left/compressed/parameter_descriptions
/catvehicle/camera_left/image_raw_left/compressed/parameter_updates
/catvehicle/camera_left/image_raw_left/theora
/catvehicle/camera_left/image_raw_left/theora/parameter_descriptions
/catvehicle/camera_left/image_raw_left/theora/parameter_updates
/catvehicle/camera_left/parameter_descriptions
/catvehicle/camera_left/parameter_updates
/catvehicle/camera_right/camera_right_info
/catvehicle/camera_right/image_raw_right
/catvehicle/camera_right/image_raw_right/compressed
/catvehicle/camera_right/image_raw_right/compressed/parameter_descriptions
/catvehicle/camera_right/image_raw_right/compressed/parameter_updates
/catvehicle/camera_right/image_raw_right/compressedDepth
/catvehicle/camera_right/image_raw_right/compressedDepth/parameter_descriptions
/catvehicle/camera_right/image_raw_right/compressedDepth/parameter_updates
/catvehicle/camera_right/image_raw_right/theora
/catvehicle/camera_right/image_raw_right/theora/parameter_descriptions
/catvehicle/camera_right/image_raw_right/theora/parameter_updates
/catvehicle/camera_right/parameter_descriptions
/catvehicle/camera_right/parameter_updates
/catvehicle/cmd_vel
/catvehicle/cmd_vel_safe
/catvehicle/distanceEstimator/angle
/catvehicle/distanceEstimator/dist
/catvehicle/front_laser_points
/catvehicle/front_left_steering_position_controller/command
/catvehicle/front_right_steering_position_controller/command
/catvehicle/joint1_velocity_controller/command
/catvehicle/joint2_velocity_controller/command
/catvehicle/joint_states
/catvehicle/lidar_points
/catvehicle/odom
/catvehicle/path
/catvehicle/steering
/catvehicle/vel
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/rosout
/rosout_agg
/tf
/tf_static

We can also get a list of the currently running nodes in the simulation with `rosnode list`

$ rosnode list
/catvehicle/base_link2slamodom_tf_catvehicle
/catvehicle/cmdvel2gazebocatvehicle
/catvehicle/controller_spawnercatvehicle
/catvehicle/distanceEstimator
/catvehicle/joint_state_publishercatvehicle
/catvehicle/obstacleStoppercatvehicle
/catvehicle/odom2pathcatvehicle
/catvehicle/robot_state_publishercatvehicle
/gazebo
/rosout

Let's look in a little more detail at what these various components (and the topics they produce) are doing.

/catvehicle/joint_state_publishercatvehicle

This publishes data from gazebo about each of the joints in the car. You can (for any of the nodes) find exactly what it is pubishing (and topics to which it is subscribing) through `rosnode info NODENAME`

$ rosnode info /catvehicle/robot_state_publishercatvehicle

--------------------------------------------------------------------------------
Node [/catvehicle/robot_state_publishercatvehicle]
Publications:
* /tf [tf2_msgs/TFMessage]
* /tf_static [tf2_msgs/TFMessage]
* /rosout [rosgraph_msgs/Log]

Subscriptions:
* /catvehicle/joint_states [sensor_msgs/JointState]
* /clock [rosgraph_msgs/Clock]

Services:
* /catvehicle/robot_state_publishercatvehicle/set_logger_level
* /catvehicle/robot_state_publishercatvehicle/get_loggers


contacting node http://jmscatvehicle.local:44845/ ...
Pid: 14549
Connections:
* topic: /rosout
* to: /rosout
* direction: outbound
* transport: TCPROS
* topic: /clock
* to: /gazebo (http://jmscatvehicle.local:33223/)
* direction: inbound
* transport: TCPROS
* topic: /catvehicle/joint_states
* to: /catvehicle/joint_state_publishercatvehicle (http://jmscatvehicle.local:42129/)
* direction: inbound
* transport: TCPROS
* topic: /catvehicle/joint_states
* to: /gazebo (http://jmscatvehicle.local:33223/)
* direction: inbound
* transport: TCPROS

This component is publishing data to topics /rosout, /tf, and /tf_static, and is receiving data from /catvehicle/joint_states and /clock.

/catvehicle/cmdvel2gazebocatvehicle

This node is a bit more interesting: it takes data pubished to drive the car around (/catvehicle/cmd_vel_safe) and turns those into specific commands in gazebo that will move the joints around, and thus make the car drive.

$ rosnode info /catvehicle/cmdvel2gazebocatvehicle
--------------------------------------------------------------------------------
Node [/catvehicle/cmdvel2gazebocatvehicle]
Publications:
* /catvehicle/front_left_steering_position_controller/command [std_msgs/Float64]
* /catvehicle/front_right_steering_position_controller/command [std_msgs/Float64]
* /catvehicle/joint2_velocity_controller/command [std_msgs/Float64]
* /rosout [rosgraph_msgs/Log]
* /catvehicle/joint1_velocity_controller/command [std_msgs/Float64]

Subscriptions:
* /clock [rosgraph_msgs/Clock]
* /catvehicle/cmd_vel_safe [geometry_msgs/Twist]

Services:
* /catvehicle/cmdvel2gazebocatvehicle/set_logger_level
* /catvehicle/cmdvel2gazebocatvehicle/get_loggers


contacting node http://jmscatvehicle.local:43460/ ...
Pid: 14563
Connections:
* topic: /catvehicle/joint2_velocity_controller/command
* to: /gazebo
* direction: outbound
* transport: TCPROS
* topic: /catvehicle/front_left_steering_position_controller/command
* to: /gazebo
* direction: outbound
* transport: TCPROS
* topic: /catvehicle/joint1_velocity_controller/command
* to: /gazebo
* direction: outbound
* transport: TCPROS
* topic: /rosout
* to: /rosout
* direction: outbound
* transport: TCPROS
* topic: /catvehicle/front_right_steering_position_controller/command
* to: /gazebo
* direction: outbound
* transport: TCPROS
* topic: /clock
* to: /gazebo (http://jmscatvehicle.local:33223/)
* direction: inbound
* transport: TCPROS
* topic: /catvehicle/cmd_vel_safe
* to: /catvehicle/obstacleStoppercatvehicle (http://jmscatvehicle.local:57946/)
* direction: inbound
* transport: TCPROS

Other interesting nodes include the /catvehicle/obstacleStoppercatvehicle and /catvehicle/distanceEstimator -- we will look at each of these nodes and their behaviors.

/catvehicle/distanceEstimator

This naive node consumes data from the front_laser_points topic, and provides the angle and distance of the nearest obstacle, if that obstacle is found within its angle of interest.

/catvehicle/obstacleStoppercatvehicle

This node consumes data from the distanceEstimator, and will reduce the velocity of the vehicle to 0 if an obstacle is detected by the distance estimator to within a certain radius (e.g., 5m away). The node has many flaws, notably that if you take a sharp turning angle that you can run into an obstacle that will not be crossed by the laser at the necessary angle until it is too late. However, it is a useful node through we we can explore the composition of data streams from other nodes and sensors.

azcar_sim instructions (deprecated)

All instructions below this line are for v1, which has been deprecated.

Before running packages within this release, make sure you put all the correct paths into your ROS path. At the command prompt, you can run:

cd catvehicle
source devel/setup.bash

You must do this for every tab that you open, or you may instead elect to put a line in your .bashrc file that will source this file.

roslaunch azcar_sim azcar_skidpan.launch

A bunch of launch messages will fly by, and then....nothing else will happen. If you see errors about components dying, you will want to investigate whether you are missing a package. Otherwise, your simulation is actually running OK---we just can't see anything because the simulation does not run the gazebo visualization client by default (this enables you to save processor for other tasks, later, and turn on or off the visualization engine).

So how can we know whether things are running correctly?

Open a new tab, and list all of the topics currently in the simulation. This is performed by the command `rostopic list`

$ rostopic list /azcar_sim/cmd_vel /azcar_sim/cmd_vel_safe /azcar_sim/distanceEstimator/angle /azcar_sim/distanceEstimator/dist /azcar_sim/front_laser_points /azcar_sim/front_left_steering_position_controller/command /azcar_sim/front_right_steering_position_controller/command /azcar_sim/joint1_velocity_controller/command /azcar_sim/joint2_velocity_controller/command /azcar_sim/joint_states /azcar_sim/lidar_points /azcar_sim/odom /azcar_sim/path /azcar_sim/steering /azcar_sim/vel /clock /gazebo/link_states /gazebo/model_states /gazebo/parameter_descriptions /gazebo/parameter_updates /gazebo/set_link_state /gazebo/set_model_state /rosout /rosout_agg /tf /tf_static

We can also get a list of the currently running nodes in the simulation with `rosnode list`

$ rosnode list /azcar_sim/base_link2slamodom_tf_azcar_sim /azcar_sim/cmdvel2gazeboazcar_sim /azcar_sim/controller_spawnerazcar_sim /azcar_sim/distanceEstimator /azcar_sim/joint_state_publisherazcar_sim /azcar_sim/obstacleStopperazcar_sim /azcar_sim/odom2pathazcar_sim /azcar_sim/robot_state_publisherazcar_sim /gazebo /rosout

Let's look in a little more detail at what these various components (and the topics they produce) are doing.

/azcar_sim/joint_state_publisherazcar_sim

This publishes data from gazebo about each of the joints in the car. You can (for any of the nodes) find exactly what it is pubishing (and topics to which it is subscribing) through `rosnode info NODENAME`

$ rosnode info /azcar_sim/joint_state_publisherazcar_sim -------------------------------------------------------------------------------- Node [/azcar_sim/joint_state_publisherazcar_sim] Publications: * /azcar_sim/joint_states [sensor_msgs/JointState] * /rosout [rosgraph_msgs/Log] Subscriptions: * /clock [rosgraph_msgs/Clock] Services: * /azcar_sim/joint_state_publisherazcar_sim/set_logger_level * /azcar_sim/joint_state_publisherazcar_sim/get_loggers contacting node http://jmscatvehicle.local:44348/ ... Pid: 91606 Connections: * topic: /azcar_sim/joint_states * to: /azcar_sim/robot_state_publisherazcar_sim * direction: outbound * transport: TCPROS * topic: /rosout * to: /rosout * direction: outbound * transport: TCPROS * topic: /clock * to: /gazebo (http://jmscatvehicle.local:46110/) * direction: inbound * transport: TCPROS

This component is publishing data to topics /rosout and to /azcar_sim/joint_states, and is receiving data from /clock.

/azcar_sim/cmdvel2gazeboazcar_sim

This node is a bit more interesting: it takes data pubished to drive the car around (/azcar_sim/cmd_vel_safe) and turns those into specific commands in gazebo that will move the joints around, and thus make the car drive.

$ rosnode info /azcar_sim/cmdvel2gazeboazcar_sim -------------------------------------------------------------------------------- Node [/azcar_sim/cmdvel2gazeboazcar_sim] Publications: * /azcar_sim/front_left_steering_position_controller/command [std_msgs/Float64] * /azcar_sim/joint1_velocity_controller/command [std_msgs/Float64] * /rosout [rosgraph_msgs/Log] * /azcar_sim/joint2_velocity_controller/command [std_msgs/Float64] * /azcar_sim/front_right_steering_position_controller/command [std_msgs/Float64] Subscriptions: * /clock [rosgraph_msgs/Clock] * /azcar_sim/cmd_vel_safe [geometry_msgs/Twist] Services: * /azcar_sim/cmdvel2gazeboazcar_sim/set_logger_level * /azcar_sim/cmdvel2gazeboazcar_sim/get_loggers contacting node http://jmscatvehicle.local:51804/ ... Pid: 91643 Connections: * topic: /azcar_sim/joint1_velocity_controller/command * to: /gazebo * direction: outbound * transport: TCPROS * topic: /azcar_sim/joint2_velocity_controller/command * to: /gazebo * direction: outbound * transport: TCPROS * topic: /azcar_sim/front_right_steering_position_controller/command * to: /gazebo * direction: outbound * transport: TCPROS * topic: /rosout * to: /rosout * direction: outbound * transport: TCPROS * topic: /azcar_sim/front_left_steering_position_controller/command * to: /gazebo * direction: outbound * transport: TCPROS * topic: /azcar_sim/cmd_vel_safe * to: /azcar_sim/obstacleStopperazcar_sim (http://jmscatvehicle.local:46635/) * direction: inbound * transport: TCPROS * topic: /clock * to: /gazebo (http://jmscatvehicle.local:46110/) * direction: inbound * transport: TCPROS

Other interesting nodes include the /azcar_sim/obstacleStopperazcar_sim and /azcar_sim/distanceEstimator -- we will look at each of these nodes and their behaviors.

/azcar_sim/distanceEstimator

This naive node consumes data from the laser scanner, and provides the angle and distance of the nearest obstacle, if that obstacle is found within its angle of interest.

/azcar_sim/obstacleStopperazcar_sim

This node consumes data from the distanceEstimator, and will reduce the velocity of the vehicle to 0 if an obstacle is detected by the distance estimator to within a certain radius (e.g., 5m away). The nodes has many flaws, notably that if you take a sharp turning angle that you can run into an obstacle that will not be crossed by the laser at the necessary angle until it is too late. However, it is a useful node through we we can explore the composition of data streams from other nodes and sensors.