Skip to content
Snippets Groups Projects
Commit 1b6bab99 authored by armar-user's avatar armar-user
Browse files

HokuyoLaserUnit: Fix topics for each device object

parent a3d99d73
No related branches found
No related tags found
No related merge requests found
......@@ -69,8 +69,6 @@ void HokuyoLaserUnit::onInitComponent()
device.connected = false;
device.componentName = getName();
device.scanTopic = topic;
device.robotHealthTopic = robotHealthTopic;
}
catch (std::exception const& ex)
{
......@@ -115,6 +113,9 @@ void HokuyoLaserUnit::onConnectComponent()
info.stepSize = (info.maxAngle - info.minAngle) / (maxStep - minStep);
device.lengthData.resize(lengthDataSize);
device.scanTopic = topic;
device.robotHealthTopic = robotHealthTopic;
connectedDevices.push_back(info);
ARMARX_INFO << "Connected to " << device.ip << ", " << info.frame << ", "
......@@ -243,13 +244,27 @@ void HokuyoLaserScanDevice::run()
errorCounter = 0;
scanTopic->reportSensorValues(ip, frame, scan, now);
if (scanTopic)
{
scanTopic->reportSensorValues(ip, frame, scan, now);
}
else
{
ARMARX_WARNING << "No scan topic available: IP: " << ip << ", Port: " << port;
}
IceUtil::Time time_topicSensor = TimeUtil::GetTime();
RobotHealthHeartbeatArgs args;
args.maximumCycleTimeWarningMS = 500;
args.maximumCycleTimeErrorMS = 800;
robotHealthTopic->heartbeat(componentName + "_" + ip, args);
if (robotHealthTopic)
{
robotHealthTopic->heartbeat(componentName + "_" + ip, args);
}
else
{
ARMARX_WARNING << "No robot health topic available: IP: " << ip << ", Port: " << port;
}
IceUtil::Time time_topicHeartbeat = TimeUtil::GetTime();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment