mit-biomimetics / Cheetah-Software

MIT License
2.56k stars 916 forks source link

What is x_drag in A matrix,and how did you build coordinates? #47

Open Abedcoder opened 4 years ago

Abedcoder commented 4 years ago

Hi guys,I was reading your code and noticed there is a variable named _xdrag in "ct_ss_mats" function.I'm quite confused for your paper about minicheetah didn't include this variable, and it seems just doesn't make sense if your A matrix of MPC function including this one.

Moreover, the _miniabad and _mini_upperlink models used in simulation for mini cheetah are different form your actual mechanical structures, so is minicheetah.h file are coded based on these old-version models or I can neglect it? What shoud I do if I want to reedit minicheetah.h for my own model, and how you guys built these complicated coordinates?

Could you please give me a favour to get these questions down, I'd appreciate it a lot!

YuXianYuan commented 4 years ago

Hello, I also met the first question, waiting for an answer here. On the second question, you should combine Quadruped.cpp File to study, especially the buildmodel function I think there is something wrong with the annotation of "join axis" of addbody function.I think this axis is not in the parent coordinate system. I've built my own robot model based on "minicheetah.h" although I'm still confused in the original version

Abedcoder commented 4 years ago

Hello, I also met the first question, waiting for an answer here. On the second question, you should combine Quadruped.cpp File to study, especially the buildmodel function I think there is something wrong with the annotation of "join axis" of addbody function.I think this axis is not in the parent coordinate system. I've built my own robot model based on "minicheetah.h" although I'm still confused in the original version

Thank you,but I have read Quadruped.cpp many times,the coordinate issue still puzzeled me.

In xTreeAbad/Hip/Knee, the way they built coordinates is different from model.addGroundContactPoint ,you can refer MiniCheetah.h,which means the two methods they set the orgins of knee joints are differnt ,actually apart from knee joint,the hip joint has the same issue.

In my opinion,the orgin of knee coordinate must coincidence with knee joint, the axis of BIG PULLEY--to be more precise.Because in forwardKinematics function ,the foot postions in word/absoulate coordinate are calcuated by the GroundContactPoint.

I was wondering how you built your own robot ,could you post a picture to illustrate your process?Thank you.

YuXianYuan commented 4 years ago

I don't know much about forward kinematics and adding the contact point function. Moreover, I am not sure what the _kneeLinkY_offset of Cheetah Mini is for, which causes the contact point between the foot and the ground is not on the symmetry axis of the thigh. However, cheetah3's _kneeLinkY_offset is 0, so I think there may be some engineering issues with the Cheetah Mini, so don't worry about the 4mm.

The coordinate system in the program is different from that in the paper "Highly Dynamic Quadruped via Whole-body Impulse Control and Model Predictive Control".All the hip and knee joints are in the opposite direction.

My robot parameters are as follows: abadLength:0.088 hipLength:0.27 kneeLength:0.27

by the way, are you Chinese? image

Abedcoder commented 4 years ago

I don't know much about forward kinematics and adding the contact point function. Moreover, I am not sure what the _kneeLinkY_offset of Cheetah Mini is for, which causes the contact point between the foot and the ground is not on the symmetry axis of the thigh. However, cheetah3's _kneeLinkY_offset is 0, so I think there may be some engineering issues with the Cheetah Mini, so don't worry about the 4mm.

The coordinate system in the program is different from that in the paper "Highly Dynamic Quadruped via Whole-body Impulse Control and Model Predictive Control".All the hip and knee joints are in the opposite direction.

My robot parameters are as follows: abadLength:0.088 hipLength:0.27 kneeLength:0.27

by the way, are you Chinese? image

I don't know much about forward kinematics and adding the contact point function. Moreover, I am not sure what the _kneeLinkY_offset of Cheetah Mini is for, which causes the contact point between the foot and the ground is not on the symmetry axis of the thigh. However, cheetah3's _kneeLinkY_offset is 0, so I think there may be some engineering issues with the Cheetah Mini, so don't worry about the 4mm.

