Robotic Coordinate Systems
Duane Degn
Posts: 10,588
I'm back to work on my hexapod. Even though there's already IK code available to use with the Propeller, I wanted to write my own IK software.
I started out using a right hand coordinate system with positive x to the robot's right side, positive y to the robot's front and (following the right hand rule) the positive z directed vertically above the robot. I used this same coordinate system with my Mecanum wheeled robot.
The problem I have with this system is it doesn't match up with the coordinate system used with a compass. In previously mentioned system, forward for the robot is walking at a 90 degree angle from the x axis (zero degrees). My use of two different coordinate systems was a pain when I used a compass to assist the robot when travelling in a figure 8.
So as I'm about to resume work on my IK algorithms, I'm seriously thinking of switching to using the same system as when using a compass.
While I won't need to use rotation matrices in my IK algorithms I would like whichever system I use to be compatible with the usual 3D calculations (if there is such a thing as "usual"). It's been a while since I've done a lot of 3D computations and I don't recall how important the "handedness" of the coordinate system is.
Speaking of "handedness", when using the compass system which way does the z axis extend? IIRC positive z was up. Does this make it a left handed system?
I'll do some research on this but I was hoping some of you have had experience with this and could offer some pointers.
I started out using a right hand coordinate system with positive x to the robot's right side, positive y to the robot's front and (following the right hand rule) the positive z directed vertically above the robot. I used this same coordinate system with my Mecanum wheeled robot.
The problem I have with this system is it doesn't match up with the coordinate system used with a compass. In previously mentioned system, forward for the robot is walking at a 90 degree angle from the x axis (zero degrees). My use of two different coordinate systems was a pain when I used a compass to assist the robot when travelling in a figure 8.
So as I'm about to resume work on my IK algorithms, I'm seriously thinking of switching to using the same system as when using a compass.
While I won't need to use rotation matrices in my IK algorithms I would like whichever system I use to be compatible with the usual 3D calculations (if there is such a thing as "usual"). It's been a while since I've done a lot of 3D computations and I don't recall how important the "handedness" of the coordinate system is.
Speaking of "handedness", when using the compass system which way does the z axis extend? IIRC positive z was up. Does this make it a left handed system?
I'll do some research on this but I was hoping some of you have had experience with this and could offer some pointers.
Comments
I think making this conversion in your compass routine would be better than changing your entire coordinate system.
-Phil
Good luck, maybe I'll be able to let you know some of the ways not to try!
Bob
That's what I've been doing so far but a recent thread about tilt compensated compass got me thinking about 3D rotations.
A hexapod can have some strange gaits which might require more complicated algorithms (with rotation matrices).
Plus it just bugs me to have two different coordinate systems.
What I should probably do is check in on the threads about quadcopter control code and see what coordinate system they're using. I've got several 'copter projects myself and it would be nice if my various robots shared a similar coordinate system.
Agreed, it's almost as if math works the same way no matter who is using it? I do often wonder if there's some trig identity I'm missing that would make the code simplier.
My IK code worked well enough when I had all the legs perpendicular to the center line (front/back) of the robot but when I attempted to move the starting position of the legs so they were all 60 degrees from each other, the robot no long moved in a coordinated fashion.
In these papers the "NED" coordinate system was mentioned. NED stands for North, East, Down and is a right hand system.
Basically orient the front of the vehicle with x (North) with the right side (East) being aligned with the y axis. The z axis is aligned with Down.
I've converted my equations over to this coordinate system and I think it's easier to use than having the y axis aligned with the front of the vehicle. IMO, NED makes it easier to use compass headings. I also like having zero degrees at the front of the robot.