|
From: <stu...@us...> - 2009-02-26 00:23:12
|
Revision: 11764
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=11764&view=rev
Author: stuglaser
Date: 2009-02-25 22:11:14 +0000 (Wed, 25 Feb 2009)
Log Message:
-----------
Changed xacro to report file include errors better.
Modified Paths:
--------------
pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
pkg/trunk/prcore/xacro/xacro.py
Modified: pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2009-02-25 21:59:11 UTC (rev 11763)
+++ pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2009-02-25 22:11:14 UTC (rev 11764)
@@ -365,7 +365,7 @@
ROS_ERROR("Could spawn controller %s because controller type %s does not exist",
add_reqs[i].name.c_str(), add_reqs[i].type.c_str());
continue;
- }
+ }MONOTONIC
timespec init_start, init_end;
clock_gettime(CLOCK_REALTIME, &init_start);
bool initialized = c->initXmlRequest(state_, add_reqs[i].config, add_reqs[i].name);
@@ -403,11 +403,12 @@
}
// Success! Swaps in the new set of controllers.
+ int former_current_controllers_list_ = current_controllers_list_;
current_controllers_list_ = free_controllers_list;
clock_gettime(CLOCK_REALTIME, &end_time);
// Destroys the old controllers list when the realtime thread is finished with it.
- while (used_by_realtime_ != current_controllers_list_)
+ while (used_by_realtime_ == former_current_controllers_list_)
usleep(200);
from.clear();
Modified: pkg/trunk/prcore/xacro/xacro.py
===================================================================
--- pkg/trunk/prcore/xacro/xacro.py 2009-02-25 21:59:11 UTC (rev 11763)
+++ pkg/trunk/prcore/xacro/xacro.py 2009-02-25 22:11:14 UTC (rev 11764)
@@ -157,8 +157,12 @@
filename = os.path.join(base_dir, filename)
f = None
try:
- f = open(filename)
try:
+ f = open(filename)
+ except IOError, e:
+ print elt
+ raise XacroException("included file \"%s\" could not be opened: %s" % (filename, str(e)))
+ try:
included = parse(f)
except Exception, e:
raise XacroException("included file [%s] generated an error during XML parsing: %s"%(filename, str(e)))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|