Revision: 7755
http://playerstage.svn.sourceforge.net/playerstage/?rev=7755&view=rev
Author: natepak
Date: 2009-06-02 17:40:26 +0000 (Tue, 02 Jun 2009)
Log Message:
-----------
Merged in changes from trunk to this branch
Modified Paths:
--------------
code/gazebo/branches/threads/cmake/SearchForStuff.cmake
code/gazebo/branches/threads/player/CMakeLists.txt
code/gazebo/branches/threads/server/controllers/Controller.cc
code/gazebo/branches/threads/server/controllers/Controller.hh
code/gazebo/branches/threads/server/controllers/actarray/bandit/Bandit_Actarray.cc
code/gazebo/branches/threads/server/controllers/actarray/generic/Generic_Actarray.cc
code/gazebo/branches/threads/server/controllers/audio/Audio.cc
code/gazebo/branches/threads/server/controllers/bumper/generic/Generic_Bumper.cc
code/gazebo/branches/threads/server/controllers/camera/generic/Generic_Camera.cc
code/gazebo/branches/threads/server/controllers/camera/stereo/Stereo_Camera.cc
code/gazebo/branches/threads/server/controllers/factory/Factory.cc
code/gazebo/branches/threads/server/controllers/gripper/pioneer2/Pioneer2_Gripper.cc
code/gazebo/branches/threads/server/controllers/imu/Generic_Imu.cc
code/gazebo/branches/threads/server/controllers/irarray/IR_Array.cc
code/gazebo/branches/threads/server/controllers/laser/sicklms200/SickLMS200_Laser.cc
code/gazebo/branches/threads/server/controllers/opaque/jointforce/JointForce.cc
code/gazebo/branches/threads/server/controllers/position2d/differential/Differential_Position2d.cc
code/gazebo/branches/threads/server/controllers/position2d/holonome3sw/Holonome3Sw_Position2d.cc
code/gazebo/branches/threads/server/controllers/position2d/steering/Steering_Position2d.cc
code/gazebo/branches/threads/server/controllers/ptz/generic/Generic_PTZ.cc
Property Changed:
----------------
code/gazebo/branches/threads/
code/gazebo/branches/threads/cmake/libgazebo_pkgconfig.cmake
Property changes on: code/gazebo/branches/threads
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/federation/gazebo:7371-7550
/code/gazebo/branches/ogre-1.4.9:7137-7636
/code/gazebo/trunk:7723-7744
+ /code/branches/federation/gazebo:7371-7550
/code/gazebo/branches/ogre-1.4.9:7137-7636
/code/gazebo/trunk:7723-7753
Modified: code/gazebo/branches/threads/cmake/SearchForStuff.cmake
===================================================================
--- code/gazebo/branches/threads/cmake/SearchForStuff.cmake 2009-06-02
17:32:16 UTC (rev 7754)
+++ code/gazebo/branches/threads/cmake/SearchForStuff.cmake 2009-06-02
17:40:26 UTC (rev 7755)
@@ -283,6 +283,7 @@
IF (NOT LIBAVFORMAT_PATH)
MESSAGE (STATUS "Looking for avformat.h - not found")
MESSAGE (STATUS " Warning: audio/video will not be built")
+ SET (LIBAVFORMAT_PATH /usr/include)
ELSE (NOT LIBAVFORMAT_PATH)
MESSAGE (STATUS "Looking for avformat.h - found")
ENDIF (NOT LIBAVFORMAT_PATH)
@@ -291,6 +292,7 @@
IF (NOT LIBAVCODEC_PATH)
MESSAGE (STATUS "Looking for avcodec.h - not found")
MESSAGE (STATUS " Warning: audio/video will not be built")
+ SET (LIBAVCODEC_PATH /usr/include)
ELSE (NOT LIBAVCODEC_PATH)
MESSAGE (STATUS "Looking for avcodec.h - found")
ENDIF (NOT LIBAVCODEC_PATH)
Property changes on:
code/gazebo/branches/threads/cmake/libgazebo_pkgconfig.cmake
___________________________________________________________________
Modified: svn:mergeinfo
-
/code/branches/federation/gazebo/cmake/libgazeboshm_pkgconfig.cmake:7371-7550
/code/gazebo/branches/ogre-1.4.9/cmake/libgazeboshm_pkgconfig.cmake:7137-7636
/code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake:7723-7744
+
/code/branches/federation/gazebo/cmake/libgazeboshm_pkgconfig.cmake:7371-7550
/code/gazebo/branches/ogre-1.4.9/cmake/libgazeboshm_pkgconfig.cmake:7137-7636
/code/gazebo/trunk/cmake/libgazebo_pkgconfig.cmake:7723-7753
Modified: code/gazebo/branches/threads/player/CMakeLists.txt
===================================================================
--- code/gazebo/branches/threads/player/CMakeLists.txt 2009-06-02 17:32:16 UTC
(rev 7754)
+++ code/gazebo/branches/threads/player/CMakeLists.txt 2009-06-02 17:40:26 UTC
(rev 7755)
@@ -23,7 +23,7 @@
${boost_include_dirs}
)
-LINK_DIRECTORIES( ${PLAYER_LINK_DIRS} gazeboshm)
+LINK_DIRECTORIES( ${PLAYER_LINK_DIRS} ${boost_library_dirs} gazeboshm)
ADD_LIBRARY(gazeboplugin SHARED ${gazeboplugin_sources})
TARGET_LINK_LIBRARIES(gazeboplugin ${PLAYER_LINK_LIBS} gazeboshm )
Modified: code/gazebo/branches/threads/server/controllers/Controller.cc
===================================================================
--- code/gazebo/branches/threads/server/controllers/Controller.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++ code/gazebo/branches/threads/server/controllers/Controller.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -103,9 +103,6 @@
// Get the name of the iface
std::string ifaceName = childNode->GetString("name","",1);
- this->ifaceTypes.push_back(ifaceType);
- this->ifaceNames.push_back(ifaceName);
-
try
{
// Use the factory to get a new iface based on the type
@@ -155,19 +152,16 @@
/// Save the controller.
void Controller::Save(std::string &prefix, std::ostream &stream)
{
- std::vector<std::string>::iterator iter1;
- std::vector<std::string>::iterator iter2;
+ std::vector<Iface*>::iterator iter;
stream << prefix << "<controller:" << this->typeName << " name=\"" <<
this->nameP->GetValue() << "\">\n";
stream << prefix << " " << *(this->updatePeriodP) << "\n";
// Ouptut the interfaces
- for (iter1 = this->ifaceTypes.begin(), iter2=this->ifaceNames.begin();
- iter1 != this->ifaceTypes.end() && iter2 != this->ifaceNames.end();
- iter1++, iter2++)
+ for (iter = this->ifaces.begin(); iter != this->ifaces.end(); iter++)
{
- stream << prefix << " <interface:" << *(iter1) << " name=\"" << *(iter2)
<< "\"/>\n";
+ stream << prefix << " <interface:" << (*iter)->GetType() << " name=\"" <<
(*iter)->GetId() << "\"/>\n";
}
std::string p = prefix + " ";
@@ -256,3 +250,31 @@
{
return this->nameP->GetValue();
}
+
+////////////////////////////////////////////////////////////////////////////////
+// Get a interface of the controller
+Iface* Controller::GetIface(std::string type, bool mandatory, int number)
+{
+ std::vector<Iface*>::iterator iter;
+ int order = number;
+ Iface *iface = NULL;
+
+ for (iter = this->ifaces.begin(); iter != this->ifaces.end(); iter++)
+ {
+ if ((*iter)->GetType() == type)
+ {
+ if (order == 0)
+ iface = (*iter);
+ else
+ order --;
+ }
+ }
+
+ if ((iface == NULL) and mandatory)
+ {
+ std::ostringstream stream;
+ stream << "Controller " << this->GetName() << "trying to get " << type <<
" interface but it is not defined";
+ gzthrow(stream.str());
+ }
+ return iface;
+}
\ No newline at end of file
Modified: code/gazebo/branches/threads/server/controllers/Controller.hh
===================================================================
--- code/gazebo/branches/threads/server/controllers/Controller.hh
2009-06-02 17:32:16 UTC (rev 7754)
+++ code/gazebo/branches/threads/server/controllers/Controller.hh
2009-06-02 17:40:26 UTC (rev 7755)
@@ -98,14 +98,20 @@
/// \brief Return the name of this controller
/// \return The name of the controller
public: std::string GetName() const;
-
+
+ /// \brief Return Iface by type
+ /// \param type The type of the iface to retrieve
+ /// \param number If several ifaces of the same type present, which one
+ /// \return Iface, or exception if not found.
+ protected: Iface* GetIface(std::string type, bool mandatory=true, int
number=0);
+
/// \brief The controller's name
protected: ParamT<std::string> *nameP;
/// \brief The entity that owns this controller
protected: Entity *parent;
- /// \breif flag to keep controllers updating continuously
+ /// \brief flag to keep controllers updating continuously
protected: ParamT<bool> *alwaysOnP;
/// \brief Update period
@@ -118,11 +124,8 @@
protected: double lastUpdate;
/// \brief Array of all the iface for this controller
- protected: std::vector<Iface*> ifaces;
+ private: std::vector<Iface*> ifaces;
- private: std::vector< std::string > ifaceTypes;
- private: std::vector< std::string > ifaceNames;
-
protected: std::vector<Param*> parameters;
};
Modified:
code/gazebo/branches/threads/server/controllers/actarray/bandit/Bandit_Actarray.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/actarray/bandit/Bandit_Actarray.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/actarray/bandit/Bandit_Actarray.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -77,12 +77,8 @@
{
XMLConfigNode *jNode;
int i =0;
- this->myIface = dynamic_cast<ActarrayIface*>(this->ifaces[0]);
+ this->myIface = dynamic_cast<ActarrayIface*>(this->GetIface("actarray"));
- if (!this->myIface)
- gzthrow("Bandit_Actarray controller requires a Actarray Iface");
-
-
Param::Begin(&this->parameters);
for (i=0, jNode = node->GetChild("joint"); jNode; i++)
{
Modified:
code/gazebo/branches/threads/server/controllers/actarray/generic/Generic_Actarray.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/actarray/generic/Generic_Actarray.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/actarray/generic/Generic_Actarray.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -73,11 +73,8 @@
void Generic_Actarray::LoadChild(XMLConfigNode *node)
{
XMLConfigNode *jNode;
- this->myIface = dynamic_cast<ActarrayIface*>(this->ifaces[0]);
+ this->myIface = dynamic_cast<ActarrayIface*>(this->GetIface("actarray"));
- if (!this->myIface)
- gzthrow("Generic_Actarray controller requires a Actarray Iface");
-
for (n_joints=0, jNode = node->GetChild("joint"); jNode; n_joints++, jNode =
jNode->GetNext("joint"))
{
}
Modified: code/gazebo/branches/threads/server/controllers/audio/Audio.cc
===================================================================
--- code/gazebo/branches/threads/server/controllers/audio/Audio.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++ code/gazebo/branches/threads/server/controllers/audio/Audio.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -66,11 +66,7 @@
// Load the controller
void AudioController::LoadChild(XMLConfigNode *node)
{
- this->audioIface = dynamic_cast<AudioIface*>(this->ifaces[0]);
-
- if (!this->audioIface)
- gzthrow("Audio controller requires an audio interface");
-
+ this->audioIface = dynamic_cast<AudioIface*>(this->GetIface("audio"));
this->openALSource = OpenAL::Instance()->CreateSource( node );
}
Modified:
code/gazebo/branches/threads/server/controllers/bumper/generic/Generic_Bumper.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/bumper/generic/Generic_Bumper.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/bumper/generic/Generic_Bumper.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -59,12 +59,7 @@
// Load the controller
void Generic_Bumper::LoadChild(XMLConfigNode *node)
{
- this->myIface = dynamic_cast<BumperIface*>(this->ifaces[0]);
-
- if (!this->myIface)
- {
- gzthrow("Generic_Bumper controller requires an BumperIface");
- }
+ this->myIface = dynamic_cast<BumperIface*>(this->GetIface("bumper"));
}
////////////////////////////////////////////////////////////////////////////////
Modified:
code/gazebo/branches/threads/server/controllers/camera/generic/Generic_Camera.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/camera/generic/Generic_Camera.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/camera/generic/Generic_Camera.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -63,10 +63,7 @@
// Load the controller
void Generic_Camera::LoadChild(XMLConfigNode *node)
{
- this->cameraIface = dynamic_cast<CameraIface*>(this->ifaces[0]);
-
- if (!this->cameraIface)
- gzthrow("Generic_Camera controller requires a CameraIface");
+ this->cameraIface = dynamic_cast<CameraIface*>(this->GetIface("camera"));
}
////////////////////////////////////////////////////////////////////////////////
Modified:
code/gazebo/branches/threads/server/controllers/camera/stereo/Stereo_Camera.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/camera/stereo/Stereo_Camera.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/camera/stereo/Stereo_Camera.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -70,24 +70,17 @@
// Load the controller
void Stereo_Camera::LoadChild(XMLConfigNode *node)
{
- std::vector<Iface*>::iterator iter;
+ CameraIface *ciface = NULL;
- for (iter = this->ifaces.begin(); iter != this->ifaces.end(); iter++)
- {
- if ((*iter)->GetType() == "stereo")
- this->stereoIface = dynamic_cast<StereoCameraIface*>(*iter);
- else if ((*iter)->GetType() == "camera")
- {
- CameraIface *ciface = dynamic_cast<CameraIface*>(*iter);
- this->cameraIfaces[ciface->GetId()] = ciface;
- }
- }
+ this->stereoIface =
dynamic_cast<StereoCameraIface*>(this->GetIface("stereo"));
+ ciface = dynamic_cast<CameraIface*>(this->GetIface("camera",true,0));
+ this->cameraIfaces[ciface->GetId()] = ciface;
+ ciface = dynamic_cast<CameraIface*>(this->GetIface("camera",true,1));
+ this->cameraIfaces[ciface->GetId()] = ciface;
+
this->leftCameraNameP->Load(node);
this->rightCameraNameP->Load(node);
-
- if (!this->stereoIface)
- gzthrow("Stereo_Camera controller requires a StereoCameraIface");
}
////////////////////////////////////////////////////////////////////////////////
Modified: code/gazebo/branches/threads/server/controllers/factory/Factory.cc
===================================================================
--- code/gazebo/branches/threads/server/controllers/factory/Factory.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++ code/gazebo/branches/threads/server/controllers/factory/Factory.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -66,10 +66,7 @@
// Load the controller
void Factory::LoadChild(XMLConfigNode *node)
{
- this->factoryIface = dynamic_cast<FactoryIface*>(this->ifaces[0]);
-
- if (!this->factoryIface)
- gzthrow("Factory controller requires a factoryIface");
+ this->factoryIface = dynamic_cast<FactoryIface*>(this->GetIface("factory"));
}
////////////////////////////////////////////////////////////////////////////////
Modified:
code/gazebo/branches/threads/server/controllers/gripper/pioneer2/Pioneer2_Gripper.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/gripper/pioneer2/Pioneer2_Gripper.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/gripper/pioneer2/Pioneer2_Gripper.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -100,23 +100,9 @@
void Pioneer2_Gripper::LoadChild(XMLConfigNode *node)
{
XMLConfigNode *jNode;
- this->gripIface = dynamic_cast<GripperIface*>(this->ifaces[0]);
+ this->gripIface = dynamic_cast<GripperIface*>(this->GetIface("gripper"));
+ this->actIface = dynamic_cast<ActarrayIface*>(this->GetIface("actarray"));
- if (!this->gripIface)
- {
- this->gripIface = dynamic_cast<GripperIface*>(this->ifaces[1]);
- if (!this->gripIface)
- gzthrow("Pioneer2_Gripper controller requires a GripperIface");
- }
-
- this->actIface = dynamic_cast<ActarrayIface*>(this->ifaces[1]);
- if (!this->actIface)
- {
- this->actIface = dynamic_cast<ActarrayIface*>(this->ifaces[0]);
- if (!this->actIface)
- gzthrow("Pioneer2_Gripper controller requires an ActarrayIface");
- }
-
Param::Begin(&this->parameters);
jNode = node->GetChild("leftJoint");
if (jNode)
Modified: code/gazebo/branches/threads/server/controllers/imu/Generic_Imu.cc
===================================================================
--- code/gazebo/branches/threads/server/controllers/imu/Generic_Imu.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++ code/gazebo/branches/threads/server/controllers/imu/Generic_Imu.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -64,16 +64,7 @@
// Load the controller
void Generic_Imu::LoadChild(XMLConfigNode *node)
{
- std::vector<Iface*>::iterator iter;
-
- for (iter = this->ifaces.begin(); iter != this->ifaces.end(); iter++)
- {
- if ((*iter)->GetType() == "imu")
- this->imuIface = dynamic_cast<ImuIface*>(*iter);
- }
-
- if (!this->imuIface) gzthrow("GenericImu controller requires a ImuIface");
-
+ this->imuIface = dynamic_cast<ImuIface*>(this->GetIface("imu"));
}
////////////////////////////////////////////////////////////////////////////////
Modified: code/gazebo/branches/threads/server/controllers/irarray/IR_Array.cc
===================================================================
--- code/gazebo/branches/threads/server/controllers/irarray/IR_Array.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++ code/gazebo/branches/threads/server/controllers/irarray/IR_Array.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -68,16 +68,7 @@
// Load the controller
void IR_Array::LoadChild(XMLConfigNode *node)
{
- std::vector<Iface*>::iterator iter;
-
- for (iter = this->ifaces.begin(); iter != this->ifaces.end(); iter++)
- {
- if ((*iter)->GetType() == "irarray")
- this->irIface = dynamic_cast<IRIface*>(*iter);
- }
-
- if (!this->irIface) gzthrow("IR_Array controller requires a IRIface");
-
+ this->irIface = dynamic_cast<IRIface*>(this->GetIface("irarray"));
}
////////////////////////////////////////////////////////////////////////////////
Modified:
code/gazebo/branches/threads/server/controllers/laser/sicklms200/SickLMS200_Laser.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/laser/sicklms200/SickLMS200_Laser.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/laser/sicklms200/SickLMS200_Laser.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -68,18 +68,8 @@
// Load the controller
void SickLMS200_Laser::LoadChild(XMLConfigNode *node)
{
- std::vector<Iface*>::iterator iter;
-
- for (iter = this->ifaces.begin(); iter != this->ifaces.end(); iter++)
- {
- if ((*iter)->GetType() == "laser")
- this->laserIface = dynamic_cast<LaserIface*>(*iter);
- else if ((*iter)->GetType() == "fiducial")
- this->fiducialIface = dynamic_cast<FiducialIface*>(*iter);
- }
-
- if (!this->laserIface) gzthrow("SickLMS200_Laser controller requires a
LaserIface");
-
+ this->laserIface = dynamic_cast<LaserIface*>(this->GetIface("laser"));
+ this->fiducialIface =
dynamic_cast<FiducialIface*>(this->GetIface("fiducial", false));
}
////////////////////////////////////////////////////////////////////////////////
Modified:
code/gazebo/branches/threads/server/controllers/opaque/jointforce/JointForce.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/opaque/jointforce/JointForce.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/opaque/jointforce/JointForce.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -64,10 +64,7 @@
std::string jointName;
dJointFeedback *jFeedback = new dJointFeedback;
int i =0;
- this->myIface = dynamic_cast<OpaqueIface*>(this->ifaces[0]);
- if (!this->myIface) {
- gzthrow("JointForce controller requires an OpaqueIface");
- }
+ this->myIface = dynamic_cast<OpaqueIface*>(this->GetIface("opaque"));
jNode = node->GetChild("joint");
while(jNode && i < GAZEBO_JOINTFORCE_CONTROLLER_MAX_FEEDBACKS)
{
Modified:
code/gazebo/branches/threads/server/controllers/position2d/differential/Differential_Position2d.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/position2d/differential/Differential_Position2d.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/position2d/differential/Differential_Position2d.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -84,11 +84,8 @@
// Load the controller
void Differential_Position2d::LoadChild(XMLConfigNode *node)
{
- this->myIface = dynamic_cast<PositionIface*>(this->ifaces[0]);
+ this->myIface = dynamic_cast<PositionIface*>(this->GetIface("position"));
- if (!this->myIface)
- gzthrow("Differential_Position2d controller requires a PositionIface");
-
// the defaults are from pioneer2dx
this->wheelSepP->Load(node);
this->wheelDiamP->Load(node);
Modified:
code/gazebo/branches/threads/server/controllers/position2d/holonome3sw/Holonome3Sw_Position2d.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/position2d/holonome3sw/Holonome3Sw_Position2d.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/position2d/holonome3sw/Holonome3Sw_Position2d.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -65,11 +65,8 @@
// Load the controller
void Holonome3Sw_Position2d::LoadChild(XMLConfigNode *node)
{
- this->myIface = dynamic_cast<PositionIface*>(this->ifaces[0]);
+ this->myIface = dynamic_cast<PositionIface*>(this->GetIface("position"));
- if (!this->myIface)
- gzthrow("Holonome3Sw_Position2d controller requires a PositionIface");
-
// Get wheels child
node = node->GetChild("wheels");
if (!node)
Modified:
code/gazebo/branches/threads/server/controllers/position2d/steering/Steering_Position2d.cc
===================================================================
---
code/gazebo/branches/threads/server/controllers/position2d/steering/Steering_Position2d.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++
code/gazebo/branches/threads/server/controllers/position2d/steering/Steering_Position2d.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -83,12 +83,8 @@
float defaultMaxAngle;
- this->myIface = dynamic_cast<PositionIface*>(this->ifaces[0]);
+ this->myIface = dynamic_cast<PositionIface*>(this->GetIface("position"));
- if (!this->myIface)
- gzthrow("Steering_Position2d controller requires a PositionIface");
-
-
//general
defaultTorque = node->GetFloat("torque", 1000, 0);
Modified:
code/gazebo/branches/threads/server/controllers/ptz/generic/Generic_PTZ.cc
===================================================================
--- code/gazebo/branches/threads/server/controllers/ptz/generic/Generic_PTZ.cc
2009-06-02 17:32:16 UTC (rev 7754)
+++ code/gazebo/branches/threads/server/controllers/ptz/generic/Generic_PTZ.cc
2009-06-02 17:40:26 UTC (rev 7755)
@@ -88,11 +88,8 @@
// Load the controller
void Generic_PTZ::LoadChild(XMLConfigNode *node)
{
- this->ptzIface = dynamic_cast<PTZIface*>(this->ifaces[0]);
+ this->ptzIface = dynamic_cast<PTZIface*>(this->GetIface("ptz"));
- if (!this->ptzIface)
- gzthrow("Generic_PTZ controller requires a PTZIface");
-
this->panJointNameP->Load(node);
this->tiltJointNameP->Load(node);
this->motionGainP->Load(node);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit