GuiRitter / OpenBase

An omnidirectional mobile platform with a 3 omnidirectional wheels layout
MIT License
142 stars 45 forks source link

Guide to make this bot real. #21

Closed abhishekove closed 3 years ago

abhishekove commented 3 years ago

Can you guide me how to make this bot real? I want to make same bot in real world for practical purposes, using only encoders for wheels.

GuiRitter commented 3 years ago

Hi there and thanks for taking an interest in my project!

I was supposed to but unfortunately I never got the time to physically build this robot. I still need to fix some things in this project and make some improvements so it will be a long time before I can get it into the real world.

But I can give you some pointers. First, I don't know how or if it's possible to use the Gazebo project, so let's focus on the ROS project.

You'll need the motors to drive the wheels. I suppose both DC and stepper motors can do the trick.

You will need some hardware to deal with the motors, as the power that is required far surpasses that which will be used for the command electronics.

To command the motors, you have 2 options:

  1. Use a microcontroller that will receive the data from ROS. This can be an Arduino or ESP (easier) or a PIC, ATmega etc (harder but more efficient).
  2. Use a computer that will run ROS directly, like the Raspberry Pi.

The core of my project are the kinematics equations. They output the velocity for each wheel. However, you can't input velocity to the motor hardware, only voltage or current or a PWM signal etc. So you'll need a controller to convert from velocity to effort. I'm talking control theory. A PID tuned with Ziegler–Nichols should do the trick.

Then you need to look at the other side of the kinematics equations. My project has several different command options. You'll need to choose what you will want to have.

For example, you could use a DualShock controller to control the translation with one analog stick and rotation with the other, according to the world frame or the robot frame. You can go further and use the other buttons to change to other modes. For every input or on a fixed interval, you'll need to send messages to the appropriate ROS topics with the movement mode and the velocities according to the input.

You could also use a keyboard, mouse, phone touchscreen or whatever you fancy.

If you decided to not use a computer running ROS placed on the robot, you'll need one to run the project in ROS, read the command inputs and send the effort values to the Arduino/ESP/PIC/ATmega/etc on the robot.

That's what I remembered off the top of my head. Yeah, it's not trivial, but it's not impossible either. If you decide to try this out, good luck, and if you need more specific help, just ask. I'll help as I can.

abhishekove commented 3 years ago

Can you guide how to generate odom data?

GuiRitter commented 3 years ago

There are several ways to generate odometry data. You can use absolute methods, like GPS, which just tells you where the robot is, or you can use dead reckoning, which consists of calculating where you are based on how much you moved.

Like you said, you can use encoders on the wheels to get a measurement of the velocities of each wheel. You can also use other techniques like a camera pointing downwards, like an optical mouse, to get the robot's linear and angular velocities, but that only works on some surfaces. You can also use an IMU chip which contains both accelerometers and gyroscopes.

Or you can use several methods and use sensor fusion, such as Kalman filter, to improve the accuracy of your data. Although it's easy to find implementations of the Kalman filter around, I suggest some study as it requires some knowledge in statistics to work well.

After you decide how you'll gather the data, you need to feed it into ROS on the appropriate topic. That might require some adapting of my project as the odometry has not been fully developed with plug-and-play in mind.

If you decide to use an intermediate (micro)processor on the robot, you'll need to relay the data gathered by it to the other computer running ROS.

abhishekove commented 3 years ago

Ok Thanks.