|
From: <jl...@us...> - 2008-04-21 21:46:26
|
Revision: 148
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=148&view=rev
Author: jleibs
Date: 2008-04-21 14:46:26 -0700 (Mon, 21 Apr 2008)
Log Message:
-----------
Added ROS parameter for port.
Modified Paths:
--------------
pkg/trunk/hokuyourg_player/hokuyourg_player.cc
Modified: pkg/trunk/hokuyourg_player/hokuyourg_player.cc
===================================================================
--- pkg/trunk/hokuyourg_player/hokuyourg_player.cc 2008-04-21 21:44:30 UTC (rev 147)
+++ pkg/trunk/hokuyourg_player/hokuyourg_player.cc 2008-04-21 21:46:26 UTC (rev 148)
@@ -25,6 +25,9 @@
HokuyoNode() : ROS_Slave()
{
+ register_source(fl = new FlowLaserScan("scans"));
+
+
// libplayercore boiler plate
player_globals_init();
itable_init();
@@ -50,8 +53,15 @@
this->cf->InsertFieldValue(0,"unit_angle","degrees");
this->cf->InsertFieldValue(0,"min_angle","-90");
this->cf->InsertFieldValue(0,"max_angle","90");
- this->cf->InsertFieldValue(0,"port","/dev/ttyACM0");
+ string port;
+ if (!get_string_param(".port", port))
+ port = "/dev/ttyACM0";
+
+ printf("Setting port to: %s\n",port.c_str());
+
+ this->cf->InsertFieldValue(0,"port",port.c_str());
+
// Create an instance of the driver, passing it the ConfigFile object.
// The -1 tells it to look into the "global" section of the ConfigFile,
// which is where ConfigFile::InsertFieldValue() put the parameters.
@@ -68,7 +78,6 @@
// Create a message queue
this->q = QueuePointer(false,PLAYER_QUEUE_LEN);
- this->register_source(this->fl = new FlowLaserScan("scans"));
}
~HokuyoNode()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|