Skip to content

Commit 1810137

Browse files
authored
Merge pull request #1258 from YoheiKakiuchi/update_gainfile
Update for reading torque gain
2 parents 5654ae5 + 165a7f1 commit 1810137

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

rtc/RobotHardware/RobotHardware.txt

+24
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,31 @@ N/A
7373
<tr><td>model</td><td>std::string</td><td></td><td>URL of a VRML model</td></tr>
7474
<tr><td>sensor_id.right_leg_force_sensor</td><td>unsigned int</td><td></td><td>ID of a force/torque sensor whose Z force is checked to detect emergency</td></tr>
7575
<tr><td>sensor_id.leg_leg_force_sensor</td><td>unsigned int</td><td></td><td>ID of a force/torque sensor whose Z force is checked to detect emergency</td></tr>
76+
<tr><td>pdgains.file_name</td><td>string</td><td></td><td>Settings of controller gain for low level hardware. default value: "Pdgains.sav"</td></tr>
7677
</table>
7778

79+
\subsection gainfile How to write a PDgain file
80+
81+
@par
82+
A line should have maximum 6 numbers.
83+
The first is P gain, the second is I gain, the 3rd is D gain,
84+
the 4th is torque P gain, the 5th is torque I gain, and the 6th is torque D gain.
85+
@par
86+
A line which is blank line and starts with '#' is ignored.
87+
@par
88+
Example of gain file:
89+
@code
90+
# gain settings
91+
# p_gain i_gain d_gain torque p_gain torque i_gain torque d_gain
92+
# arm
93+
100 0 10
94+
100 0 10
95+
96+
10 0 1
97+
10 0 1
98+
99+
1000 100 10 2000 200 20
100+
101+
@endcode
78102

79103
*/

rtc/RobotHardware/robot.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,18 @@ bool robot::loadGain()
135135
default_pgain[i] = tmp;
136136
if(sstrm.eof()) break;
137137

138-
sstrm >> tmp; // dummy
138+
sstrm >> tmp; // I gain
139139
if(sstrm.eof()) break;
140140

141141
sstrm >> tmp;
142142
default_dgain[i] = tmp;
143143
if(sstrm.eof()) break;
144144

145-
sstrm >> tmp; // dummy
146-
if(sstrm.eof()) break;
147-
148145
sstrm >> tmp;
149146
default_tqpgain[i] = tmp;
150147
if(sstrm.eof()) break;
151148

152-
sstrm >> tmp; // dummy
149+
sstrm >> tmp; // I gain for torque
153150
if(sstrm.eof()) break;
154151

155152
sstrm >> tmp;

0 commit comments

Comments
 (0)