Skip to content

Commit

Permalink
Temp change: Shoulder/Forearm controls to Wrist.
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushKulk committed May 24, 2024
1 parent ee64910 commit 720b5c6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/world_interface/kinematic_common_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,14 @@ double getJointPowerValue(types::jointid_t joint) {

void setJointMotorPower(robot::types::jointid_t joint, double power) {
using robot::types::jointid_t;
if (Constants::JOINT_MOTOR_MAP.find(joint) != Constants::JOINT_MOTOR_MAP.end()) {

if (joint == jointid_t::shoulder) {
setMotorPower(robot::types::motorid_t::wristDiffRight, power);
} else if (joint == jointid_t::forearm) {
setMotorPower(robot::types::motorid_t::wristDiffLeft, power);
}

else if (Constants::JOINT_MOTOR_MAP.find(joint) != Constants::JOINT_MOTOR_MAP.end()) {
bool isIKMotor = std::find(Constants::arm::IK_MOTOR_JOINTS.begin(),
Constants::arm::IK_MOTOR_JOINTS.end(),
joint) != Constants::arm::IK_MOTOR_JOINTS.end();
Expand All @@ -190,7 +197,8 @@ void setJointMotorPower(robot::types::jointid_t joint, double power) {
robot::getMotorPositionsRad(Constants::arm::IK_MOTORS).getData());
}
}
} else if (joint == jointid_t::wristPitch || joint == jointid_t::wristRoll) {
}
else if (joint == jointid_t::wristPitch || joint == jointid_t::wristRoll) {
kinematics::DiffWristKinematics diffWristKinematics;
setJointPowerValue(joint, power);
kinematics::jointpos_t jointPwr2(getJointPowerValue(jointid_t::wristPitch),
Expand Down

0 comments on commit 720b5c6

Please sign in to comment.