Skip to content
Snippets Groups Projects
Commit 92ce1a77 authored by Johann Mantel's avatar Johann Mantel
Browse files

code formatting

parent eeda820d
No related branches found
No related tags found
No related merge requests found
......@@ -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
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