how to use torque to control joint
Hello, may I control the joint using torque like animate_pose as follows, because it just can control the position, I want to add torque to the joint. thank you best guangda
std::map<std::string, common::numericanimationptr=""> anim;
// Create a new animation for the "my_joint" define in the SDF file.
// The animation will last for 5.0 seconds, and it will repeat
anim["box::my_joint"].reset(new common::NumericAnimation(
"my_animation", 5.0, true));
// Create a key frame for the starting position of the joint
common::NumericKeyFrame *key = anim["box::my_joint"]->CreateKeyFrame(0.0);
key->SetValue(0.0);
// Create a key frame half-way through the animation
key = anim["box::my_joint"]->CreateKeyFrame(2.5);
key->SetValue(-3.14);
// Create the end key frame to be at the same position as the start
// for a smooth animation
key = anim["box::my_joint"]->CreateKeyFrame(5.0);
key->SetValue(0.0);
// Attach the animation to the model
_model->SetJointAnimation(anim);