ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Balancing Two-Wheeled Robot in ROS2-Foxy

asked 2021-05-01 09:32:16 -0500

ferro gravatar image

Hi , I am new in ros2 and i am trying to do a two wheeled self-balancing robot by using ros2 and gazebo. However, i have some problem with self-balancing part of robot. Could someone give some direction ?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-05-11 16:04:19 -0500

highmax1234 gravatar image

updated 2021-05-11 16:06:01 -0500

You will need a controller and a gazebo plugin. The controller can be either within the plugin or separate in a ros2 node, which is what you should prefer in case you ever want to build the robot in reality.

You can find examples on gazebo plugins in this repo: https://github.com/ros-simulation/gaz...

The input to your controller will probably be an IMU that can give you the pitch angle of the middle part of the robot. The controller will need to be cascaded.

  • You can control the speed of the robot by setting its acceleration.
  • You can control the acceleration of the robot by setting the pitch angle of the robot.
  • You can control the pitch angle of the robot my using force in the opposite direction on the wheels.
edit flag offensive delete link more

Comments

Adding onto this post, I found it helpful to look through these links:

  • A ROS1 differential drive node created by Jon Stephan, there's a nice picture: differential_drive

  • The Nav2 system for ROS2, again, very nice picture: Nav2

  • ROS2 Foxy tutorials: Tutorials Index

I can't speak about Gazebo, but for your robot you will be looking to support a few bare-minimum messages:

Most of the ROS 1 and 2 stuff expects to receive TF2 & Odometry messages describing the robot's position, and to send your robot Twist via /cmd_vel

Spectre gravatar image Spectre  ( 2021-05-11 20:10:35 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2021-05-01 09:32:16 -0500

Seen: 423 times

Last updated: May 11 '21