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
6e03cfe7
Commit
6e03cfe7
authored
Jul 21, 2021
by
Paul Rouanet
Browse files
Modif stop()
parent
ed4a8b3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ros2_control_bolt/src/system_bolt.cpp
View file @
6e03cfe7
...
@@ -495,19 +495,16 @@ return_type SystemBoltHardware::stop()
...
@@ -495,19 +495,16 @@ return_type SystemBoltHardware::stop()
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
last
=
std
::
chrono
::
system_clock
::
now
();
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
last
=
std
::
chrono
::
system_clock
::
now
();
while
(
!
robot_
->
IsTimeout
())
{
while
(
!
robot_
->
IsTimeout
())
{
if
(((
std
::
chrono
::
duration
<
double
>
)(
std
::
chrono
::
system_clock
::
now
()
-
last
)).
count
()
>
0.001
)
{
last
=
std
::
chrono
::
system_clock
::
now
();
// last+dt would be better
t
+=
dt
;
for
(
const
hardware_interface
::
ComponentInfo
&
joint
:
info_
.
joints
)
{
last
=
std
::
chrono
::
system_clock
::
now
();
// last+dt would be better
torques
[
joint_name_to_motor_nb_
[
joint
.
name
]]
=
0.0
;
}
robot_
->
joints
->
SetTorques
(
torques
);
t
+=
dt
;
for
(
const
hardware_interface
::
ComponentInfo
&
joint
:
info_
.
joints
)
{
torques
[
joint_name_to_motor_nb_
[
joint
.
name
]]
=
0.0
;
}
}
robot_
->
joints
->
SetTorques
(
torques
);
robot_
->
SendCommand
();
robot_
->
SendCommand
();
}
}
...
...
Write
Preview
Supports
Markdown
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