Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
roscontrol_sot
Commits
ea5153ff
Commit
ea5153ff
authored
Jul 12, 2019
by
Joseph Mirabel
Committed by
olivier stasse
Jul 13, 2019
Browse files
Fix SEGV when initializing absent sensors.
parent
e49b7304
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/roscontrol-sot-controller.cpp
View file @
ea5153ff
...
...
@@ -310,12 +310,15 @@ namespace sot_controller
{
if
(
!
initJoints
())
return
false
;
if
(
!
initIMU
())
return
false
;
if
(
!
initForceSensors
())
return
false
;
if
(
!
initTemperatureSensors
())
return
false
;
if
(
!
initIMU
())
{
ROS_WARN
(
"could not initialize IMU sensor(s)."
);
}
if
(
!
initForceSensors
())
{
ROS_WARN
(
"could not initialize force sensor(s)."
);
}
if
(
!
initTemperatureSensors
())
{
ROS_WARN
(
"could not initialize temperature sensor(s)."
);
}
// Initialize ros node.
int
argc
=
1
;
...
...
@@ -782,6 +785,8 @@ namespace sot_controller
bool
RCSotController
::
initIMU
()
{
if
(
!
imu_iface_
)
return
false
;
// get all imu sensor names
const
std
::
vector
<
std
::
string
>&
imu_iface_names
=
imu_iface_
->
getNames
();
if
(
verbosity_level_
>
0
)
...
...
@@ -800,6 +805,8 @@ namespace sot_controller
bool
RCSotController
::
initForceSensors
()
{
if
(
!
ft_iface_
)
return
false
;
// get force torque sensors names package.
const
std
::
vector
<
std
::
string
>&
ft_iface_names
=
ft_iface_
->
getNames
();
if
(
verbosity_level_
>
0
)
...
...
@@ -821,6 +828,8 @@ namespace sot_controller
if
(
!
simulation_mode_
)
{
#ifdef TEMPERATURE_SENSOR_CONTROLLER
if
(
!
act_temp_iface_
)
return
false
;
// get temperature sensors names
const
std
::
vector
<
std
::
string
>&
act_temp_iface_names
=
act_temp_iface_
->
getNames
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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