Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
92ce1a77
Commit
92ce1a77
authored
3 years ago
by
Johann Mantel
Browse files
Options
Downloads
Patches
Plain Diff
code formatting
parent
eeda820d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/drivers/SickLaserUnit/SickLaserUnit.cpp
+14
-17
14 additions, 17 deletions
source/RobotAPI/drivers/SickLaserUnit/SickLaserUnit.cpp
with
14 additions
and
17 deletions
source/RobotAPI/drivers/SickLaserUnit/SickLaserUnit.cpp
+
14
−
17
View file @
92ce1a77
...
...
@@ -76,10 +76,9 @@ void SickLaserUnit::onInitComponent() {
std
::
string
scannerName
;
if
(
false
==
nhPriv
.
getParam
(
"scanner_type"
,
scannerName
))
{
ROS_ERROR
(
"cannot find parameter "
"scanner_type"
" in the param set. Please specify scanner_type."
);
ROS_ERROR
(
"cannot find parameter "
"scanner_type"
" in the param set. Please specify scanner_type."
);
ROS_ERROR
(
"Try to set %s as fallback.
\n
"
,
nodeName
.
c_str
());
scannerName
=
nodeName
;
}
...
...
@@ -109,7 +108,7 @@ void SickLaserUnit::onInitComponent() {
new
sick_scan
::
SickGenericParser
(
scannerName
);
double
param
;
char
colaDialectId
=
'A'
;
// A or B (Ascii or Binary)
char
colaDialectId
=
'A'
;
// A or B (Ascii or Binary)
if
(
nhPriv
.
getParam
(
"range_min"
,
param
))
{
parser
->
set_range_min
(
param
);
...
...
@@ -163,14 +162,13 @@ void SickLaserUnit::onConnectComponent() {
ROS_INFO
(
"Start initialising scanner [Ip: %s] [Port: %s]"
,
hostname
.
c_str
(),
port
.
c_str
());
// attempt to connect/reconnect
delete
s
;
// disconnect scanner
delete
s
;
// disconnect scanner
if
(
useTCP
)
{
s
=
new
sick_scan
::
SickScanCommonTcp
(
hostname
,
port
,
timelimit
,
parser
,
colaDialectId
);
}
else
{
ROS_ERROR
(
"TCP is not switched on. Probably hostname or port not set. Use "
"roslaunch to start node."
);
ROS_ERROR
(
"TCP is not switched on. Probably hostname or port not set. Use "
"roslaunch to start node."
);
exit
(
-
1
);
}
...
...
@@ -181,16 +179,15 @@ void SickLaserUnit::onConnectComponent() {
isInitialized
=
true
;
signal
(
SIGINT
,
SIG_DFL
);
// change back to standard signal handler after initialising
if
(
result
==
sick_scan
::
ExitSuccess
)
// OK -> loop again
SIG_DFL
);
// change back to standard signal handler after initialising
if
(
result
==
sick_scan
::
ExitSuccess
)
// OK -> loop again
{
if
(
changeIP
)
{
runState
=
scanner_finalize
;
}
runState
=
scanner_run
;
// after initialising switch to run state
runState
=
scanner_run
;
// after initialising switch to run state
}
else
{
runState
=
scanner_init
;
// If there was an error, try to restart scanner
runState
=
scanner_init
;
// If there was an error, try to restart scanner
}
// Do things after connecting to topics and components.
...
...
@@ -222,12 +219,12 @@ void SickLaserUnit::onConnectComponent() {
void
SickLaserUnit
::
run
()
{
while
(
!
task
->
isStopped
())
{
if
(
result
==
sick_scan
::
ExitSuccess
)
// OK -> loop again
if
(
result
==
sick_scan
::
ExitSuccess
)
// OK -> loop again
{
ros
::
spinOnce
();
result
=
s
->
loopOnce
();
}
else
{
runState
=
scanner_finalize
;
// interrupt
runState
=
scanner_finalize
;
// interrupt
}
}
}
...
...
@@ -315,4 +312,4 @@ arviz)
}
*/
}
// namespace armarx
}
// namespace armarx
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment