Sunday, March 28, 2021

todo list

 I think I have figured out how to make topics in ROS. I think they are created implicitly when you define messages in nodes or elsewhere. But I'll have to verify that.


Let's outline our todo list:

First I want to create a publisher node on the pi that can publish an array of 4 velocities (one for each wheel).

Then I want to make a subscriber node on the arduino that can receive it. Then I want the arduino to be able to break that information down into commands for the motor controller. So if I get an array of [-1.0, +2.0, -1.0, +2.0] I want to translate that from cm/s to a pwm value and a direction. The PWM value is from 0 to 255, and I don't actually know how fast the robot can go as of right now. It is underpowered, I am not using 12V but more like 9.5. My batteries are 8*1.2 so my best voltage is 9.6. So I have no idea how fast it will go under all of the weight.

To translate all of that stuff I might want a library as my code is getting increasingly ugly. There are some L298n libararies out there, but I am unsure about them.

Then once the arduino can run based on pi input, I will need to make another node that reads values from the encoders. Then I will create a new message type that can send an array of four integers to the pi. I got in touch with the company that sells the robot and they said that there are 11 pulses per turn in the motors. I find this very puzzling since the encoder library I'm using gave me 1200. 

So basically I will create a publisher that will send an array to another node on the pi. This node on the pi will then do the math and calculate stuff like speed and position.


This is where the fun begins! 

Then I can use that to create a PID control node that will correct the robot speed based on the odometry data!

No comments:

Post a Comment

NEW Project Autonomous underwater vehicle!

  I have been more and more interested in Autonomous Underwater Vehicles and ocean exploration. I live on the coast with direct access to th...