Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Paul Rouanet
ros2_control_bolt
Commits
b2b04c4b
Commit
b2b04c4b
authored
Jul 21, 2021
by
Paul Rouanet
Browse files
Clean the code (delete commented code in init_robot)
parent
53a65068
Changes
1
Show whitespace changes
Inline
Side-by-side
ros2_control_bolt/src/system_bolt.cpp
View file @
b2b04c4b
...
...
@@ -52,18 +52,15 @@ Eigen::Vector6d desired_torque = Eigen::Vector6d::Zero();
return_type
SystemBoltHardware
::
init_robot
(
const
hardware_interface
::
HardwareInfo
&
info
)
{
//Define the ODRI robot from URDF values
// Get the ethernet interface to discuss with the ODRI master board
eth_interface_
=
info_
.
hardware_parameters
.
at
(
"eth_interface"
);
/*Définir le robot (ODRI) à partir des variables de l'URDF*/
// Define board (ODRI)
auto
main_board_ptr_
=
std
::
make_shared
<
MasterBoardInterface
>
(
eth_interface_
);
// Define joints (ODRI)
for
(
const
hardware_interface
::
ComponentInfo
&
joint
:
info
.
joints
)
{
// Motor numbers
motor_numbers_
[
joint_name_to_motor_nb_
[
joint
.
name
]]
=
stoi
(
joint
.
parameters
.
at
(
"motor_number"
));
...
...
@@ -101,7 +98,6 @@ return_type SystemBoltHardware::init_robot(const hardware_interface::HardwareInf
for
(
const
hardware_interface
::
ComponentInfo
&
sensor
:
info
.
sensors
)
{
std
::
istringstream
iss_rotate
(
sensor
.
parameters
.
at
(
"rotate_vector"
));
std
::
istringstream
iss_orientation
(
sensor
.
parameters
.
at
(
"orientation_vector"
));
for
(
int
n
=
0
;
n
<
3
;
n
++
){
iss_rotate
>>
rotate_vector_
[
n
];
}
...
...
@@ -109,7 +105,6 @@ return_type SystemBoltHardware::init_robot(const hardware_interface::HardwareInf
iss_orientation
>>
orientation_vector_
[
n
];
}
}
auto
imu
=
std
::
make_shared
<
IMU
>
(
main_board_ptr_
,
rotate_vector_
,
orientation_vector_
);
...
...
@@ -121,33 +116,11 @@ return_type SystemBoltHardware::init_robot(const hardware_interface::HardwareInf
kp_
=
0.0
;
kd_
=
0.0
;
/*
for (const hardware_interface::ComponentInfo & joint : info.joints) {
//Données des joints
//Sorties (commandes)
joint.command_interfaces;
//Entrées (états)
joint.state_interfaces;
}
for (const hardware_interface::ComponentInfo & sensor : info.sensors) {
//Données des capteurs
//Entrées (états)
sensor.state_interfaces;
}
*/
return
return_type
::
OK
;
}
return_type
SystemBoltHardware
::
configure
(
const
hardware_interface
::
HardwareInfo
&
info
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment