Package Summary

Tags No category tags.
Version 1.0.2
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/cyberbotics/webots_ros2.git
VCS Type git
VCS Version foxy
Last Updated 2020-10-12
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Package Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Minimal example showing how to control a robot with ROS2 in Webots.

Additional Links

Maintainers

  • Cyberbotics

Authors

No additional authors.

webots_ros2_examples

In this package you can find a collection of simple examples.

Thymio II

This package provides a very simple ROS2 node, launch file and simulation for Thymio II robot. It is a good starting point to create your own simulation and ROS2 interface with your own simulated robot.

Launching the Simulation

The package includes a launch file that will start Webots and the node that interfaces Webots and ROS2. This launch file can be called like this:

ros2 launch webots_ros2_examples example.launch.py

Thymio II in Webots Webots will start with the Thymio II differential wheel robot and the example_controller node will start. This node acts as a Webots robot controller and publishes the value of the front distance-sensors of the robot on the /sensor topic and provides the /motor topic which can be used to change the speed of each wheel of the robot.

To quit the simulation and stop the launch file, you simply need to close Webots.

Interact with the Robot

Move the Robot

The /motor service can be tested directly using the ROS2 service CLI interface to move the robot:

ros2 service call /motor webots_ros2_msgs/SetDifferentialWheelSpeed "{ left_speed: 1.0, right_speed: 0.5 }"

Display the Sensor Value

The output of the sensor (/sensor topic) can be displayed directly using the ROS2 topic CLI interface

ros2 topic echo /sensor

Troubleshooting

If you see import failures or some indications saying that WEBOTS_HOME is incorrectly set, make sure your environment variables are configured for extern controllers.

TurtleBot3 Burger

TurtleBot3 Burger in Webots

To run the TurtleBot3 Burger simulation you can use the universal launcher:

ros2 launch webots_ros2_core robot_launch.py \
    executable:=webots_differential_drive_node \
    node_parameters:=$(ros2 pkg prefix webots_ros2_examples --share)/resource/turtlebot3_burger.yaml \
    world:=$(ros2 pkg prefix webots_ros2_examples --share)/worlds/turtlebot3_burger_example.wbt

If you have turtlebot3 package installed you can start cartographer as (you may need to run the command twice if it fails the first time):

ros2 launch turtlebot3_cartographer cartographer.launch.py \
    use_sim_time:=true

Also, you can start navigation2 using a custom map:

export TURTLEBOT3_MODEL='burger'
ros2 launch turtlebot3_navigation2 navigation2.launch.py \
    use_sim_time:=true \
    map:=$(ros2 pkg prefix webots_ros2_examples --share)/resource/turtlebot3_burger_example_map.yaml

Make sure you set the initial pose by clicking 2D Pose Estimate button in RViz or by executing the following command:

ros2 topic pub --once /initialpose geometry_msgs/msg/PoseWithCovarianceStamped '{
    "header": { "frame_id": "map" },
    "pose": {
        "pose": {
            "position": { "x": 0.0, "y": 0.0, "z": 0.0 },
            "orientation": { "x": 0.0, "y": 0.0, "z": 0.0, "w": 1.0 }
        }
    }
}'

On the official TurtleBot3 website you can find more information about navigation and SLAM configuration.

This will expose necessary topics:

$ ros2 topic list -t
/scan [sensor_msgs/msg/LaserScan]
/cmd_vel [geometry_msgs/msg/Twist]
/imu [sensor_msgs/msg/Imu]
/joint_states [sensor_msgs/msg/JointState]
/odom [nav_msgs/msg/Odometry]
/robot_description [std_msgs/msg/String]
/tf [tf2_msgs/msg/TFMessage]
/tf_static [tf2_msgs/msg/TFMessage]

Khepera IV

Khepera IV in Webots

Similarly to the TurtleBot3 Burger you can start the Khepera IV robot as well:

ros2 launch webots_ros2_core robot_launch.py \
    executable:=webots_differential_drive_node \
    node_parameters:=$(ros2 pkg prefix webots_ros2_examples --share)/resource/khepera4.yaml \
    world:=$(ros2 pkg prefix webots_ros2_examples --share)/worlds/khepera4_example.wbt

Or, if you want to have sensor_msgs/LaserScan topic you have to use a custom driver:

ros2 launch webots_ros2_core robot_launch.py \
    executable:=khepera_driver \
    package:=webots_ros2_examples \
    node_parameters:=$(ros2 pkg prefix webots_ros2_examples --share)/resource/khepera4.yaml \
    world:=$(ros2 pkg prefix webots_ros2_examples --share)/worlds/khepera4_example.wbt

CHANGELOG

Changelog for package webots_ros2_examples

1.0.0 (2020-09-01)

  • Added a khepera_driver node

0.0.3 (2020-06-15)

  • Added a new subscriber method to the cmd_vel topic to control the robot velocity.

0.0.2 (2019-09-23)

  • Initial version

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged webots_ros2_examples at answers.ros.org

Package Summary

Tags No category tags.
Version 1.0.2
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/cyberbotics/webots_ros2.git
VCS Type git
VCS Version eloquent
Last Updated 2020-10-12
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Package Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Minimal example showing how to control a robot with ROS2 in Webots.

Additional Links

Maintainers

  • Cyberbotics

Authors

No additional authors.

webots_ros2_examples

In this package you can find a collection of simple examples.

Thymio II

This package provides a very simple ROS2 node, launch file and simulation for Thymio II robot. It is a good starting point to create your own simulation and ROS2 interface with your own simulated robot.

Launching the Simulation

