Shop OBEX P1 Docs P2 Docs Learn Events
need help in trajectory tracking — Parallax Forums

need help in trajectory tracking

vaibhavvaibhav Posts: 25
edited 2019-11-13 12:39 in Accessories
Hello, guys, I need your help in moving a robot from one point to another point, problem description is as follows:

suppose my robot is at the initial position(x1, y1) and I want to move from that position to some final position (x2, y2) how can I achieve that?

by the way, I have arlo robot with a propeller board.

Comments

  • MicksterMickster Posts: 2,698
    edited 2019-11-13 17:37
    How is your motion handled, do you have a trajectory generator? If so, you break your motion down to pulses/sample.

    Edit: I have no clue about the Arlo robot.
  • Cluso99Cluso99 Posts: 18,069
    Presume the bot points along the x axis at start.
    Calculate x2 - x1. If result is positive, move the result in steps/time. If result is negative, turn 180 degrees negate result ie make positive. Then move result steps/time.
    Now turn 90 degrees, and repeat above for y1 and y2.
    Of course you’ll have to code this, but it’s the basics.
  • To plot a straight-line path you need to do coordinate translation. Putting your robot at (0,0) makes your destination (x2-x1),(y2-y1). Then you need to convert that destination to polar coordinates, which will give you a radius (distance), theta(angle / bearing). This is done with floating point trig functions in many settings but it's also the reason there are integer trig tables in the Propeller ROM. You obviously also need a way to set the direction your robot is pointing and tell how far it's driven.
Sign In or Register to comment.