Update frame's translations and orientations
Posted: Mon Aug 28, 2023 12:21 am
Hi OpenSim experts!
I'm wondering if anyone can help me figuring out how to change the translations and orientations of the joints' frames. I was able to get the values with the following C++ code:
Unfortunately, I could not find a way to update these translations and orientations. Could anyone possible teach me how to do so?
Thankfully,
Hojin
I'm wondering if anyone can help me figuring out how to change the translations and orientations of the joints' frames. I was able to get the values with the following C++ code:
Code: Select all
Model model("my_model.osim");
const JointSet& jset = model.getJointSet();
const Joint& femur_weld_r = jset.get("femur_weld_r");
const Joint& tibial_plat_weld_r = jset.get("tibial_plat_weld_r");
const PhysicalOffsetFrame& fem_offset = femur_weld_r.get_frames(1);
const PhysicalOffsetFrame& tib_offset = tibial_plat_weld_r.get_frames(1);
const SimTK::Vec<3>& fem_translation = fem_offset.get_translation();
const SimTK::Vec<3>& fem_rotation = fem_offset.get_orientation();
const SimTK::Vec<3>& tib_translation = tib_offset.get_translation();
const SimTK::Vec<3>& tib_rotation = tib_offset.get_orientation();
cout << fem_translation << endl;
cout << fem_rotation << endl;
cout << tib_translation << endl;
cout << tib_rotation << endl;;
Thankfully,
Hojin