|
From: <rob...@us...> - 2008-10-02 06:40:24
|
Revision: 4921
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4921&view=rev
Author: rob_wheeler
Date: 2008-10-02 06:40:19 +0000 (Thu, 02 Oct 2008)
Log Message:
-----------
Allow unprogrammed boards to be used by pr2_etherCAT
Modified Paths:
--------------
pkg/trunk/drivers/motor/ethercat_hardware/include/ethercat_hardware/ethercat_hardware.h
pkg/trunk/drivers/motor/ethercat_hardware/src/ethercat_hardware.cpp
pkg/trunk/robot_control_loops/pr2_etherCAT/src/main.cpp
Modified: pkg/trunk/drivers/motor/ethercat_hardware/include/ethercat_hardware/ethercat_hardware.h
===================================================================
--- pkg/trunk/drivers/motor/ethercat_hardware/include/ethercat_hardware/ethercat_hardware.h 2008-10-02 06:29:26 UTC (rev 4920)
+++ pkg/trunk/drivers/motor/ethercat_hardware/include/ethercat_hardware/ethercat_hardware.h 2008-10-02 06:40:19 UTC (rev 4921)
@@ -69,7 +69,7 @@
/*!
* \brief Initialize the EtherCAT Master Library.
*/
- void init(char *interface);
+ void init(char *interface, bool allow_unprogrammed);
/*!
* \brief Register actuators with mechanism control
Modified: pkg/trunk/drivers/motor/ethercat_hardware/src/ethercat_hardware.cpp
===================================================================
--- pkg/trunk/drivers/motor/ethercat_hardware/src/ethercat_hardware.cpp 2008-10-02 06:29:26 UTC (rev 4920)
+++ pkg/trunk/drivers/motor/ethercat_hardware/src/ethercat_hardware.cpp 2008-10-02 06:40:19 UTC (rev 4921)
@@ -70,7 +70,7 @@
return double(n.tv_nsec) / NSEC_PER_SEC + n.tv_sec;
}
-void EthercatHardware::init(char *interface)
+void EthercatHardware::init(char *interface, bool allow_unprogrammed)
{
ros::node *node = ros::node::instance();
@@ -137,7 +137,7 @@
for (unsigned int slave = 0, a = 0; slave < num_slaves_; ++slave)
{
- if (slaves_[slave]->initialize(hw_->actuators_[a]) < 0)
+ if (slaves_[slave]->initialize(hw_->actuators_[a], allow_unprogrammed) < 0)
{
node->log(ros::FATAL, "Unable to initialize slave #%d", slave);
}
Modified: pkg/trunk/robot_control_loops/pr2_etherCAT/src/main.cpp
===================================================================
--- pkg/trunk/robot_control_loops/pr2_etherCAT/src/main.cpp 2008-10-02 06:29:26 UTC (rev 4920)
+++ pkg/trunk/robot_control_loops/pr2_etherCAT/src/main.cpp 2008-10-02 06:40:19 UTC (rev 4921)
@@ -53,6 +53,7 @@
char *interface_;
char *xml_;
bool allow_override_;
+ bool allow_unprogrammed_;
bool quiet_;
} g_options;
@@ -136,7 +137,7 @@
// Initialize the hardware interface
EthercatHardware ec;
- ec.init(g_options.interface_);
+ ec.init(g_options.interface_, g_options.allow_unprogrammed_);
// Create mechanism control
MechanismControl mc(ec.hw_);
@@ -281,6 +282,7 @@
static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
{"allow_override", no_argument, 0, 'a'},
+ {"allow_unprogrammed", no_argument, 0, 'u'},
{"quiet", no_argument, 0, 'q'},
{"interface", required_argument, 0, 'i'},
{"xml", required_argument, 0, 'x'},
@@ -296,6 +298,9 @@
case 'a':
g_options.allow_override_ = 1;
break;
+ case 'u':
+ g_options.allow_unprogrammed_ = 1;
+ break;
case 'q':
g_options.quiet_ = 1;
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|