Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@ def spd_rad_to_raw(self, spd_rad):

def set_torque_enable(self, torque_enable):
mcv = (self.motor_id, torque_enable)
self.dxl_io.set_multi_torque_enabled([mcv])
self.dxl_io.set_multi_torque_enabled([mcv])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless change


def set_speed(self, speed):
mcv = (self.motor_id, self.spd_rad_to_raw(speed))
self.dxl_io.set_multi_speed([mcv])

def set_goal_torque(self,torque):
print torque
self.dxl_io.set_goal_torque(self.motor_id, int(torque))

def set_compliance_slope(self, slope):
if slope < DXL_MIN_COMPLIANCE_SLOPE: slope = DXL_MIN_COMPLIANCE_SLOPE
elif slope > DXL_MAX_COMPLIANCE_SLOPE: slope = DXL_MAX_COMPLIANCE_SLOPE
Expand Down Expand Up @@ -166,5 +170,5 @@ def process_motor_states(self, state_list):
self.joint_state_pub.publish(self.joint_state)

def process_command(self, msg):
self.set_speed(msg.data)
self.set_goal_torque(msg.data)

@dbolkensteyn dbolkensteyn Jan 13, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is a feature, not a bug.
Step 4 of the torque mode tutorial clearly states To actually move the motor we need to publish a desired velocity to /pan_controller/command (the keyword being velocity).

Moreover this change breaks compatibility for existing users: it is probably safer to change the name of this controller from torque to velocity and add a new one that really controls the torque.