The package includes a launch file that will start Webots and the node that interfaces Webots and ROS2. This launch file can be called like this:

ros2 launch webots_ros2_examples example.launch.py

Thymio II in Webots Webots will start with the Thymio II differential wheel robot and the example_controller node will start. This node acts as a Webots robot controller and publishes the value of the front distance-sensors of the robot on the /sensor topic and provides the /motor topic which can be used to change the speed of each wheel of the robot.

To quit the simulation and stop the launch file, you simply need to close Webots.

Interact with the Robot

Move the Robot

The /motor service can be tested directly using the ROS2 service CLI interface to move the robot:

ros2 service call /motor webots_ros2_msgs/SetDifferentialWheelSpeed "{ left_speed: 1.0, right_speed: 0.5 }"

Display the Sensor Value

The output of the sensor (/sensor topic) can be displayed directly using the ROS2 topic CLI interface

ros2 topic echo /sensor

Troubleshooting

If you see import failures or some indications saying that WEBOTS_HOME is incorrectly set, make sure your environment variables are configured for extern controllers.

TurtleBot3 Burger

TurtleBot3 Burger in Webots

To run the TurtleBot3 Burger simulation you can use the universal launcher:

ros2 launch webots_ros2_core robot_launch.py \
    executable:=webots_differential_drive_node \
    node_parameters:=$(ros2 pkg prefix webots_ros2_examples --share)/resource/turtlebot3_burger.yaml \
    world:=$(ros2 pkg prefix webots_ros2_examples --share)/worlds/turtlebot3_burger_example.wbt

If you have turtlebot3 package installed you can start cartographer as (you may need to run the command twice if it fails the first time):

ros2 launch turtlebot3_cartographer cartographer.launch.py \
    use_sim_time:=true

Also, you can start navigation2 using a custom map:

export TURTLEBOT3_MODEL='burger'
ros2 launch turtlebot3_navigation2 navigation2.launch.py \
    use_sim_time:=true \
    map:=$(ros2 pkg prefix webots_ros2_examples --share)/resource/turtlebot3_burger_example_map.yaml

Make sure you set the initial pose by clicking 2D Pose Estimate button in RViz or by executing the following command:

ros2 topic pub --once /initialpose geometry_msgs/msg/PoseWithCovarianceStamped '{
    "header": { "frame_id": "map" },
    "pose": {
        "pose": {
            "position": { "x": 0.0, "y": 0.0, "z": 0.0 },
            "orientation": { "x": 0.0, "y": 0.0, "z": 0.0, "w": 1.0 }
        }
    }
}'

On the official TurtleBot3 website you can find more information about navigation and SLAM configuration.

This will expose necessary topics:

$ ros2 topic list -t
/scan [sensor_msgs/msg/LaserScan]
/cmd_vel [geometry_msgs/msg/Twist]
/imu [sensor_msgs/msg/Imu]
/joint_states [sensor_msgs/msg/JointState]
/odom [nav_msgs/msg/Odometry]
/robot_description [std_msgs/msg/String]
/tf [tf2_msgs/msg/TFMessage]
/tf_static [tf2_msgs/msg/TFMessage]

Khepera IV

Khepera IV in Webots

Similarly to the TurtleBot3 Burger you can start the Khepera IV robot as well:

ros2 launch webots_ros2_core robot_launch.py \
    executable:=webots_differential_drive_node \
    node_parameters:=$(ros2 pkg prefix webots_ros2_examples --share)/resource/khepera4.yaml \
    world:=$(ros2 pkg prefix webots_ros2_examples --share)/worlds/khepera4_example.wbt

Or, if you want to have sensor_msgs/LaserScan topic you have to use a custom driver:

ros2 launch webots_ros2_core robot_launch.py \
    executable:=khepera_driver \
    package:=webots_ros2_examples \
    node_parameters:=$(ros2 pkg prefix webots_ros2_examples --share)/resource/khepera4.yaml \
    world:=$(ros2 pkg prefix webots_ros2_examples --share)/worlds/khepera4_example.wbt

CHANGELOG

Changelog for package webots_ros2_examples

1.0.0 (2020-09-01)

  • Added a khepera_driver node

0.0.3 (2020-06-15)

  • Added a new subscriber method to the cmd_vel topic to control the robot velocity.

0.0.2 (2019-09-23)

  • Initial version

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged webots_ros2_examples at answers.ros.org

Package Summary

Tags No category tags.
Version 0.0.2
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/cyberbotics/webots_ros2.git
VCS Type git
VCS Version dashing
Last Updated 2020-04-14
Dev Status DEVELOPED
CI status No Continuous Integration
Released UNRELEASED
Package Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Minimal example showing how to control a robot with ROS2 in Webots.

Additional Links

Maintainers

  • Cyberbotics

Authors

No additional authors.
README
No README found. See repository README.
CHANGELOG

Changelog for package webots_ros2_examples

1.0.0 (2020-XX-YY)

  • Added a new subscriber method to the cmd_vel topic to control the robot velocity.

0.0.2 (2019-09-23)

  • Initial version

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged webots_ros2_examples at answers.ros.org

No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 0.0.2
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/cyberbotics/webots_ros2.git
VCS Type git
VCS Version crystal
Last Updated 2019-10-01
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Package Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Minimal example showing how to control a robot with ROS2 in Webots.

Additional Links

Maintainers

  • Cyberbotics

Authors

No additional authors.
README
No README found. See repository README.
CHANGELOG

Changelog for package webots_ros2_examples

0.0.2 (2019-09-23)

  • Initial version

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged webots_ros2_examples at answers.ros.org

No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.