Welcome to the Parallax Discussion Forums, sign-up to participate.

# need help in trajectory tracking

Posts: 25
edited 2019-11-13 - 12:39:28
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.

• Posts: 1,732
edited 2019-11-13 - 17:37:40
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.
• Posts: 16,574
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.
• Posts: 3,414
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.