Tesla Model 3 simulation in Webots: The first step towards ROS 2 automobile integration


Recently we have added a vehicle showcase example to demonstrate some of Webots’ automobile simulation capabilities. The example includes Tesla Model 3 that exposes an AckermannDrive interface. It is supposed to be a starting point for users who want to simulate vehicles in Webots. Also, to us, it is a base for further integration with the ROS 2 automobile stack.

More details:
https://github.com/cyberbotics/webots_ros2/wiki/Example-Tesla-Model-3

The feature is not included in the ROS 2 distributions yet, so use this tutorial to compile the Webots bridge:
https://github.com/cyberbotics/webots_ros2/wiki/Build-and-Install

Let us know what feature would like to see next!

12 Likes

Hi, do you have any documentation that would allow me to reproduce the lane follower in my own ROS2 package? I would like to add functionality for obstacle avoidance etc?

Hi @endeavour, we currently do not have a specific documentation for a lane follower, but I can give you the overall picture for this example.

The Tesla car in this simulation has a camera with a recognition capability in order to recognize the road lines (see here the documentation for this feature in Webots).
Then our interface automatically creates a topic where the images taken by the camera are published.

The messages are received by a ROS 2 node (here) that will use cv2 to find the contours and generate an AckermannDrive message according to the position of the road lines on the image.
This node could be improved to detect obstacle as you desire.

Finally a Python plugin extending our ROS 2 interface subscribe to the AckermannDrive messages topic and use directly our Driver API to control the Tesla car.

Hi Benjamin,

Thank you for the reply, I’m particularly interested in this part “our interface automatically creates a topic where the images taken by the camera are published” could you describe or point me to a reference that describes how this interface is created please?
Best wishes
Martin

Based on the robots present in the simulation, and the devices that comprise them, an appropriate interface is created for every device by the ROS2 interface (or at least, for those currently supported, list available here: References · cyberbotics/webots_ros2 Wiki · GitHub)

Hello i’m a beginner and i just started using webots and im currently trying to impliment lane follwowing would like to use ROS 2 but hav eno clue on were to start from

Hi Emmanuel,

I am a ROS Discourse moderator. This isn’t the best forum for requesting help. Please take your questions to robotics.stackexchange.com. We also have a long list of resources here. Lane following in particular is better addressed by our colleagues at Autoware.

-Kat

1 Like

Hello Kat , Thank you will do just that.