I took car model from aws-deepracer ROS2 version and rewrote some parts to work in ROS1.
Create a package with name deepracer_car. Here we will gather all code for car model and its control.
After every catkin_make be sure to source your workspace!!!
Copy in deepracer_car folders meshes, urdf and rviz from my repo.
To view this model we will use RVIZ - ROS 3D Robot Visualizer. Create rviz.launch in deepracer_car/launch folder and paste there:
Now run
and you will see a car model without visual meshes
Load car model to Gazebo simulation
To properly load a model to Gazebo make sure to have GAZEBO references in your urdf/xacro folders:
collision and macro - wheel physical attributes and collision
material - which Gazebo material to use
sensor - camera sensor (h, w, fov) and camera plugin (update rate, topics, frame, distortion) to publish camera images from Gazebo simulation to ROS topic
Create racecar.launch in deepracer_car/launch folder and paste there:
And include this file in gazebo.launch:
Now run
and you will see a car on a race track, now we have a car model and need to somehow control it.
View from the camera
The car camera images are being published to the /camera/zed/rgb/image_rect_color topic.
You can view the camera feed by using the rqt_image_view, just run:
A GUI will appear, and you can select the /camera/zed/rgb/image_rect_color topic from the dropdown menu to view the camera feed.
Alternatively, you can use image_view with the following command:
This will open a window displaying the live feed from the camera attached to your ROS agent in the Gazebo simulation.