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
a38cc15f
Commit
a38cc15f
authored
1 year ago
by
Fabian Reister
Committed by
ARMAR-6 User
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Change topic to proxy connection for Hokuyo unit
parent
578912f5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!372
Changes from ARMAR-6 Vision PC
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.cpp
+19
-15
19 additions, 15 deletions
source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.cpp
source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.h
+4
-4
4 additions, 4 deletions
source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.h
with
23 additions
and
19 deletions
source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.cpp
+
19
−
15
View file @
a38cc15f
...
...
@@ -24,6 +24,7 @@
#include
<SimoxUtility/algorithm/string/string_tools.h>
#include
"ArmarXCore/core/time/Clock.h"
#include
<ArmarXCore/core/time/DateTime.h>
#include
<ArmarXCore/core/time/Duration.h>
#include
<ArmarXCore/core/time/ice_conversions.h>
...
...
@@ -45,9 +46,9 @@ HokuyoLaserUnit::onInitComponent()
offeringTopicFromProperty
(
"RobotHealthTopicName"
);
offeringTopicFromProperty
(
"DebugObserverName"
);
topic
Name
=
getProperty
<
std
::
string
>
(
"LaserScanner
Topic
Name"
).
getValue
();
offeringTopic
(
topic
Name
);
ARMARX_INFO
<<
"Going to report
on topic "
<<
topic
Name
;
laserScannerListenerProxy
Name
=
getProperty
<
std
::
string
>
(
"LaserScanner
Listener
Name"
).
getValue
();
usingProxyFromProperty
(
"LaserScannerListener
Name
"
);
ARMARX_INFO
<<
"Going to report
to listener "
<<
laserScannerListenerProxy
Name
;
updatePeriod
=
getProperty
<
int
>
(
"UpdatePeriod"
).
getValue
();
angleOffset
=
getProperty
<
float
>
(
"AngleOffset"
).
getValue
();
...
...
@@ -92,7 +93,7 @@ HokuyoLaserUnit::onConnectComponent()
{
ARMARX_TRACE
;
topic
=
getTopic
<
LaserScanner
Unit
Listener
Prx
>
(
topic
Name
);
getProxyFromProperty
(
listenerPrx
,
"
LaserScannerListenerName
"
);
debugObserver
=
getTopic
<
DebugObserverInterfacePrx
>
(
getProperty
<
std
::
string
>
(
"DebugObserverName"
).
getValue
());
...
...
@@ -133,7 +134,7 @@ HokuyoLaserUnit::onConnectComponent()
info
.
stepSize
=
(
info
.
maxAngle
-
info
.
minAngle
)
/
(
maxStep
-
minStep
);
device
.
lengthData
.
resize
(
lengthDataSize
);
device
.
scanTopic
=
topic
;
device
.
listenerPrx
=
listenerPrx
;
device
.
robotHealthPlugin
=
heartbeat
;
device
.
debugObserver
=
debugObserver
;
...
...
@@ -181,7 +182,7 @@ HokuyoLaserUnit::createPropertyDefinitions()
std
::
string
HokuyoLaserUnit
::
getReportTopicName
(
const
Ice
::
Current
&
)
const
{
return
topic
Name
;
return
laserScannerListenerProxy
Name
;
}
LaserScannerInfoSeq
...
...
@@ -230,6 +231,8 @@ HokuyoLaserScanDevice::run()
ARMARX_TRACE
;
while
(
!
task
->
isStopped
())
{
ARMARX_INFO
<<
deactivateSpam
()
<<
"Running update loop for laserscanner device "
<<
ip
;
IceUtil
::
Time
time_start
=
TimeUtil
::
GetTime
();
if
(
errorCounter
>
10
)
...
...
@@ -272,15 +275,16 @@ HokuyoLaserScanDevice::run()
errorCounter
=
0
;
if
(
scanTopic
)
if
(
listenerPrx
)
{
scanTopic
->
reportSensorValues
(
ip
,
frame
,
scan
,
now
);
listenerPrx
->
reportSensorValues
(
ip
,
frame
,
scan
,
now
);
}
else
{
ARMARX_WARNING
<<
"No
scan topic
available: IP: "
<<
ip
<<
", Port: "
<<
port
;
ARMARX_WARNING
<<
"No
proxy
available: IP: "
<<
ip
<<
", Port: "
<<
port
;
}
IceUtil
::
Time
time_
topicSens
or
=
TimeUtil
::
GetTime
();
IceUtil
::
Time
time_
proxyRep
or
t
=
TimeUtil
::
GetTime
();
if
(
robotHealthPlugin
!=
nullptr
)
{
...
...
@@ -302,10 +306,10 @@ HokuyoLaserScanDevice::run()
new
Variant
((
time_measure
-
time_start
).
toMilliSecondsDouble
());
durations
[
"update_ms"
]
=
new
Variant
((
time_update
-
time_measure
).
toMilliSecondsDouble
());
durations
[
"
topic_sens
or_ms"
]
=
new
Variant
((
time_
topicSens
or
-
time_update
).
toMilliSecondsDouble
());
durations
[
"
proxy_rep
or
t
_ms"
]
=
new
Variant
((
time_
proxyRep
or
t
-
time_update
).
toMilliSecondsDouble
());
durations
[
"topic_health_ms"
]
=
new
Variant
((
time_topicHeartbeat
-
time_
topicSens
or
).
toMilliSecondsDouble
());
new
Variant
((
time_topicHeartbeat
-
time_
proxyRep
or
t
).
toMilliSecondsDouble
());
debugObserver
->
setDebugChannel
(
"LaserScannerDuration_"
+
simox
::
alg
::
replace_all
(
ip
,
"."
,
"_"
),
durations
);
...
...
@@ -318,9 +322,9 @@ HokuyoLaserScanDevice::run()
<<
"Update: "
<<
(
time_update
-
time_measure
).
toMilliSecondsDouble
()
<<
"ms
\n
"
<<
"TopicSensor: "
<<
(
time_
topicSens
or
-
time_update
).
toMilliSecondsDouble
()
<<
"ms
\n
"
<<
(
time_
proxyRep
or
t
-
time_update
).
toMilliSecondsDouble
()
<<
"ms
\n
"
<<
"TopicHeart: "
<<
(
time_topicHeartbeat
-
time_
topicSens
or
).
toMilliSecondsDouble
()
<<
(
time_topicHeartbeat
-
time_
proxyRep
or
t
).
toMilliSecondsDouble
()
<<
"ms
\n
"
;
}
}
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.h
+
4
−
4
View file @
a38cc15f
...
...
@@ -47,7 +47,7 @@ namespace armarx
armarx
::
ComponentPropertyDefinitions
(
prefix
)
{
defineOptionalProperty
<
std
::
string
>
(
"LaserScanner
TopicName"
,
"LaserScans
"
,
"Name of the laser scan
topic
."
);
"LaserScanner
ListenerName"
,
"CartographerMappingAndLocalization
"
,
"Name of the laser scan
listener
."
);
defineOptionalProperty
<
int
>
(
"UpdatePeriod"
,
25
,
"Update period for laser scans"
);
defineOptionalProperty
<
float
>
(
"AngleOffset"
,
-
2.3561944902
,
...
...
@@ -87,7 +87,7 @@ namespace armarx
LaserScan
scan
;
std
::
string
componentName
;
LaserScannerUnitListenerPrx
scanTopic
;
LaserScannerUnitListenerPrx
listenerPrx
;
armarx
::
plugins
::
HeartbeatComponentPlugin
*
robotHealthPlugin
;
DebugObserverInterfacePrx
debugObserver
;
};
...
...
@@ -150,8 +150,8 @@ namespace armarx
LaserScannerInfoSeq
getConnectedDevices
(
const
Ice
::
Current
&
c
)
const
override
;
private
:
std
::
string
topic
Name
;
LaserScannerUnitListenerPrx
topic
;
std
::
string
laserScannerListenerProxy
Name
;
LaserScannerUnitListenerPrx
listenerPrx
;
int
updatePeriod
=
25
;
float
angleOffset
=
0.0
f
;
std
::
vector
<
HokuyoLaserScanDevice
>
devices
;
...
...
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