CanyoneroRobotics / TFM

MIT License
5 stars 0 forks source link

Integrate two motors (left&rigth) #9

Open oriolorra opened 8 years ago

oriolorra commented 8 years ago

Now, we only have integrated one motor. We can control its velocity with the joystick and we read its encoder too.

So, we want to control two motors' velocity and also read the two encoders. Therefore, the Canyonero will be able to go forward, backward and turn.

oriolorra commented 8 years ago

We have a problem with rosserial and Adafruit_MotorShield library (AFMS). We can not initialize the communication between our PC and Arduino Mega with rosserial. Our thought is that the problem could be that AFMS is using Wire.h library, and it could make interference to rosserial.

oriolorra commented 8 years ago

I have found the problem. Adafruit_Motorshield uses the library " Wire.h " using the SDA and SCL pins , although, they are free on Arduino Mega , but if we use them for interruptions could create interference with rosserial and Adafruit_Motorshield.

oriolorra commented 8 years ago

Now with the encoders ticks, I have to publish a nav_msgs::Odometry. So, I have to calculate linear and angular velocities, and then calculate position and orientation.

Also, I need to transform this values, because they have been calculated on 'tf->odom', and I would represent it on 'tf->baselink'. So, I have to send a 'TransformBroadcaster' with the right parameters.

oriolorra commented 8 years ago

We have a problem. Each encoder gives us a different ticks count per rotation, so we will have to do some calibration for each encoder.