-
Notifications
You must be signed in to change notification settings - Fork 168
fixed bug torque_controller #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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]) | ||
|
|
||
| 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 | ||
|
|
@@ -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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this is a feature, not a bug. Moreover this change breaks compatibility for existing users: it is probably safer to change the name of this controller from |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless change