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

Proposed by Ugo
Status: Merged
Merged at revision: 531
Proposed branch: lp:~shadowrobot/sr-ros-interface-ethercat/small_fixes_syntouch
Merge into: lp:sr-ros-interface-ethercat
Diff against target: 117 lines (+23/-10)
4 files modified
sr_robot_lib/src/biotac.cpp (+2/-2)
sr_robot_lib/src/generic_tactiles.cpp (+1/-1)
sr_robot_lib/src/shadow_PSTs.cpp (+2/-2)
sr_robot_lib/src/sr_robot_lib.cpp (+18/-5)
To merge this branch: bzr merge lp:~shadowrobot/sr-ros-interface-ethercat/small_fixes_syntouch
Reviewer Review Type Date Requested Status
Ugo Approve
Review via email: mp+86041@code.launchpad.net

Description of the change

Fixing some small bugs.

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/src/biotac.cpp'
2--- sr_robot_lib/src/biotac.cpp 2011-12-08 11:01:29 +0000
3+++ sr_robot_lib/src/biotac.cpp 2011-12-16 13:44:00 +0000
4@@ -200,7 +200,7 @@
5 case TACTILE_SENSOR_TYPE_PCB_VERSION:
6 if( sr_math_utils::is_bit_mask_index_true(tactile_mask, id_sensor) )
7 {
8- tactiles_vector->at(id_sensor).pcb_version = static_cast<unsigned int>(static_cast<int16u>(status_data->tactile[id_sensor].word[0]) );
9+ tactiles_vector->at(id_sensor).pcb_version = sanitise_string( status_data->tactile[id_sensor].string, TACTILE_DATA_LENGTH_BYTES );
10 }
11 break;
12
13@@ -282,7 +282,7 @@
14 d.addf("Serial Number", "%s", tactiles_vector->at(id_tact).serial_number.c_str());
15
16 d.addf("Software Version", "%s", tactiles_vector->at(id_tact).get_software_version().c_str());
17- d.addf("PCB Version", "%d", tactiles_vector->at(id_tact).pcb_version);
18+ d.addf("PCB Version", "%s", tactiles_vector->at(id_tact).pcb_version.c_str());
19
20 vec.push_back(d);
21 }
22
23=== modified file 'sr_robot_lib/src/generic_tactiles.cpp'
24--- sr_robot_lib/src/generic_tactiles.cpp 2011-12-08 11:01:29 +0000
25+++ sr_robot_lib/src/generic_tactiles.cpp 2011-12-16 13:44:00 +0000
26@@ -112,7 +112,7 @@
27 if( sr_math_utils::is_bit_mask_index_true(tactile_mask, id_sensor) )
28 {
29 if( tactiles_vector != NULL )
30- tactiles_vector->at(id_sensor).pcb_version = static_cast<unsigned int>(static_cast<int16u>(status_data->tactile[id_sensor].word[0]) );
31+ tactiles_vector->at(id_sensor).pcb_version = sanitise_string( status_data->tactile[id_sensor].string, TACTILE_DATA_LENGTH_BYTES );
32 }
33 break;
34
35
36=== modified file 'sr_robot_lib/src/shadow_PSTs.cpp'
37--- sr_robot_lib/src/shadow_PSTs.cpp 2011-12-08 11:01:29 +0000
38+++ sr_robot_lib/src/shadow_PSTs.cpp 2011-12-16 13:44:00 +0000
39@@ -128,7 +128,7 @@
40 case TACTILE_SENSOR_TYPE_PCB_VERSION:
41 if( sr_math_utils::is_bit_mask_index_true(tactile_mask, id_sensor) )
42 {
43- tactiles_vector->at(id_sensor).pcb_version = static_cast<unsigned int>(static_cast<int16u>(status_data->tactile[id_sensor].word[0]) );
44+ tactiles_vector->at(id_sensor).pcb_version = sanitise_string( status_data->tactile[id_sensor].string, TACTILE_DATA_LENGTH_BYTES );
45 }
46 break;
47
48@@ -189,7 +189,7 @@
49 d.addf("Serial Number", "%s", tactiles_vector->at(id_tact).serial_number.c_str());
50
51 d.addf("Software Version", "%d", tactiles_vector->at(id_tact).get_software_version().c_str());
52- d.addf("PCB Version", "%d", tactiles_vector->at(id_tact).pcb_version);
53+ d.addf("PCB Version", "%s", tactiles_vector->at(id_tact).pcb_version.c_str());
54
55 d.addf("Pressure Raw", "%d", tactiles_vector->at(id_tact).pressure_raw);
56 d.addf("Zero Tracking", "%d", tactiles_vector->at(id_tact).zero_tracking);
57
58=== modified file 'sr_robot_lib/src/sr_robot_lib.cpp'
59--- sr_robot_lib/src/sr_robot_lib.cpp 2011-12-09 15:25:19 +0000
60+++ sr_robot_lib/src/sr_robot_lib.cpp 2011-12-16 13:44:00 +0000
61@@ -44,8 +44,10 @@
62 #endif
63
64 SrRobotLib::SrRobotLib(pr2_hardware_interface::HardwareInterface *hw)
65- : main_pic_idle_time(0), main_pic_idle_time_min(1000), config_index(MOTOR_CONFIG_FIRST_VALUE), nh_tilde("~"), motor_current_state(
66- operation_mode::device_update_state::INITIALIZATION), tactile_current_state(operation_mode::device_update_state::INITIALIZATION)
67+ : main_pic_idle_time(0), main_pic_idle_time_min(1000), motor_current_state(
68+ operation_mode::device_update_state::INITIALIZATION), tactile_current_state(operation_mode::device_update_state::INITIALIZATION),
69+ config_index(MOTOR_CONFIG_FIRST_VALUE),
70+ nh_tilde("~")
71 {
72 #ifdef DEBUG_PUBLISHER
73 debug_motor_indexes_and_data.resize(nb_debug_publishers_const);
74@@ -271,13 +273,25 @@
75 {
76 if (!reset_motors_queue.empty())
77 {
78+ //reset the CAN messages counters for the motor we're going to reset.
79+ short motor_id = reset_motors_queue.front();
80+ boost::ptr_vector<shadow_joints::Joint>::iterator joint_tmp = joints_vector.begin();
81+ for (; joint_tmp != joints_vector.end(); ++joint_tmp)
82+ {
83+ if( joint_tmp->motor->motor_id == motor_id )
84+ {
85+ joint_tmp->motor->actuator->state_.can_msgs_transmitted_ = 0;
86+ joint_tmp->motor->actuator->state_.can_msgs_received_ = 0;
87+ }
88+ }
89+
90 //we have some reset command waiting.
91 // We'll send all of them
92 command->to_motor_data_type = MOTOR_SYSTEM_RESET;
93
94 while (!reset_motors_queue.empty())
95 {
96- short motor_id = reset_motors_queue.front();
97+ motor_id = reset_motors_queue.front();
98 reset_motors_queue.pop();
99
100 // we send the MOTOR_RESET_SYSTEM_KEY
101@@ -427,7 +441,7 @@
102 else
103 d.addf("Force control Sign", "-");
104
105- d.addf("Last Measured Effort", "%f", state->last_measured_effort_);
106+ d.addf("Last Commanded Effort", "%f", state->last_commanded_effort_);
107
108 d.addf("Encoder Position", "%f", state->position_);
109
110@@ -762,7 +776,6 @@
111 #ifdef DEBUG_PUBLISHER
112 if( joint_tmp->motor->motor_id == 8 )
113 {
114- ROS_ERROR_STREAM("Torque " << static_cast<int16s>(status_data->motor_data_packet[index_motor_in_msg].torque));
115 msg_debug.data = static_cast<int16s>(status_data->motor_data_packet[index_motor_in_msg].torque);
116 debug_publishers[4].publish(msg_debug);
117 }

Subscribers

People subscribed via source and target branches

to all changes: