leggedrobotics/perceptive_mpc

Arm Mount frame/link

JuliusSustarevas opened this issue · 2 comments

Hi,

The Kimenatics.cpp files use ArmMount-->ToolMount homogenous transforms, but it is unclear how these are generated. E.g.
const Eigen::Matrix<SCALAR_T, 4, 4> homBase2Wrist2Transform = armMountToWrist2Transform.update(armState); line 44 from MabiKinematics.cpp

But looking through Mabi declarations Arm mount frame does not appear:
enum LinkIdentifiers { WORLD = 0 , SHOULDER , ARM , ELBOW , FOREARM , WRIST_1 , WRIST_2 };

Also looking through Mabi Transforms.h it seems the arm_mount_X_fr.... transforms are somehow irregularly generated. I mean that all other links have transforms sequentially. link1->link2 and link2->link1:

Type_fr_arm_mount_X_fr_SHOULDER fr_arm_mount_X_fr_SHOULDER; Type_fr_arm_mount_X_fr_WRIST_2 fr_arm_mount_X_fr_WRIST_2; Type_fr_WR_ROT_X_fr_WRIST_2 fr_WR_ROT_X_fr_WRIST_2; Type_fr_SHOULDER_X_fr_world fr_SHOULDER_X_fr_world; Type_fr_world_X_fr_SHOULDER fr_world_X_fr_SHOULDER; Type_fr_ARM_X_fr_SHOULDER fr_ARM_X_fr_SHOULDER; Type_fr_SHOULDER_X_fr_ARM fr_SHOULDER_X_fr_ARM; Type_fr_ELBOW_X_fr_ARM fr_ELBOW_X_fr_ARM; Type_fr_ARM_X_fr_ELBOW fr_ARM_X_fr_ELBOW; Type_fr_FOREARM_X_fr_ELBOW fr_FOREARM_X_fr_ELBOW; Type_fr_ELBOW_X_fr_FOREARM fr_ELBOW_X_fr_FOREARM; Type_fr_WRIST_1_X_fr_FOREARM fr_WRIST_1_X_fr_FOREARM; Type_fr_FOREARM_X_fr_WRIST_1 fr_FOREARM_X_fr_WRIST_1; Type_fr_WRIST_2_X_fr_WRIST_1 fr_WRIST_2_X_fr_WRIST_1; Type_fr_WRIST_1_X_fr_WRIST_2 fr_WRIST_1_X_fr_WRIST_2;

So have the arm_mount--> toolmount transforms been written by hand? Or have you setup robcogen in some special way? I was under the impression that only the manipulator urdf is to be passed into robcogen, is this wrong?

Dear Julius,
the transformation code has been generated with robcogen. In the .dtdsl file you need to specify, which transformations you want it to generate. The sequential transformations are being generated anyway without having to specify them manually.
This is the .dtdsl file I used to generate the Mabi kinematics:

Robot mabi
Frames {
    fr_arm_mount, fr_SHOULDER, fr_WR_ROT, fr_WRIST_2
}
Transforms {
	base=fr_arm_mount, target=fr_SHOULDER
	base=fr_arm_mount, target=fr_WRIST_2
	base=fr_WR_ROT, target=fr_WRIST_2
}

My typical workflow is to generate the .kindsl and the .dtdsl file with urdf2robcogen and then to delete all of the transformations that I won't need from the .dtdsl file. You can then specify additional frames and transforms in the same file.
I hope this helps. Let me know if you have more questions.
Best
Johannes

Fantastic, thank you so much.
This must have been somewhere in robcogen docs I just didn't find it. Again thanks.