The coordinate system in the program is different from that in the paper "Highly Dynamic Quadruped via Whole-body Impulse Control and Model Predictive Control".All the hip and knee joints are in the opposite direction.

My robot parameters are as follows: abadLength:0.088 hipLength:0.27 kneeLength:0.27

by the way, are you Chinese? image

是的哈哈,我也早注意到你是北航的了,可以加qq联系吗,2993213321

allenwang-git commented 3 years ago

Hello, I also met the first question, waiting for an answer here. On the second question, you should combine Quadruped.cpp File to study, especially the buildmodel function I think there is something wrong with the annotation of "join axis" of addbody function.I think this axis is not in the parent coordinate system. I've built my own robot model based on "minicheetah.h" although I'm still confused in the original version

Thank you,but I have read Quadruped.cpp many times,the coordinate issue still puzzeled me.

In xTreeAbad/Hip/Knee, the way they built coordinates is different from model.addGroundContactPoint ,you can refer MiniCheetah.h,which means the two methods they set the orgins of knee joints are differnt ,actually apart from knee joint,the hip joint has the same issue.

In my opinion,the orgin of knee coordinate must coincidence with knee joint, the axis of BIG PULLEY--to be more precise.Because in forwardKinematics function ,the foot postions in word/absoulate coordinate are calcuated by the GroundContactPoint.

I was wondering how you built your own robot ,could you post a picture to illustrate your process?Thank you.

Hi there, I met the same problem about the hip and knee coordinate, and I tried to change it to the coordinate they defined in their papers. However, I found that will make cheetah terrible performance in locomotion mode. I mainly change Quadeuped.cpp, Drawlist.cpp and some joint angular settings. Have you ever tried to modify it before? Hope your advice!

  // upper
  upper.setToIdentity();
  upper.rotate(-90, 0, 1, 0);
  lower.rotate(180, 0, 0, 1);
  // lower
  lower.setToIdentity();
  lower.rotate(180, 0, 1, 0);
  lower.rotate(180, 0, 0,1);
// Hip Joint
          bodyID++;
          Mat6<T> xtreeHip = createSXform(I3,withLegSigns<T>(_hipLocation, legID));
          Mat6<T> xtreeHipRotor = createSXform(I3,withLegSigns<T>(_hipRotorLocation, legID));
          if (sideSign < 0) {
              model.addBody(_hipInertia.flipAlongAxis(CoordinateAxis::Y),
                            _hipRotorInertia.flipAlongAxis(CoordinateAxis::Y),
                            _hipGearRatio, bodyID - 1, JointType::Revolute,
                            CoordinateAxis::Y, xtreeHip, xtreeHipRotor);
          } else {
              model.addBody(_hipInertia, _hipRotorInertia, _hipGearRatio, bodyID - 1,
                            JointType::Revolute, CoordinateAxis::Y, xtreeHip,
                            xtreeHipRotor);
          }

          model.addGroundContactPoint(bodyID, Vec3<T>(0., 0., -_hipLinkLength));

          // Knee Joint
          bodyID++;
          Mat6<T> xtreeKnee = createSXform(I3, _kneeLocation);
          Mat6<T> xtreeKneeRotor = createSXform(I3, _kneeRotorLocation);
          if (sideSign < 0) {
              model.addBody(_kneeInertia.flipAlongAxis(CoordinateAxis::Y),
                            _kneeRotorInertia.flipAlongAxis(CoordinateAxis::Y),
                            _kneeGearRatio, bodyID - 1, JointType::Revolute,
                            CoordinateAxis::Y, xtreeKnee, xtreeKneeRotor);
              // add foot ground contact point
              model.addGroundContactPoint(bodyID, Vec3<T>(0.,0., -_kneeLinkLength), true);
          } else {
              model.addBody(_kneeInertia, _kneeRotorInertia, _kneeGearRatio, bodyID - 1,
                            JointType::Revolute, CoordinateAxis::Y, xtreeKnee,
                            xtreeKneeRotor);
              // add foot ground contact point
              model.addGroundContactPoint(bodyID, Vec3<T>(0., 0., -_kneeLinkLength ), true);
          }