Notifications
Clear all

Pico Robotics Straight Line Motion

17 Posts
4 Users
6 Likes
1,338 Views
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@inq FYI

@thrandell 

I believe that the winner said that through out the run the robot used trigonometry to re-calculate its return bearing.

Not sure why it would need to re-calculate its return bearing while following the path. As the robot follows the path it would use the encoder counts to update its current x,y coordinates using the example code snippet in my earlier post. On exiting the path it would use current coordinates computed x,y and the home coordinates hx,hy to compute the return home direction. It would turn the robot in that direction and then start moving in that direction. While moving back to home base it would then keep updating the direction to move based on home coordinates and changing current coordinates.

Computing the direction back home would involve the current coordinates x,y and the home coordinates hx,hy to compute the angle (direction) required using homeDirection = ATAN2(y-hy,x-hx).

Math is not my strong suit so any mathematicians wanting to correct my understanding is welcome 🙂

 

 


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

   
ReplyQuote
Page 2 / 2