Shop OBEX P1 Docs P2 Docs Learn Events
Robotic Coordinate Systems — Parallax Forums

Robotic Coordinate Systems

Duane DegnDuane Degn Posts: 10,588
edited 2014-10-19 20:01 in Robotics
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.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-01-03 08:41
    The transformation between the two systems is not difficult:
    geometry angle = 90 - compass angle

    I think making this conversion in your compass routine would be better than changing your entire coordinate system.

    -Phil
  • DiverBobDiverBob Posts: 1,102
    edited 2014-01-03 09:57
    I look forward to seeing your answers to some of the problems with making a hexapod move. I ended up writing my own IK routine but after I was done it looked surprisingly like some of the code I had from other hexapod implementations. I changed some of my variable names to match their code just to make it easier to spot when I would go in a 'bad' direction.
    Good luck, maybe I'll be able to let you know some of the ways not to try!

    Bob
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-01-03 11:38
    The transformation between the two systems is not difficult:
    geometry angle = 90 - compass angle

    I think making this conversion in your compass routine would be better than changing your entire coordinate system.

    -Phil

    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.
    DiverBob wrote: »
    I look forward to seeing your answers to some of the problems with making a hexapod move. I ended up writing my own IK routine but after I was done it looked surprisingly like some of the code I had from other hexapod implementations.

    Agreed, it's almost as if math works the same way no matter who is using it? :smile: 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.
  • Martin_HMartin_H Posts: 4,051
    edited 2014-01-04 05:10
    When I coupled a compass with odometry I did what Phill suggested. I translated the compass heading to a standard polar angle. It just seemed simpler. When I use a GPS it will be interesting to see which path ends up being easier.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-10-19 20:01
    Someone on Let's Make Robots posted links to a couple of navigation papers I found very helpful.

    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.

    attachment.php?attachmentid=111537&d=1413773842

    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.
    810 x 731 - 57K
Sign In or Register to comment.