Skip to content

Commit 1b1ca2f

Browse files
committed
Added some missing things.
1 parent 7ea77ee commit 1b1ca2f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

franka-interface-common/include/franka-interface-common/definitions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ enum class SensorDataMessageType : uint8_t {
112112
JOINT_POSITION_VELOCITY,
113113
JOINT_POSITION,
114114
JOINT_VELOCITY,
115+
JOINT_TORQUE,
115116
POSE_POSITION_VELOCITY,
116117
POSE_POSITION,
117118
SHOULD_TERMINATE,

franka-interface/src/feedback_controller/pass_through_joint_torque_feedback_controller.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,18 @@
77
#include "franka-interface/trajectory_generator/impulse_trajectory_generator.h"
88

99
void PassThroughJointTorqueFeedbackController::parse_parameters() {
10-
// pass
10+
int data_size = (params_[1] + (params_[2] << 8) + (params_[3] << 16) + (params_[4] << 24));
11+
12+
bool parsed_params = joint_torque_feedback_params_.ParseFromArray(params_ + 5, data_size);
13+
14+
if (parsed_params){
15+
for (int i = 0; i < 7; i++) {
16+
S_[i] = std::min(std::max(joint_torque_feedback_params_.selection(i), 0.), 1.);
17+
desired_joint_torques_[i] = joint_torque_feedback_params_.joint_torques(i);
18+
}
19+
} else {
20+
std::cout << "Parsing JointTorqueFeedbackController params failed. Data size = " << data_size << std::endl;
21+
}
1122
}
1223

1324
void PassThroughJointTorqueFeedbackController::initialize_controller(FrankaRobot *robot) {

0 commit comments

Comments
 (0)