Merge lp:~shadowrobot/sr-ros-interface-ethercat/UPMC_Torque_bug_fix into lp:sr-ros-interface-ethercat

Proposed by Toni Oliver
Status: Merged
Merged at revision: 535
Proposed branch: lp:~shadowrobot/sr-ros-interface-ethercat/UPMC_Torque_bug_fix
Merge into: lp:sr-ros-interface-ethercat
Diff against target: 49 lines (+5/-5)
2 files modified
sr_robot_lib/python_lib/etherCAT_hand_lib.py (+2/-2)
sr_robot_lib/src/sr_robot_lib.cpp (+3/-3)
To merge this branch: bzr merge lp:~shadowrobot/sr-ros-interface-ethercat/UPMC_Torque_bug_fix
Reviewer Review Type Date Requested Status
Ugo Approve
Review via email: mp+93875@code.launchpad.net

Description of the change

Fixed bug. Now we don't read Torque from MOTOR_DATA_SLOW_MISC packets.
Fixed an error in the last merged version of etherCAT_hand_lib.py as well.

To post a comment you must log in.
Revision history for this message
Ugo (ugocupcic) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sr_robot_lib/python_lib/etherCAT_hand_lib.py'
2--- sr_robot_lib/python_lib/etherCAT_hand_lib.py 2012-02-17 17:09:18 +0000
3+++ sr_robot_lib/python_lib/etherCAT_hand_lib.py 2012-02-20 16:36:35 +0000
4@@ -211,11 +211,11 @@
5 #check if something is being published to this topic, otherwise
6 # return false (the library is not activated)
7 try:
8- rospy.wait_for_message("/gazebo/joint_states", JointState, timeout = 0.2)
9+ rospy.wait_for_message("/joint_states", JointState, timeout = 0.2)
10 except:
11 return False
12
13- self.joint_state_subscriber = rospy.Subscriber("/gazebo/joint_states", JointState, self.joint_state_callback)
14+ self.joint_state_subscriber = rospy.Subscriber("/joint_states", JointState, self.joint_state_callback)
15 return True
16
17 def on_close(self):
18
19=== modified file 'sr_robot_lib/src/sr_robot_lib.cpp'
20--- sr_robot_lib/src/sr_robot_lib.cpp 2011-12-16 13:36:08 +0000
21+++ sr_robot_lib/src/sr_robot_lib.cpp 2012-02-20 16:36:35 +0000
22@@ -671,6 +671,9 @@
23 //We received a slow data:
24 // the slow data type is contained in .torque, while
25 // the actual data is in .misc.
26+ // so we won't read torque information from .torque
27+ read_torque = false;
28+
29 switch (static_cast<int16u>(status_data->motor_data_packet[index_motor_in_msg].torque))
30 {
31 case MOTOR_SLOW_DATA_SVN_REVISION:
32@@ -749,17 +752,14 @@
33 static_cast<int16u>(status_data->motor_data_packet[index_motor_in_msg].misc);
34 break;
35 case MOTOR_DATA_PTERM:
36- read_torque = false;
37 actuator->state_.force_control_pterm =
38 static_cast<int16u>(status_data->motor_data_packet[index_motor_in_msg].misc);
39 break;
40 case MOTOR_DATA_ITERM:
41- read_torque = false;
42 actuator->state_.force_control_iterm =
43 static_cast<int16u>(status_data->motor_data_packet[index_motor_in_msg].misc);
44 break;
45 case MOTOR_DATA_DTERM:
46- read_torque = false;
47 actuator->state_.force_control_dterm =
48 static_cast<int16u>(status_data->motor_data_packet[index_motor_in_msg].misc);
49 break;

Subscribers

People subscribed via source and target branches

to all changes: