|
From: <hsu...@us...> - 2008-09-18 16:24:50
|
Revision: 4448
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4448&view=rev
Author: hsujohnhsu
Date: 2008-09-18 23:24:59 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
fixed bug pre track ticket 318 in personal robots.
Modified Paths:
--------------
pkg/trunk/3rdparty/gazebo/gazebo_patch.diff
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Block_Laser.hh
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc
pkg/trunk/robot_descriptions/wg_robot_description/pr2/backup/pr2.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo_joints.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/transmissions.xml
Modified: pkg/trunk/3rdparty/gazebo/gazebo_patch.diff
===================================================================
--- pkg/trunk/3rdparty/gazebo/gazebo_patch.diff 2008-09-18 23:20:32 UTC (rev 4447)
+++ pkg/trunk/3rdparty/gazebo/gazebo_patch.diff 2008-09-18 23:24:59 UTC (rev 4448)
@@ -626,195 +626,155 @@
/// \}
}
#endif
-Index: server/sensors/ray/RayBlockSensor.cc
+Index: server/sensors/ray/RaySensor.hh
===================================================================
---- server/sensors/ray/RayBlockSensor.cc (revision 0)
-+++ server/sensors/ray/RayBlockSensor.cc (revision 0)
-@@ -0,0 +1,450 @@
-+/*
-+ * Gazebo - Outdoor Multi-Robot Simulator
-+ * Copyright (C) 2003
-+ * Nate Koenig & Andrew Howard
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ *
-+ */
-+/* Desc: Ray proximity sensor
-+ * Author: Carle Cote
-+ * Date: 23 february 2004
-+ * SVN: $Id: RayBlockSensor.cc 7000 2008-09-01 18:56:47Z natepak $
-+*/
+--- server/sensors/ray/RaySensor.hh (revision 7023)
++++ server/sensors/ray/RaySensor.hh (working copy)
+@@ -100,6 +100,22 @@
+ /// \return The number of ranges
+ public: int GetRangeCount() const;
+
++ /// \brief Get the vertical scan line count
++ /// \return The number of scan lines vertically
++ public: int GetVerticalRayCount() const;
+
-+#include <assert.h>
-+#include <float.h>
-+#include <sstream>
++ /// \brief Get the vertical scan line count
++ /// \return The number of scan lines vertically
++ public: int GetVerticalRangeCount() const;
+
-+#include "SensorFactory.hh"
-+#include "XMLConfig.hh"
-+#include "Global.hh"
-+#include "RayGeom.hh"
-+#include "World.hh"
-+#include "PhysicsEngine.hh"
-+#include "GazeboError.hh"
-+#include "ODEPhysics.hh"
-+#include "XMLConfig.hh"
-+#include "Controller.hh"
-+#include "RayBlockSensor.hh"
++ /// \brief Get the vertical scan bottom angle
++ /// \return The minimum angle of the scan block
++ public: Angle GetVerticalMinAngle() const;
+
-+#include "Vector3.hh"
++ /// \brief Get the vertical scan line top angle
++ /// \return The Maximum angle of the scan block
++ public: Angle GetVerticalMaxAngle() const;
+
-+using namespace gazebo;
+ /// \brief Set ray parameters
+ /// \param index Rayindex (from 0 to rayCount - 1).
+ /// \param a, b Ray endpoints (initial and final points). These are
+@@ -142,6 +158,11 @@
+ /// Display rays when rendering images
+ private: ParamT<bool> *displayRaysP;
+
++ // For ray blocks such as Velodyne
++ private: ParamT<int> *verticalRayCountP;
++ private: ParamT<int> *verticalRangeCountP;
++ private: ParamT<Angle> *verticalMinAngleP;
++ private: ParamT<Angle> *verticalMaxAngleP;
+ };
+ /// \}
+ /// \}
+Index: server/sensors/ray/SConscript
+===================================================================
+--- server/sensors/ray/SConscript (revision 7023)
++++ server/sensors/ray/SConscript (working copy)
+@@ -1,7 +1,7 @@
+ #Import variable
+ Import('env sharedObjs')
+
+-sources = Split('RaySensor.cc')
++sources = Split('RaySensor.cc RayBlockSensor.cc')
+
+ #staticObjs.append(env.StaticObject(sources))
+ sharedObjs.append(env.SharedObject(sources))
+Index: server/sensors/ray/RaySensor.cc
+===================================================================
+--- server/sensors/ray/RaySensor.cc (revision 7023)
++++ server/sensors/ray/RaySensor.cc (working copy)
+@@ -64,6 +64,12 @@
+ this->maxRangeP = new ParamT<double>("maxRange",0,1);
+ this->originP = new ParamT<Vector3>("origin", Vector3(0,0,0), 0);
+ this->displayRaysP = new ParamT<bool>("displayRays", true, 0);
+
-+GZ_REGISTER_STATIC_SENSOR("ray_block", RayBlockSensor);
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// Constructor
-+RayBlockSensor::RayBlockSensor(Body *body)
-+ : Sensor(body)
-+{
-+ this->active = false;
-+
-+ this->typeName = "ray";
-+
-+ Param::Begin(&this->parameters);
-+ this->rayCountP = new ParamT<int>("rayCount",0,1);
-+ this->rangeCountP = new ParamT<int>("rangeCount",0,1);
-+ this->minAngleP = new ParamT<Angle>("minAngle",DTOR(-90),1);
-+ this->maxAngleP = new ParamT<Angle>("maxAngle",DTOR(-90),1);
-+ this->minRangeP = new ParamT<double>("minRange",0,1);
-+ this->maxRangeP = new ParamT<double>("maxRange",0,1);
-+ this->originP = new ParamT<Vector3>("origin", Vector3(0,0,0), 0);
-+ this->displayRaysP = new ParamT<bool>("displayRays", true, 0);
-+
+ // for block rays, vertical setting
+ this->verticalRayCountP = new ParamT<int>("verticalRayCount", 1, 0);
+ this->verticalRangeCountP = new ParamT<int>("verticalRangeCount", 1, 0);
+ this->verticalMinAngleP = new ParamT<Angle>("verticalMinAngle", DTOR(0), 0);
+ this->verticalMaxAngleP = new ParamT<Angle>("verticalMaxAngle", DTOR(0), 0);
-+ Param::End();
-+}
+ Param::End();
+ }
+
+@@ -80,6 +86,11 @@
+ delete this->maxRangeP;
+ delete this->originP;
+ delete this->displayRaysP;
+
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// Destructor
-+RayBlockSensor::~RayBlockSensor()
-+{
-+ delete this->rayCountP;
-+ delete this->rangeCountP;
-+ delete this->minAngleP;
-+ delete this->maxAngleP;
-+ delete this->minRangeP;
-+ delete this->maxRangeP;
-+ delete this->originP;
-+ delete this->displayRaysP;
-+
+ delete this->verticalRayCountP;
+ delete this->verticalRangeCountP;
+ delete this->verticalMinAngleP;
+ delete this->verticalMaxAngleP;
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+/// Load the ray using parameter from an XMLConfig node
-+void RayBlockSensor::LoadChild(XMLConfigNode *node)
-+{
-+ if (this->body == NULL)
-+ {
-+ gzthrow("Null body in the ray sensor");
-+ }
-+
-+ this->rayCountP->Load(node);
-+ this->rangeCountP->Load(node);
-+ this->minAngleP->Load(node);
-+ this->maxAngleP->Load(node);
-+ this->minRangeP->Load(node);
-+ this->maxRangeP->Load(node);
-+ this->originP->Load(node);
-+ this->displayRaysP->Load(node);
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+@@ -99,6 +110,10 @@
+ this->maxRangeP->Load(node);
+ this->originP->Load(node);
+ this->displayRaysP->Load(node);
+ this->verticalRayCountP->Load(node);
+ this->verticalRangeCountP->Load(node);
+ this->verticalMinAngleP->Load(node);
+ this->verticalMaxAngleP->Load(node);
-+
-+
-+ // Create a space to contain the ray space
-+ this->superSpaceId = dSimpleSpaceCreate( 0 );
-+
-+ // Create a space to contain all the rays
-+ this->raySpaceId = dSimpleSpaceCreate( this->superSpaceId );
-+
-+ // Set collision bits
-+ dGeomSetCategoryBits((dGeomID) this->raySpaceId, GZ_LASER_COLLIDE);
-+ dGeomSetCollideBits((dGeomID) this->raySpaceId, ~GZ_LASER_COLLIDE);
-+
-+ //this->body->spaceId = this->superSpaceId;
-+ this->body->spaceId = this->raySpaceId;
-+
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+/// Save the sensor info in XML format
-+void RayBlockSensor::SaveChild(std::string &prefix, std::ostream &stream)
-+{
-+ stream << prefix << " " << *(this->minAngleP) << "\n";
-+ stream << prefix << " " << *(this->maxAngleP) << "\n";
-+ stream << prefix << " " << *(this->minRangeP) << "\n";
-+ stream << prefix << " " << *(this->maxRangeP) << "\n";
-+ stream << prefix << " " << *(this->originP) << "\n";
-+ stream << prefix << " " << *(this->rayCountP) << "\n";
-+ stream << prefix << " " << *(this->rangeCountP) << "\n";
-+ stream << prefix << " " << *(this->displayRaysP) << "\n";
+
+
+ // Create a space to contain the ray space
+@@ -128,6 +143,10 @@
+ stream << prefix << " " << *(this->rayCountP) << "\n";
+ stream << prefix << " " << *(this->rangeCountP) << "\n";
+ stream << prefix << " " << *(this->displayRaysP) << "\n";
+ stream << prefix << " " << *(this->verticalRayCountP) << "\n";
+ stream << prefix << " " << *(this->verticalRangeCountP) << "\n";
+ stream << prefix << " " << *(this->verticalMinAngleP) << "\n";
+ stream << prefix << " " << *(this->verticalMaxAngleP) << "\n";
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// Init the ray
-+void RayBlockSensor::InitChild()
-+{
-+ Pose3d bodyPose;
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+@@ -135,35 +154,42 @@
+ void RaySensor::InitChild()
+ {
+ Pose3d bodyPose;
+- double angle;
+ double yawAngle, pitchAngle;
-+ Vector3 start, end, axis;
-+ RayGeom *ray;
-+
-+ bodyPose = this->body->GetPose();
-+ this->prevPose = bodyPose;
-+
+ Vector3 start, end, axis;
+ RayGeom *ray;
+
+ bodyPose = this->body->GetPose();
+ this->prevPose = bodyPose;
+
+ double pDiff = (**(this->verticalMaxAngleP) - **(this->verticalMinAngleP)).GetAsRadian();
+ double yDiff = (**(this->maxAngleP) - **(this->minAngleP)).GetAsRadian();
-+ // Create and array of ray geoms
+ // Create and array of ray geoms
+- for (int i = 0; i < this->rayCountP->GetValue(); i++)
+- //for (int i = this->rayCount-1; i >= 0; i--)
+ for (int j = 0; j < this->verticalRayCountP->GetValue(); j++)
-+ {
-+
+ {
+- double diff = (**(this->maxAngleP) - **(this->minAngleP)).GetAsRadian();
+
+- angle = i * diff / (rayCountP->GetValue() - 1) + (**(this->minAngleP)).GetAsRadian();
+ for (int i = 0; i < this->rayCountP->GetValue(); i++)
+ //for (int i = this->rayCount-1; i >= 0; i--)
+ {
-+
-+ yawAngle = i * yDiff / (rayCountP->GetValue() - 1) + (**(this->minAngleP)).GetAsRadian();
-+
-+ pitchAngle = j * pDiff / (verticalRayCountP->GetValue() - 1) + (**(this->verticalMinAngleP)).GetAsRadian();
-+
+
+- axis.Set(cos(angle), sin(angle),0);
++ (rayCountP->GetValue() == 1)? 0 : yawAngle = i * yDiff / (rayCountP->GetValue() - 1) + (**(this->minAngleP)).GetAsRadian();
+
+- start = (axis * this->minRangeP->GetValue()) + this->originP->GetValue();
+- end = (axis * this->maxRangeP->GetValue()) + this->originP->GetValue();
++ (verticalRayCountP->GetValue() == 1)? 0 : pitchAngle = j * pDiff / (verticalRayCountP->GetValue() - 1) + (**(this->verticalMinAngleP)).GetAsRadian();
+
+- ray = new RayGeom(this->body, displayRaysP->GetValue());
+ axis.Set(cos(pitchAngle)*cos(yawAngle), sin(yawAngle),sin(pitchAngle)*cos(yawAngle));
-+
+
+- ray->SetPoints(start, end);
+-// ray->SetCategoryBits( GZ_LASER_COLLIDE );
+- //ray->SetCollideBits( ~GZ_LASER_COLLIDE );
+ start = (axis * this->minRangeP->GetValue()) + this->originP->GetValue();
+ end = (axis * this->maxRangeP->GetValue()) + this->originP->GetValue();
-+
+
+- this->rays.push_back(ray);
+ ray = new RayGeom(this->body, displayRaysP->GetValue());
-+
+
+- //this->body->AttachGeom(ray);
+ ray->SetPoints(start, end);
+ //ray->SetCategoryBits( GZ_LASER_COLLIDE );
+ //ray->SetCollideBits( ~GZ_LASER_COLLIDE );
@@ -823,453 +783,44 @@
+
+ //this->body->AttachGeom(ray);
+ }
-+ }
-+
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// Init the ray
-+void RayBlockSensor::FiniChild()
-+{
-+ std::vector<RayGeom*>::iterator iter;
-+ for (iter=this->rays.begin(); iter!=this->rays.end(); iter++)
-+ {
-+ delete *iter;
-+ }
-+ this->rays.clear();
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+/// Get the minimum angle
-+Angle RayBlockSensor::GetMinAngle() const
-+{
-+ return **(this->minAngleP);
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+/// Get the maximum angle
-+Angle RayBlockSensor::GetMaxAngle() const
-+{
-+ return **(this->maxAngleP);
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+/// Get the minimum range
-+double RayBlockSensor::GetMinRange() const
-+{
-+ return this->minRangeP->GetValue();
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+/// Get the maximum range
-+double RayBlockSensor::GetMaxRange() const
-+{
-+ return this->maxRangeP->GetValue();
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+/// Get the ray count
-+int RayBlockSensor::GetRayCount() const
-+{
-+ return this->rayCountP->GetValue();
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+/// Get the range count
-+int RayBlockSensor::GetRangeCount() const
-+{
-+ return this->rangeCountP->GetValue();
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
+ }
+
+ }
+@@ -223,6 +249,34 @@
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+/// Get the vertical scan line count
-+int RayBlockSensor::GetVerticalRayCount() const
++int RaySensor::GetVerticalRayCount() const
+{
+ return this->verticalRayCountP->GetValue();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+/// Get the vertical scan line count
-+int RayBlockSensor::GetVerticalRangeCount() const
++int RaySensor::GetVerticalRangeCount() const
+{
+ return this->verticalRangeCountP->GetValue();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+/// Get the vertical min angle
-+Angle RayBlockSensor::GetVerticalMinAngle() const
++Angle RaySensor::GetVerticalMinAngle() const
+{
+ return this->verticalMinAngleP->GetValue();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+/// Get the vertical max angle
-+Angle RayBlockSensor::GetVerticalMaxAngle() const
++Angle RaySensor::GetVerticalMaxAngle() const
+{
+ return this->verticalMaxAngleP->GetValue();
+}
+
+//////////////////////////////////////////////////////////////////////////////
-+// Get detected range for a ray
-+double RayBlockSensor::GetRange(int index)
-+{
-+ if (index < 0 || index >= (int)this->rays.size())
-+ {
-+ std::ostringstream stream;
-+ stream << "index[" << index << "] out of range[0-"
-+ << this->rays.size() << "]";
-+ gzthrow(stream.str());
-+ }
-+
-+ return this->rays[index]->GetLength();
-+}
-+
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// Get detected retro (intensity) value for a ray.
-+double RayBlockSensor::GetRetro(int index)
-+{
-+ if (index < 0 || index >= (int)this->rays.size())
-+ {
-+ std::ostringstream stream;
-+ stream << "index[" << index << "] out of range[0-"
-+ << this->rays.size() << "]";
-+ gzthrow(stream.str());
-+ }
-+
-+ return this->rays[index]->GetRetro();
-+}
-+
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// Get detected fiducial value for a ray.
-+int RayBlockSensor::GetFiducial(int index)
-+{
-+ if (index < 0 || index >= (int)this->rays.size())
-+ {
-+ std::ostringstream stream;
-+ stream << "index[" << index << "] out of range[0-"
-+ << this->rays.size() << "]";
-+ gzthrow(stream.str());
-+ }
-+
-+ return this->rays[index]->GetFiducial();
-+}
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// Update the sensor information
-+void RayBlockSensor::UpdateChild()
-+{
-+ if (this->active)
-+ {
-+ std::vector<RayGeom*>::iterator iter;
-+ Pose3d poseDelta;
-+ Vector3 a, b;
-+
-+ // Get the pose of the sensor body (global cs)
-+ poseDelta = this->body->GetPose() - this->prevPose;
-+ this->prevPose = this->body->GetPose();
-+
-+ // Reset the ray lengths and mark the geoms as dirty (so they get
-+ // redrawn)
-+ for (iter = this->rays.begin(); iter != this->rays.end(); iter++)
-+ {
-+ (*iter)->SetLength( this->maxRangeP->GetValue() );
-+ (*iter)->SetRetro( 0.0 );
-+ (*iter)->SetFiducial( -1 );
-+
-+ // Get the global points of the line
-+ (*iter)->Update();
-+ }
-+
-+ ODEPhysics *ode = dynamic_cast<ODEPhysics*>(World::Instance()->GetPhysicsEngine());
-+
-+ if (ode == NULL)
-+ {
-+ gzthrow( "Invalid physics engine. Must use ODE." );
-+ }
-+
-+ // Do collision detection
-+ dSpaceCollide2( ( dGeomID ) ( this->superSpaceId ),
-+ ( dGeomID ) ( ode->GetSpaceId() ),
-+ this, &UpdateCallback );
-+ }
-+}
-+
-+
-+
-+/////////////////////////////////////////////////////////////////////////////
-+// Callback for ray intersection test
-+void RayBlockSensor::UpdateCallback( void *data, dGeomID o1, dGeomID o2 )
-+{
-+ int n = 0;
-+ dContactGeom contact;
-+ dxGeom *geom1, *geom2 = NULL;
-+ RayGeom *rayGeom = NULL;
-+ Geom *hitGeom = NULL;
-+ RayBlockSensor *self = NULL;
-+
-+ self = (RayBlockSensor*) data;
-+
-+ // Check space
-+ if ( dGeomIsSpace( o1 ) || dGeomIsSpace( o2 ) )
-+ {
-+ if (dGeomGetSpace(o1) == self->superSpaceId || dGeomGetSpace(o2) == self->superSpaceId)
-+ {
-+ dSpaceCollide2( o1, o2, self, &UpdateCallback );
-+ }
-+ if (dGeomGetSpace(o1) == self->raySpaceId || dGeomGetSpace(o2) == self->raySpaceId)
-+ {
-+ dSpaceCollide2( o1, o2, self, &UpdateCallback );
-+ }
-+ }
-+ else
-+ {
-+ geom1 = NULL;
-+ geom2 = NULL;
-+
-+ // Get pointers to the underlying geoms
-+ if (dGeomGetClass(o1) == dGeomTransformClass)
-+ geom1 = (dxGeom*) dGeomGetData(dGeomTransformGetGeom(o1));
-+ else
-+ geom1 = (dxGeom*) dGeomGetData(o1);
-+
-+ if (dGeomGetClass(o2) == dGeomTransformClass)
-+ geom2 = (dxGeom*) dGeomGetData(dGeomTransformGetGeom(o2));
-+ else
-+ geom2 = (dxGeom*) dGeomGetData(o2);
-+
-+ assert(geom1 && geom2);
-+
-+ rayGeom = NULL;
-+ hitGeom = NULL;
-+
-+ // Figure out which one is a ray; note that this assumes
-+ // that the ODE dRayClass is used *soley* by the RayGeom.
-+ if (dGeomGetClass(o1) == dRayClass)
-+ {
-+ rayGeom = (RayGeom*) geom1;
-+ hitGeom = (Geom*) geom2;
-+ dGeomRaySetParams(o1, 0, 0);
-+ dGeomRaySetClosestHit(o1, 1);
-+ }
-+
-+ if (dGeomGetClass(o2) == dRayClass)
-+ {
-+ assert(rayGeom == NULL);
-+ rayGeom = (RayGeom*) geom2;
-+ hitGeom = (Geom* )geom1;
-+ dGeomRaySetParams(o2, 0, 0);
-+ dGeomRaySetClosestHit(o2, 1);
-+ }
-+
-+ // Check for ray/geom intersections
-+ if ( rayGeom && hitGeom )
-+ {
-+
-+ n = dCollide(o1, o2, 1, &contact, sizeof(contact));
-+
-+ if ( n > 0 )
-+ {
-+ if (contact.depth < rayGeom->GetLength())
-+ {
-+ rayGeom->SetLength( contact.depth );
-+ rayGeom->SetRetro( hitGeom->GetLaserRetro() );
-+ rayGeom->SetFiducial( hitGeom->GetLaserFiducialId() );
-+ }
-+ }
-+ }
-+ }
-+}
-Index: server/sensors/ray/SConscript
-===================================================================
---- server/sensors/ray/SConscript (revision 7023)
-+++ server/sensors/ray/SConscript (working copy)
-@@ -1,7 +1,7 @@
- #Import variable
- Import('env sharedObjs')
-
--sources = Split('RaySensor.cc')
-+sources = Split('RaySensor.cc RayBlockSensor.cc')
-
- #staticObjs.append(env.StaticObject(sources))
- sharedObjs.append(env.SharedObject(sources))
-Index: server/sensors/ray/RayBlockSensor.hh
-===================================================================
---- server/sensors/ray/RayBlockSensor.hh (revision 0)
-+++ server/sensors/ray/RayBlockSensor.hh (revision 0)
-@@ -0,0 +1,171 @@
-+/*
-+ * Gazebo - Outdoor Multi-Robot Simulator
-+ * Copyright (C) 2003
-+ * Nate Koenig & Andrew Howard
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ *
-+ */
-+/* Desc: RayBlockSensor proximity sensor
-+ * Author: Carle Cote
-+ * Date: 23 february 2004
-+ * SVN: $Id: RayBlockSensor.hh 7000 2008-09-01 18:56:47Z natepak $
-+*/
-+
-+#ifndef RAYBLOCKSENSOR_HH
-+#define RAYBLOCKSENSOR_HH
-+
-+#include <vector>
-+
-+#include "Angle.hh"
-+#include "Sensor.hh"
-+#include "Body.hh"
-+
-+namespace gazebo
-+{
-+
-+ class XMLConfigNode;
-+ class RayGeom;
-+/// \addtogroup gazebo_sensor
-+/// \brief Sensor with one or more rays.
-+/// \{
-+/// \defgroup gazebo_ray Ray
-+/// \brief Sensor with one or more rays.
-+// \{
-+
-+/// \brief Sensor with one or more rays.
-+///
-+/// This sensor cast rays into the world, tests for intersections, and
-+/// reports the range to the nearest object. It is used by ranging
-+/// sensor models (e.g., sonars and scanning laser range finders).
-+class RayBlockSensor: public Sensor
-+{
-+ /// \brief Constructor
-+ /// \param body The underlying collision test uses an ODE geom, so
-+ /// ray sensors must be attached to a body.
-+ public: RayBlockSensor(Body *body);
-+
-+ /// \brief Destructor
-+ public: virtual ~RayBlockSensor();
-+
-+ /// Load the ray using parameter from an XMLConfig node
-+ /// \param node The XMLConfig node
-+ protected: virtual void LoadChild(XMLConfigNode *node);
-+
-+ /// \brief Save the sensor info in XML format
-+ protected: virtual void SaveChild(std::string &prefix, std::ostream &stream);
-+
-+ /// Initialize the ray
-+ protected: virtual void InitChild();
-+
-+ /// Update sensed values
-+ protected: virtual void UpdateChild();
-+
-+ /// Finalize the ray
-+ protected: virtual void FiniChild();
-+
-+ /// \brief Get the minimum angle
-+ /// \return The minimum angle
-+ public: Angle GetMinAngle() const;
-+
-+ /// \brief Get the maximum angle
-+ /// \return the maximum angle
-+ public: Angle GetMaxAngle() const;
-+
-+ /// \brief Get the minimum range
-+ /// \return The minimum range
-+ public: double GetMinRange() const;
-+
-+ /// \brief Get the maximum range
-+ /// \return The maximum range
-+ public: double GetMaxRange() const;
-+
-+ /// \brief Get the ray count
-+ /// \return The number of rays
-+ public: int GetRayCount() const;
-+
-+ /// \brief Get the range count
-+ /// \return The number of ranges
-+ public: int GetRangeCount() const;
-+
-+ /// \brief Get the vertical scan line count
-+ /// \return The number of scan lines vertically
-+ public: int GetVerticalRayCount() const;
-+
-+ /// \brief Get the vertical scan line count
-+ /// \return The number of scan lines vertically
-+ public: int GetVerticalRangeCount() const;
-+
-+ /// \brief Get the vertical scan bottom angle
-+ /// \return The minimum angle of the scan block
-+ public: Angle GetVerticalMinAngle() const;
-+
-+ /// \brief Get the vertical scan line top angle
-+ /// \return The Maximum angle of the scan block
-+ public: Angle GetVerticalMaxAngle() const;
-+
-+ /// \brief Set ray parameters
-+ /// \param index Rayindex (from 0 to rayCount - 1).
-+ /// \param a, b Ray endpoints (initial and final points). These are
-+ /// in body-relative coordiantes.
-+ public: void SetRay(int index, const Vector3 &a, const Vector3 &b);
-+
-+ /// Get ray parameters
-+ /// \param index Ray index (from 0 to rayCount -1).
-+ /// \param pos, dir Ray position and direction.
-+ public: void GetRay(int index, Vector3 &pos, Vector3 &dir);
-+
-+ /// \brief Get detected range for a ray.
-+ /// \returns Returns DBL_MAX for no detection.
-+ public: double GetRange(int index);
-+
-+ /// \brief Get detected retro (intensity) value for a ray.
-+ public: double GetRetro(int index);
-+
-+ /// \brief Get detected fiducial value for a ray.
-+ public: int GetFiducial(int index);
-+
-+ /// \brief Ray-intersection callback
-+ private: static void UpdateCallback( void *data, dGeomID o1, dGeomID o2 );
-+
-+ /// Ray space for collision detector
-+ private: dSpaceID superSpaceId;
-+ private: dSpaceID raySpaceId;
-+
-+ /// Ray data
-+ private: std::vector<RayGeom*> rays;
-+
-+ private: ParamT<Angle> *minAngleP, *maxAngleP;
-+ private: ParamT<double> *minRangeP, *maxRangeP;
-+ private: ParamT<Vector3> *originP;
-+
-+ private: Pose3d prevPose;
-+ private: ParamT<int> *rayCountP;
-+ private: ParamT<int> *rangeCountP;
-+
-+ /// Display rays when rendering images
-+ private: ParamT<bool> *displayRaysP;
-+
-+ // For ray blocks such as Velodyne
-+ private: ParamT<int> *verticalRayCountP;
-+ private: ParamT<int> *verticalRangeCountP;
-+ private: ParamT<Angle> *verticalMinAngleP;
-+ private: ParamT<Angle> *verticalMaxAngleP;
-+};
-+/// \}
-+/// \}
-+}
-+
-+#endif
+ // Get detected range for a ray
+ double RaySensor::GetRange(int index)
+ {
Index: server/sensors/Sensor.cc
===================================================================
--- server/sensors/Sensor.cc (revision 7023)
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Block_Laser.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Block_Laser.hh 2008-09-18 23:20:32 UTC (rev 4447)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Block_Laser.hh 2008-09-18 23:24:59 UTC (rev 4448)
@@ -106,7 +106,7 @@
private: FiducialIface *fiducialIface;
/// The parent sensor
- private: RayBlockSensor *myParent;
+ private: RaySensor *myParent;
// pointer to ros node
private: ros::node *rosnode;
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc 2008-09-18 23:20:32 UTC (rev 4447)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc 2008-09-18 23:24:59 UTC (rev 4448)
@@ -37,7 +37,7 @@
#include <gazebo/gazebo.h>
#include <gazebo/GazeboError.hh>
#include <gazebo/ControllerFactory.hh>
-#include <RayBlockSensor.hh>
+#include <RaySensor.hh>
#include <gazebo_plugin/Ros_Block_Laser.hh>
using namespace gazebo;
@@ -49,10 +49,10 @@
Ros_Block_Laser::Ros_Block_Laser(Entity *parent)
: Controller(parent)
{
- this->myParent = dynamic_cast<RayBlockSensor*>(this->parent);
+ this->myParent = dynamic_cast<RaySensor*>(this->parent);
if (!this->myParent)
- gzthrow("Ros_Block_Laser controller requires a Ray Block Sensor as its parent");
+ gzthrow("Ros_Block_Laser controller requires a Ray Sensor as its parent");
// set parent sensor to active automatically
this->myParent->SetActive(true);
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/backup/pr2.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/backup/pr2.xml 2008-09-18 23:20:32 UTC (rev 4447)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/backup/pr2.xml 2008-09-18 23:24:59 UTC (rev 4448)
@@ -209,10 +209,15 @@
<!-- to be used by sensors -->
- <const name="torso_tilt_laser_offset_x" value="0.10000" /> <!-- mp 20080801 -->
- <const name="torso_tilt_laser_offset_z" value="0.19525" /> <!-- mp 20080801 -->
- <const name="tilt_laser_center_box_center_offset_z" value="0.0" /> <!-- FIXME -->
-
+ <const name="torso_tilt_laser_mount_offset_x" value="0.10000" /> <!-- mp 20080801 -->
+ <const name="torso_tilt_laser_mount_offset_z" value="0.19525" /> <!-- mp 20080801 -->
+ <const name="tilt_laser_mount_center_box_center_offset_z" value="0.0" /> <!-- FIXME -->
+
+ <!-- from sensor frame to mount bracket frame for tilt laser -->
+ <const name="tilt_laser_mount_tilt_laser_offset_x" value="0.00" /> <!-- FIXME -->
+ <const name="tilt_laser_mount_tilt_laser_offset_z" value="0.03" /> <!-- FIXME -->
+
+
<const name="base_base_laser_offset_x" value="0.275" /> <!-- mp 20080801 -->
<const name="base_base_laser_offset_z" value="0.182" /> <!-- mp 20080801 -->
<const name="base_laser_center_box_center_offset_z" value="0.12" /> <!-- FIXME -->
@@ -800,11 +805,15 @@
<joint name="caster_front_right_joint" type="revolute" >
<insert_const_block name="pr2_caster_joint"/>
</joint>
- <joint name="tilt_laser_joint" type="revolute">
+ <joint name="tilt_laser_mount_joint" type="revolute">
<axis xyz=" 0 1 0 " /> <!-- direction of the joint in a local coordinate frame -->
<anchor xyz="0 0 0" /> <!-- point on the joint relative to the parent's anchor in a global coordinate frame -->
...
[truncated message content] |
|
From: <hsu...@us...> - 2008-09-18 16:30:04
|
Revision: 4450
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4450&view=rev
Author: hsujohnhsu
Date: 2008-09-18 23:30:14 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
renamed
FRAMEID_ROBOT --> base
FRAMEID_ODOM --> odom
FRAMEID_MAP --> map
FRAMEID_LASER --> base_laser
as stated in personalrobots ticket 323
https://prdev.willowgarage.com/trac/personalrobots/ticket/323
Modified Paths:
--------------
pkg/trunk/controllers/pr2_controllers/src/base_controller.cpp
pkg/trunk/nav/amcl_player/amcl_player.cc
pkg/trunk/nav/fake_localization/fake_localization.cpp
pkg/trunk/nav/laser_pose_interpolator/laser_pose_interpolator.cpp
pkg/trunk/nav/nav_view/nav_view.cpp
pkg/trunk/nav/sbpl_2dnav/src/sbpl_2dnav.cpp
pkg/trunk/nav/wavefront_player/wavefront_player.cc
pkg/trunk/simulators/rosstage/rosstage.cc
Modified: pkg/trunk/controllers/pr2_controllers/src/base_controller.cpp
===================================================================
--- pkg/trunk/controllers/pr2_controllers/src/base_controller.cpp 2008-09-18 23:28:16 UTC (rev 4449)
+++ pkg/trunk/controllers/pr2_controllers/src/base_controller.cpp 2008-09-18 23:30:14 UTC (rev 4450)
@@ -442,7 +442,7 @@
void BaseController::setOdomMessage(std_msgs::RobotBase2DOdom &odom_msg_)
{
- odom_msg_.header.frame_id = "FRAMEID_ODOM";
+ odom_msg_.header.frame_id = "odom";
odom_msg_.header.stamp.sec = (unsigned long)floor(robot_state_->hw_->current_time_);
odom_msg_.header.stamp.nsec = (unsigned long)floor( 1e9 * ( robot_state_->hw_->current_time_ - odom_msg_.header.stamp.sec) );
@@ -497,23 +497,12 @@
double x=0,y=0,yaw=0,vx,vy,vyaw;
this->getOdometry(x,y,yaw,vx,vy,vyaw);
this->tfs->sendInverseEuler(
- "FRAMEID_ODOM",
- "FRAMEID_ROBOT",
+ "odom",
+ "base",
x, y, 0,
yaw, 0, 0,
odom_msg_.header.stamp);
- /***************************************************************/
- /* */
- /* FRAMEID_ROBOT is the base frame */
- /* */
- /***************************************************************/
- this->tfs->sendInverseEuler(
- "FRAMEID_ROBOT",
- "base",
- 0, 0, 0, 0, 0, 0,
- odom_msg_.header.stamp);
-
}
odom_publish_counter_++;
@@ -577,7 +566,7 @@
// receive messages from 2dnav stack
node->subscribe("cmd_vel", baseVelMsg, &BaseControllerNode::CmdBaseVelReceived, this);
- // for publishing odometry frame transforms FRAMEID_ODOM
+ // for publishing odometry frame transforms odom
this->tfs = new rosTFServer(*node); //, true, 1 * 1000000000ULL, 0ULL);
return true;
Modified: pkg/trunk/nav/amcl_player/amcl_player.cc
===================================================================
--- pkg/trunk/nav/amcl_player/amcl_player.cc 2008-09-18 23:28:16 UTC (rev 4449)
+++ pkg/trunk/nav/amcl_player/amcl_player.cc 2008-09-18 23:30:14 UTC (rev 4450)
@@ -366,8 +366,8 @@
// publish new transform robot->map
- this->tf->sendEuler("FRAMEID_ROBOT",
- "FRAMEID_MAP",
+ this->tf->sendEuler("base",
+ "map",
pdata->pos.px,
pdata->pos.py,
0.0,
@@ -393,7 +393,7 @@
localizedOdomMsg.header.stamp.from_double(hdr->timestamp);
try
{
- localizedOdomMsg.header.frame_id = "FRAMEID_MAP";
+ localizedOdomMsg.header.frame_id = "map";
}
catch(...)
{
Modified: pkg/trunk/nav/fake_localization/fake_localization.cpp
===================================================================
--- pkg/trunk/nav/fake_localization/fake_localization.cpp 2008-09-18 23:28:16 UTC (rev 4449)
+++ pkg/trunk/nav/fake_localization/fake_localization.cpp 2008-09-18 23:30:14 UTC (rev 4450)
@@ -151,10 +151,10 @@
m_currentPos.pos.x += m_iniPos.x;
m_currentPos.pos.y += m_iniPos.y;
m_currentPos.pos.th = math_utils::normalize_angle(m_currentPos.pos.th + m_iniPos.th);
- m_currentPos.header.frame_id = "FRAMEID_MAP";
+ m_currentPos.header.frame_id = "map";
- m_tfServer->sendEuler("FRAMEID_ROBOT",
- "FRAMEID_MAP",
+ m_tfServer->sendEuler("base",
+ "map",
m_currentPos.pos.x,
m_currentPos.pos.y,
0.0,
Modified: pkg/trunk/nav/laser_pose_interpolator/laser_pose_interpolator.cpp
===================================================================
--- pkg/trunk/nav/laser_pose_interpolator/laser_pose_interpolator.cpp 2008-09-18 23:28:16 UTC (rev 4449)
+++ pkg/trunk/nav/laser_pose_interpolator/laser_pose_interpolator.cpp 2008-09-18 23:30:14 UTC (rev 4450)
@@ -30,36 +30,36 @@
robotPose.yaw = 0;
robotPose.time = laserMsg.header.stamp.sec * 1000000000ULL + laserMsg.header.stamp.nsec;
try {
- robotPose.frame = "FRAMEID_ROBOT";
+ robotPose.frame = "base";
} catch(libTF::TransformReference::LookupException& ex) {
- std::cerr << "LookupException in lookup(\"FRAMEID_ROBOT\"): " << ex.what() << "\n";
- std::cout << "LookupException in lookup(\"FRAMEID_ROBOT\"): " << ex.what() << "\n";
+ std::cerr << "LookupException in lookup(\"base\"): " << ex.what() << "\n";
+ std::cout << "LookupException in lookup(\"base\"): " << ex.what() << "\n";
return;
} catch(libTF::TransformReference::ExtrapolateException& ex) {
- std::cerr << "ExtrapolateException in lookup(\"FRAMEID_ROBOT\"): " << ex.what() << "\n";
- std::cout << "ExtrapolateException in lookup(\"FRAMEID_ROBOT\"): " << ex.what() << "\n";
+ std::cerr << "ExtrapolateException in lookup(\"base\"): " << ex.what() << "\n";
+ std::cout << "ExtrapolateException in lookup(\"base\"): " << ex.what() << "\n";
return;
} catch(libTF::TransformReference::ConnectivityException& ex) {
- std::cerr << "ConnectivityException in lookup(\"FRAMEID_ROBOT\"): " << ex.what() << "\n";
- std::cout << "ConnectivityException in lookup(\"FRAMEID_ROBOT\"): " << ex.what() << "\n";
+ std::cerr << "ConnectivityException in lookup(\"base\"): " << ex.what() << "\n";
+ std::cout << "ConnectivityException in lookup(\"base\"): " << ex.what() << "\n";
return;
}
try {
- global_pose = this->tf.transformPose2D("FRAMEID_ODOM", robotPose);
+ global_pose = this->tf.transformPose2D("odom", robotPose);
} catch(libTF::TransformReference::LookupException& ex) {
std::cerr << tf.viewFrames();
- std::cerr << "LookupException in transformPose2D(\"FRAMEID_ODOM\", robotPose): " << ex.what() << "\n";
- std::cout << "LookupException in transformPose2D(\"FRAMEID_ODOM\", robotPose): " << ex.what() << "\n";
+ std::cerr << "LookupException in transformPose2D(\"odom\", robotPose): " << ex.what() << "\n";
+ std::cout << "LookupException in transformPose2D(\"odom\", robotPose): " << ex.what() << "\n";
return;
} catch(libTF::TransformReference::ExtrapolateException& ex) {
- std::cerr << "ExtrapolateException in transformPose2D(\"FRAMEID_ODOM\", robotPose): " << ex.what() << "\n";
- std::cout << "ExtrapolateException in transformPose2D(\"FRAMEID_ODOM\", robotPose): " << ex.what() << "\n";
+ std::cerr << "ExtrapolateException in transformPose2D(\"odom\", robotPose): " << ex.what() << "\n";
+ std::cout << "ExtrapolateException in transformPose2D(\"odom\", robotPose): " << ex.what() << "\n";
return;
} catch(libTF::TransformReference::ConnectivityException& ex) {
- std::cerr << "ConnectivityException in transformPose2D(\"FRAMEID_ODOM\", robotPose): " << ex.what() << "\n";
- std::cout << "ConnectivityException in transformPose2D(\"FRAMEID_ODOM\", robotPose): " << ex.what() << "\n";
+ std::cerr << "ConnectivityException in transformPose2D(\"odom\", robotPose): " << ex.what() << "\n";
+ std::cout << "ConnectivityException in transformPose2D(\"odom\", robotPose): " << ex.what() << "\n";
return;
}
msg.scan = laserMsg;
Modified: pkg/trunk/nav/nav_view/nav_view.cpp
===================================================================
--- pkg/trunk/nav/nav_view/nav_view.cpp 2008-09-18 23:28:16 UTC (rev 4449)
+++ pkg/trunk/nav/nav_view/nav_view.cpp 2008-09-18 23:30:14 UTC (rev 4450)
@@ -351,10 +351,10 @@
robotPose.x = 0;
robotPose.y = 0;
robotPose.yaw = 0;
- robotPose.frame = "FRAMEID_ROBOT";
+ robotPose.frame = "base";
robotPose.time = 0;
- libTF::TFPose2D mapPose = tf.transformPose2D("FRAMEID_MAP", robotPose);
+ libTF::TFPose2D mapPose = tf.transformPose2D("map", robotPose);
glPushMatrix();
glTranslatef(mapPose.x, mapPose.y, 0);
Modified: pkg/trunk/nav/sbpl_2dnav/src/sbpl_2dnav.cpp
===================================================================
--- pkg/trunk/nav/sbpl_2dnav/src/sbpl_2dnav.cpp 2008-09-18 23:28:16 UTC (rev 4449)
+++ pkg/trunk/nav/sbpl_2dnav/src/sbpl_2dnav.cpp 2008-09-18 23:30:14 UTC (rev 4450)
@@ -273,13 +273,13 @@
robot_pose.x = 0;
robot_pose.y = 0;
robot_pose.yaw = 0;
- robot_pose.frame = "FRAMEID_ROBOT";
+ robot_pose.frame = "base";
robot_pose.time = 0; // request most recent pose
//robot_pose_.time = laserMsg.header.stamp.sec * 1000000000ULL +
// laserMsg.header.stamp.nsec; ///HACKE FIXME we should be able to get time somewhere else
try
{
- global_pose = tf_.transformPose2D("FRAMEID_MAP", robot_pose);
+ global_pose = tf_.transformPose2D("map", robot_pose);
}
catch(libTF::TransformReference::LookupException& ex)
{
Modified: pkg/trunk/nav/wavefront_player/wavefront_player.cc
===================================================================
--- pkg/trunk/nav/wavefront_player/wavefront_player.cc 2008-09-18 23:28:16 UTC (rev 4449)
+++ pkg/trunk/nav/wavefront_player/wavefront_player.cc 2008-09-18 23:30:14 UTC (rev 4450)
@@ -373,8 +373,8 @@
// Static robot->laser transform
double laser_x_offset;
param("laser_x_offset", laser_x_offset, 0.05);
- this->tf.setWithEulers("FRAMEID_LASER",
- "FRAMEID_ROBOT",
+ this->tf.setWithEulers("base_laser",
+ "base",
laser_x_offset, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
advertise<std_msgs::Planner2DState>("state");
@@ -468,7 +468,7 @@
try
{
- global_cloud = this->tf.transformPointCloud("FRAMEID_MAP", local_cloud);
+ global_cloud = this->tf.transformPointCloud("map", local_cloud);
}
catch(libTF::TransformReference::LookupException& ex)
{
@@ -603,13 +603,13 @@
robotPose.x = 0;
robotPose.y = 0;
robotPose.yaw = 0;
- robotPose.frame = "FRAMEID_ROBOT";
+ robotPose.frame = "base";
robotPose.time = 0; // request most recent pose
//robotPose.time = laserMsg.header.stamp.sec * 1000000000ULL +
// laserMsg.header.stamp.nsec; ///HACKE FIXME we should be able to get time somewhere else
try
{
- global_pose = this->tf.transformPose2D("FRAMEID_MAP", robotPose);
+ global_pose = this->tf.transformPose2D("map", robotPose);
}
catch(libTF::TransformReference::LookupException& ex)
{
Modified: pkg/trunk/simulators/rosstage/rosstage.cc
===================================================================
--- pkg/trunk/simulators/rosstage/rosstage.cc 2008-09-18 23:28:16 UTC (rev 4449)
+++ pkg/trunk/simulators/rosstage/rosstage.cc 2008-09-18 23:30:14 UTC (rev 4450)
@@ -244,7 +244,7 @@
}
// TODO: get the frame ID from somewhere
- this->laserMsg.header.frame_id = "FRAMEID_LASER";
+ this->laserMsg.header.frame_id = "base_laser";
this->laserMsg.header.stamp.from_double(world->SimTimeNow() / 1e6);
//this->laserMsg.header.stamp.sec =
//(unsigned long)floor(world->SimTimeNow() / 1e6);
@@ -265,7 +265,7 @@
this->odomMsg.vel.th = v.a;
this->odomMsg.stall = this->positionmodel->Stall();
// TODO: get the frame ID from somewhere
- this->odomMsg.header.frame_id = "FRAMEID_ODOM";
+ this->odomMsg.header.frame_id = "odom";
this->odomMsg.header.stamp.from_double(world->SimTimeNow() / 1e6);
//this->odomMsg.header.stamp.sec =
@@ -276,8 +276,8 @@
// printf("%u \n",world->SimTimeNow());
//printf("time: %u, %u \n",odomMsg.header.stamp.sec, odomMsg.header.stamp.nsec);
- tf.sendInverseEuler("FRAMEID_ODOM",
- "FRAMEID_ROBOT",
+ tf.sendInverseEuler("odom",
+ "base",
odomMsg.pos.x,
odomMsg.pos.y,
0.0,
@@ -296,7 +296,7 @@
pose.setFromEuler(gpose.y, -gpose.x, 0.0,
Stg::normalize(gpose.a-M_PI/2.0), 0.0, 0.0);
this->groundTruthMsg.pose3D = pose.getMessage();
- this->groundTruthMsg.header.frame_id = "FRAMEID_ODOM";
+ this->groundTruthMsg.header.frame_id = "odom";
this->groundTruthMsg.header.stamp.from_double(world->SimTimeNow() / 1e6);
publish("base_pose_ground_truth", this->groundTruthMsg);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <stu...@us...> - 2008-09-18 16:50:37
|
Revision: 4455
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4455&view=rev
Author: stuglaser
Date: 2008-09-18 23:50:44 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Moved generic_controllers to robot_mechanism_controllers
Added Paths:
-----------
pkg/trunk/controllers/robot_mechanism_controllers/
pkg/trunk/controllers/robot_mechanism_controllers/CMakeLists.txt
pkg/trunk/controllers/robot_mechanism_controllers/Makefile
pkg/trunk/controllers/robot_mechanism_controllers/doc.h
pkg/trunk/controllers/robot_mechanism_controllers/include/
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_effort_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_autotuner.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_calibration_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_effort_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_manual_calibration_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_pd_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_velocity_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/ramp_effort_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/sine_sweep_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml
pkg/trunk/controllers/robot_mechanism_controllers/msg/
pkg/trunk/controllers/robot_mechanism_controllers/msg/SingleJointPosCmd.msg
pkg/trunk/controllers/robot_mechanism_controllers/scripts/
pkg/trunk/controllers/robot_mechanism_controllers/scripts/control.py
pkg/trunk/controllers/robot_mechanism_controllers/src/
pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_effort_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_autotuner.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_calibration_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_effort_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_manual_calibration_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_pd_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_position_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_velocity_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/ramp_effort_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/robot_mechanism_controllers/
pkg/trunk/controllers/robot_mechanism_controllers/src/robot_mechanism_controllers/__init__.py
pkg/trunk/controllers/robot_mechanism_controllers/src/robot_mechanism_controllers/controller.py
pkg/trunk/controllers/robot_mechanism_controllers/src/robot_mechanism_controllers/controllers.py
pkg/trunk/controllers/robot_mechanism_controllers/src/robot_mechanism_controllers/joint_controllers.py
pkg/trunk/controllers/robot_mechanism_controllers/src/robot_mechanism_controllers/joint_velocity_controller.py
pkg/trunk/controllers/robot_mechanism_controllers/src/sine_sweep_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/srv/
pkg/trunk/controllers/robot_mechanism_controllers/srv/BeginJointSineSweep.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/CalibrateJoint.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/GetActual.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/GetCommand.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/GetPDActual.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/GetPDCommand.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/GetPosition.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/SetCommand.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/SetPDCommand.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/SetPosition.srv
pkg/trunk/controllers/robot_mechanism_controllers/srv/SetVectorCommand.srv
pkg/trunk/mechanism/mechanism_model/include/mechanism_model/controller.h
Removed Paths:
-------------
pkg/trunk/controllers/generic_controllers/CMakeLists.txt
pkg/trunk/controllers/generic_controllers/Makefile
pkg/trunk/controllers/generic_controllers/doc.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/cartesian_effort_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_autotuner.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_blind_calibration_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_calibration_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_manual_calibration_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_pd_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_position_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_velocity_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/ramp_effort_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/sine_sweep_controller.h
pkg/trunk/controllers/generic_controllers/manifest.xml
pkg/trunk/controllers/generic_controllers/msg/SingleJointPosCmd.msg
pkg/trunk/controllers/generic_controllers/scripts/control.py
pkg/trunk/controllers/generic_controllers/src/cartesian_effort_controller.cpp
pkg/trunk/controllers/generic_controllers/src/generic_controllers/controller.py
pkg/trunk/controllers/generic_controllers/src/generic_controllers/controllers.py
pkg/trunk/controllers/generic_controllers/src/generic_controllers/joint_controllers.py
pkg/trunk/controllers/generic_controllers/src/generic_controllers/joint_velocity_controller.py
pkg/trunk/controllers/generic_controllers/src/joint_autotuner.cpp
pkg/trunk/controllers/generic_controllers/src/joint_blind_calibration_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_calibration_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_manual_calibration_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_pd_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_position_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp
pkg/trunk/controllers/generic_controllers/src/ramp_effort_controller.cpp
pkg/trunk/controllers/generic_controllers/src/sine_sweep_controller.cpp
pkg/trunk/controllers/generic_controllers/srv/BeginJointSineSweep.srv
pkg/trunk/controllers/generic_controllers/srv/CalibrateJoint.srv
pkg/trunk/controllers/generic_controllers/srv/GetActual.srv
pkg/trunk/controllers/generic_controllers/srv/GetCommand.srv
pkg/trunk/controllers/generic_controllers/srv/GetPDActual.srv
pkg/trunk/controllers/generic_controllers/srv/GetPDCommand.srv
pkg/trunk/controllers/generic_controllers/srv/GetPosition.srv
pkg/trunk/controllers/generic_controllers/srv/SetCommand.srv
pkg/trunk/controllers/generic_controllers/srv/SetPDCommand.srv
pkg/trunk/controllers/generic_controllers/srv/SetPosition.srv
pkg/trunk/controllers/generic_controllers/srv/SetVectorCommand.srv
Deleted: pkg/trunk/controllers/generic_controllers/CMakeLists.txt
===================================================================
--- pkg/trunk/controllers/generic_controllers/CMakeLists.txt 2008-09-18 23:48:34 UTC (rev 4454)
+++ pkg/trunk/controllers/generic_controllers/CMakeLists.txt 2008-09-18 23:50:44 UTC (rev 4455)
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-include(rosbuild)
-rospack(generic_controllers)
-genmsg()
-gensrv()
-rospack_add_library(generic_controllers
- src/joint_effort_controller.cpp
- src/joint_position_controller.cpp
- src/joint_velocity_controller.cpp
- src/cartesian_effort_controller.cpp
- src/ramp_effort_controller.cpp
- src/sine_sweep_controller.cpp
- src/joint_autotuner.cpp
- src/joint_pd_controller.cpp
- src/joint_calibration_controller.cpp
- src/joint_blind_calibration_controller.cpp
- src/joint_manual_calibration_controller.cpp)
Deleted: pkg/trunk/controllers/generic_controllers/Makefile
===================================================================
--- pkg/trunk/controllers/generic_controllers/Makefile 2008-09-18 23:48:34 UTC (rev 4454)
+++ pkg/trunk/controllers/generic_controllers/Makefile 2008-09-18 23:50:44 UTC (rev 4455)
@@ -1 +0,0 @@
-include $(shell rospack find mk)/cmake.mk
Deleted: pkg/trunk/controllers/generic_controllers/doc.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/doc.h 2008-09-18 23:48:34 UTC (rev 4454)
+++ pkg/trunk/controllers/generic_controllers/doc.h 2008-09-18 23:50:44 UTC (rev 4455)
@@ -1,14 +0,0 @@
-/**
-@mainpage
-@htmlinclude manifest.html
-
-test
-
-Here are the controllers which are currently implemented:
- \li \ref controller::Pid "Pid"
- \li \ref controller::JointEffortController "Joint Effort Controller"
- \li \ref controller::JointPositionController "Joint Position Controller"
- \li \ref controller::JointVelocityController "Joint Velocity Controller"
- \li \ref controller::RampInputController "Ramp Input Controller"
- \li \ref controller::SineSweepController "Sine Sweep Controller"
-**/
Deleted: pkg/trunk/controllers/generic_controllers/include/generic_controllers/cartesian_effort_controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/cartesian_effort_controller.h 2008-09-18 23:48:34 UTC (rev 4454)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/cartesian_effort_controller.h 2008-09-18 23:50:44 UTC (rev 4455)
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the Willow Garage, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Example config:
-
- <controller type="CartesianEffortController" name="controller_name">
- <chain root="root_link" tip="tip_link" />
- </controller>
-
- * The root is fixed, and all commands are specified in its coordinate
- * frame.
- *
- * Author: Stuart Glaser
- */
-#ifndef CARTESIAN_EFFORT_CONTROLLER_H
-#define CARTESIAN_EFFORT_CONTROLLER_H
-
-#include <vector>
-#include "ros/node.h"
-#include "generic_controllers/SetVectorCommand.h"
-#include "generic_controllers/controller.h"
-#include "LinearMath/btVector3.h"
-
-namespace controller {
-
-class CartesianEffortController : public Controller
-{
-public:
- CartesianEffortController();
- ~CartesianEffortController();
-
- bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
- void update();
-
- btVector3 command_;
-
-private:
- std::vector<mechanism::LinkState*> links_; // root to tip
- std::vector<mechanism::JointState*> joints_; // root to tip, 1 element smaller than links_
-};
-
-class CartesianEffortControllerNode : public Controller
-{
-public:
- CartesianEffortControllerNode();
- ~CartesianEffortControllerNode();
-
- bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
- void update();
-
- bool setCommand(generic_controllers::SetVectorCommand::request &req,
- generic_controllers::SetVectorCommand::response &resp);
-
-private:
- CartesianEffortController c_;
-};
-
-}
-
-#endif
Deleted: pkg/trunk/controllers/generic_controllers/include/generic_controllers/controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/controller.h 2008-09-18 23:48:34 UTC (rev 4454)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/controller.h 2008-09-18 23:50:44 UTC (rev 4455)
@@ -1,94 +0,0 @@
-/*********************************************************************
- * Software License Agreement (BSD License)
- *
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of the Willow Garage nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *********************************************************************/
-#pragma once
-/***************************************************/
-/*! \namespace controller
- \brief The controller namespace
-
- \class controller::Controller
- \brief A base level controller class.
-
- */
-/***************************************************/
-
-#include <misc_utils/factory.h>
-#include <mechanism_model/robot.h>
-
-#include <tinyxml/tinyxml.h>
-
-namespace controller
-{
-
- /*! \struct
- \brief This class holds information for a joint control parameter structure.
- */
- typedef struct
- {
- double p_gain; /** P gain */
-
- double i_gain; /** I gain */
-
- double d_gain; /** D gain */
-
- double windup; /** windup protection value */
-
- std::string joint_name; /** joint name */
-
- std::string control_type; /** control type */
-
- }JointControlParam;
-
-
-class Controller;
-typedef misc_utils::Factory<Controller> ControllerFactory;
-
-#define ROS_REGISTER_CONTROLLER(c) \
- controller::Controller *ROS_New_##c() { return new c(); } \
- bool ROS_CONTROLLER_##c = \
- controller::ControllerFactory::instance().registerType(#c, ROS_New_##c);
-
-class Controller
-{
-public:
- Controller()
- {
- }
- virtual ~Controller()
- {
- }
- virtual void update(void) = 0;
- virtual bool initXml(mechanism::RobotState *robot, TiXmlElement *config) = 0;
-};
-
-}
Deleted: pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_autotuner.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_autotuner.h 2008-09-18 23:48:34 UTC (rev 4454)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_autotuner.h 2008-09-18 23:50:44 UTC (rev 4455)
@@ -1,195 +0,0 @@
-/*********************************************************************
- * Software License Agreement (BSD License)
- *
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of the Willow Garage nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *********************************************************************/
-
-#pragma once
-
-/***************************************************/
-/*! \class controller::JointAutotuner
- \brief Joint Position Controller
-
- This class closes the loop around positon using
- a pid loop.
-
-*/
-/***************************************************/
-
-#include <ros/node.h>
-#include <vector>
-#include <generic_controllers/controller.h>
-#include <mechanism_model/pid.h>
-
-// Services
-#include <generic_controllers/SetCommand.h>
-#include <generic_controllers/GetActual.h>
-
-namespace controller
-{
-
-class JointAutotuner : public Controller
-{
- enum AutoControlState
- {
- START,POSITIVE_PEAK,NEGATIVE_PEAK, DONE, MANUAL
- };
-public:
- /*!
- * \brief Default Constructor of the JointAutotuner class.
- *
- */
- JointAutotuner();
-
- /*!
- * \brief Destructor of the JointAutotuner class.
- */
- ~JointAutotuner();
-
- /*!
- * \brief Functional way to initialize limits and gains.
- * \param p_gain Proportional gain.
- * \param i_gain Integral gain.
- * \param d_gain Derivative gain.
- * \param windup Intergral limit.
- * \param time The current hardware time.
- * \param *joint The joint that is being controlled.
- */
- void init(double p_gain, double i_gain, double d_gain, double windup, double time,mechanism::Robot *robot, mechanism::Joint *joint);
- bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
-
- /*!
- * \brief Give set position of the joint for next update: revolute (angle) and prismatic (position)
- *
- * \param command
- */
- void setCommand(double command);
-
- /*!
- * \brief Get latest position command to the joint: revolute (angle) and prismatic (position).
- */
- double getCommand();
-
- /*!
- * \brief Read the torque of the motor
- */
- double getMeasuredState();
-
- /*!
- * \brief Get latest time..
- */
- double getTime();
-
-
- /*!
- * \brief Issues commands to the joint. Should be called at regular intervals
- */
-
- virtual void update();
-
- double p_gain_;
- double i_gain_;
- double d_gain_;
-
- AutoControlState current_state_;
-
-private:
- bool tune_velocity_; /**<If true, uses velocity to tune. Otherwise uses position>*/
- mechanism::Joint* joint_; /**< Joint we're controlling.> */
- mechanism::JointState* joint_state_; /**< Joint we're controlling.> */
- Pid pid_controller_; /**< Internal PID controller.> */
- double last_time_; /**< Last time stamp of update.> */
- double command_; /**< Last commanded position.> */
- mechanism::Robot *robot_; /**< Pointer to robot structure.> */
- mechanism::RobotState *robot_state_; /**< Pointer to robot structure.> */
- const char* file_path_; /**<Filename and location to write results. >*/
- void writeGainValues(double period, double amplitude, double relay_height); /**<Calculate and write gain values> */
-
- double amplitude_; /**< Current amplitude of relay cycle> */
- double last_amplitude_;/**< Last amplitude of relay cycle> */
- double period_;/**< Current period of relay cycle> */
- double last_period_;/**< Last period of relay cycle> */
-
- double positive_peak_;/**< Positive peak reached in cycle> */
- double negative_peak_;/**< Negative peak reached in cycle> */
-
- double relay_height_;/**< Amount of relay input> */
- int successful_cycles_;/**< Number of matching cycles > */
- double crossing_point_;/**< Location of crossover point for relay test> */
- double cycle_start_time_;/**< Mark time of cycle start> */
-
- int num_cycles_; /*!<Number of cycles that need to match for autotuner to read as stable>!*/
- double amplitude_tolerance_; /*!<% variation amplitude allowed between successful cycles>!*/
- double period_tolerance_; /*!<% variation period allowed between successful cycles>!*/
- double relay_effort_percent_; /*!<% of effort limit to use in relay test>!*/
-
-};
-
-/***************************************************/
-/*! \class controller::JointAutotunerNode
- \brief Joint Position Controller ROS Node
-
- This class performs an autotuning routine using the relay method.
-
-
-*/
-/***************************************************/
-
-class JointAutotunerNode : public Controller
-{
-public:
- /*!
- * \brief Default Constructor
- *
- */
- JointAutotunerNode();
-
- /*!
- * \brief Destructor
- */
- ~JointAutotunerNode();
-
- void update();
-
- bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
-
- // Services
- bool setCommand(generic_controllers::SetCommand::request &req,
- generic_controllers::SetCommand::response &resp);
-
- bool getActual(generic_controllers::GetActual::request &req,
- generic_controllers::GetActual::response &resp);
-
-private:
- JointAutotuner *c_;
-};
-}
-
Deleted: pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_blind_calibration_controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_blind_calibration_controller.h 2008-09-18 23:48:34 UTC (rev 4454)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_blind_calibration_controller.h 2008-09-18 23:50:44 UTC (rev 4455)
@@ -1,135 +0,0 @@
-/*********************************************************************
- * Software License Agreement (BSD License)
- *
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of the Willow Garage nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *********************************************************************/
-
-#pragma once
-
-/***************************************************/
-/*! \class controller::JointCalibratonController
- \brief Joint Controller that finds zerop point
- \author Timothy Hunter <tjh...@wi...>
-
-
- This class moves the joint and reads the value of the clibration_reading_ field to find the zero position of the joint. Once these are determined, these values
- * are passed to the joint and enable the joint for the other controllers.
-
-*/
-/***************************************************/
-
-
-#include "joint_manual_calibration_controller.h"
-
-// Services
-#include <generic_controllers/CalibrateJoint.h>
-
-
-namespace controller
-{
-
-class JointBlindCalibrationController : public JointManualCalibrationController
-{
-public:
- /*!
- * \brief Default Constructor.
- *
- */
- JointBlindCalibrationController();
-
- /*!
- * \brief Destructor.
- */
- virtual ~JointBlindCalibrationController();
-
- /*!
- * \brief Functional way to initialize limits and gains.
- *
- */
- virtual bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
-
-
- /*!
- * \brief Issues commands to the joint. Should be called at regular intervals
- */
- virtual void update();
-
-protected:
-
- enum {SearchUp=100,SearchDown,SearchingUp,SearchingDown};
-
- double search_velocity_;
-
- double velocity_cmd_;
-
- double init_time;
-
- controller::JointVelocityController vcontroller_; /** The joint velocity controller used to sweep the joint.*/
-};
-
-
-/***************************************************/
-/*! \class controller::JointBlindCalibrationControllerNode
- \brief Joint Limit Controller ROS Node
-
- This class starts and stops the initialization sequence
-
-*/
-/***************************************************/
-
-class JointBlindCalibrationControllerNode : public Controller
-{
-public:
- /*!
- * \brief Default Constructor
- *
- */
- JointBlindCalibrationControllerNode();
-
- /*!
- * \brief Destructor
- */
- ~JointBlindCalibrationControllerNode();
-
- void update();
-
- bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
-
- // Services
- bool calibrateCommand(generic_controllers::CalibrateJoint::request &req,
- generic_controllers::CalibrateJoint::response &resp);
-
-private:
- JointBlindCalibrationController *c_;
-};
-}
-
-
Deleted: pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_calibration_controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_calibration_controller.h 2008-09-18 23:48:34 UTC (rev 4454)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_calibration_controller.h 2008-09-18 23:50:44 UTC (rev 4455)
@@ -1,134 +0,0 @@
-/*********************************************************************
- * Software License Agreement (BSD License)
- *
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are m...
[truncated message content] |
|
From: <stu...@us...> - 2008-09-18 16:51:12
|
Revision: 4456
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4456&view=rev
Author: stuglaser
Date: 2008-09-18 23:51:22 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Updated mechanism_model to take into account the new location of Pid.
Modified Paths:
--------------
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h
pkg/trunk/mechanism/mechanism_model/CMakeLists.txt
pkg/trunk/mechanism/mechanism_model/include/mechanism_model/gripper_transmission.h
pkg/trunk/mechanism/mechanism_model/manifest.xml
pkg/trunk/mechanism/mechanism_model/src/gripper_transmission.cpp
Removed Paths:
-------------
pkg/trunk/mechanism/mechanism_model/include/mechanism_model/pid.h
pkg/trunk/mechanism/mechanism_model/src/pid.cpp
Modified: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h 2008-09-18 23:50:44 UTC (rev 4455)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h 2008-09-18 23:51:22 UTC (rev 4456)
@@ -128,7 +128,7 @@
private:
mechanism::JointState *joint_state_; /**< Joint we're controlling. */
mechanism::RobotState *robot_; /**< Pointer to robot structure. */
- control_toolbox::control_toolbox::Pid pid_controller_; /**< Internal PID controller. */
+ control_toolbox::Pid pid_controller_; /**< Internal PID controller. */
double last_time_; /**< Last time stamp of update. */
double command_; /**< Last commanded position. */
Modified: pkg/trunk/mechanism/mechanism_model/CMakeLists.txt
===================================================================
--- pkg/trunk/mechanism/mechanism_model/CMakeLists.txt 2008-09-18 23:50:44 UTC (rev 4455)
+++ pkg/trunk/mechanism/mechanism_model/CMakeLists.txt 2008-09-18 23:51:22 UTC (rev 4456)
@@ -1,4 +1,9 @@
cmake_minimum_required(VERSION 2.6)
include(rosbuild)
rospack(mechanism_model)
-rospack_add_library(mechanism_model src/simple_transmission.cpp src/gripper_transmission.cpp src/joint.cpp src/robot.cpp src/link.cpp src/pid.cpp)
+rospack_add_library( mechanism_model
+ src/simple_transmission.cpp
+ src/gripper_transmission.cpp
+ src/joint.cpp
+ src/robot.cpp
+ src/link.cpp)
Modified: pkg/trunk/mechanism/mechanism_model/include/mechanism_model/gripper_transmission.h
===================================================================
--- pkg/trunk/mechanism/mechanism_model/include/mechanism_model/gripper_transmission.h 2008-09-18 23:50:44 UTC (rev 4455)
+++ pkg/trunk/mechanism/mechanism_model/include/mechanism_model/gripper_transmission.h 2008-09-18 23:51:22 UTC (rev 4456)
@@ -50,7 +50,7 @@
#include "tinyxml/tinyxml.h"
#include "mechanism_model/transmission.h"
#include "mechanism_model/robot.h"
-#include "mechanism_model/pid.h"
+#include "control_toolbox/pid.h"
namespace mechanism {
@@ -68,7 +68,7 @@
void propagateEffortBackwards(std::vector<Actuator*>&, std::vector<JointState*>&);
std::vector<double> reductions_; // Mechanical reduction for each joint
- std::vector<Pid> pids_; // For keeping the joint angles aligned in Gazebo
+ std::vector<control_toolbox::Pid> pids_; // For keeping the joint angles aligned in Gazebo
double motor_torque_constant_;
double pulses_per_revolution_;
Deleted: pkg/trunk/mechanism/mechanism_model/include/mechanism_model/pid.h
===================================================================
--- pkg/trunk/mechanism/mechanism_model/include/mechanism_model/pid.h 2008-09-18 23:50:44 UTC (rev 4455)
+++ pkg/trunk/mechanism/mechanism_model/include/mechanism_model/pid.h 2008-09-18 23:51:22 UTC (rev 4456)
@@ -1,184 +0,0 @@
-/*********************************************************************
- * Software License Agreement (BSD License)
- *
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of the Willow Garage nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *********************************************************************/
-#pragma once
-
-/***************************************************/
-/*! \class controller::Pid
- \brief A basic pid class.
-
- This class implements a generic structure that
- can be used to create a wide range of pid
- controllers. It can function independently or
- be subclassed to provide more specific controls
- based on a particular control loop.
-
- In particular, this class implements the standard
- pid equation:
-
- command = -p_term_ - i_term_ - d_term_
-
- where: <br>
- <UL TYPE="none">
- <LI> p_term_ = p_gain_ * p_error_
- <LI> i_term_ = i_gain_ * i_error_
- <LI> d_term_ = d_gain_ * d_error_
- <LI> i_error_ = i_error_ + p_error_ * dt
- <LI> d_error_ = d_error_ + (p_error_ - p_error_last_) / dt
- </UL>
-
- given:<br>
- <UL TYPE="none">
- <LI> p_error_ = p_state-p_target.
- </UL>
-
-*/
-/***************************************************/
-class TiXmlElement;
-
-class Pid
-{
-public:
-
- /*!
- * \brief Constructor, zeros out Pid values when created and
- * initialize Pid-gains and integral term limits:[iMax:iMin]-[I1:I2].
- *
- * \param P The proportional gain.
- * \param I The integral gain.
- * \param D The derivative gain.
- * \param I1 The integral upper limit.
- * \param I2 The integral lower limit.
- */
- Pid(double P = 0.0, double I = 0.0, double D = 0.0, double I1 = 0.0, double I2 = -0.0);
-
- /*!
- * \brief Destructor of Pid class.
- */
- ~Pid();
-
- /*!
- * \brief Update the Pid loop with nonuniform time step size.
- *
- * \param p_error Error since last call (p_state-p_target)
- * \param dt Change in time since last call
- */
- double updatePid(double p_error, double dt);
-
- /*!
- * \brief Initialize PID-gains and integral term limits:[iMax:iMin]-[I1:I2]
- *
- * \param P The proportional gain.
- * \param I The integral gain.
- * \param D The derivative gain.
- * \param I1 The integral upper limit.
- * \param I2 The integral lower limit.
- */
- void initPid(double P, double I, double D, double I1, double I2);
-
- void initXml(TiXmlElement *config);
-
- /*!
- * \brief Set current command for this PID controller
- */
- void setCurrentCmd(double cmd);
-
- /*!
- * \brief Return current command for this PID controller
- */
- double getCurrentCmd();
-
- /*!
- * \brief Return PID error terms for the controller.
- * \param pe The proportional error.
- * \param ie The integral error.
- * \param de The derivative error.
- */
- void getCurrentPIDErrors(double *pe, double *ie, double *de);
-
- /*!
- * \brief Set PID gains for the controller.
- * \param P The proportional gain.
- * \param I The integral gain.
- * \param D The derivative gain.
- * \param i_max
- * \param i_min
- */
- void setGains(double P, double I, double D, double i_max, double i_min);
-
- /*!
- * \brief Get PID gains for the controller.
- * \param p The proportional gain.
- * \param i The integral gain.
- * \param d The derivative gain.
- * \param i_max
- * \param i_mim
- */
- void getGains(double &p, double &i, double &d, double &i_max, double &i_min);
-
- /*!
- * \brief Update the Pid loop with nonuniform time step size.
- *
- * \param error Error since last call (p_state-p_target)
- * \param error_dot d(Error)/dt since last call
- * \param dt Change in time since last call
- */
- double updatePid(double error, double error_dot, double dt);
-
- Pid &operator =(const Pid& p)
- {
- if (this == &p)
- return *this;
-
- p_gain_ = p.p_gain_;
- i_gain_ = p.i_gain_;
- d_gain_ = p.d_gain_;
- i_max_ = p.i_max_;
- i_min_ = p.i_min_;
-
- p_error_last_ = p_error_ = i_error_ = d_error_ = cmd_ = 0.0;
- return *this;
- }
-
-private:
- double p_error_last_; /**< _Save position state for derivative state calculation. */
- double p_error_; /**< Position error. */
- double d_error_; /**< Derivative error. */
- double i_error_; /**< Integator error. */
- double p_gain_; /**< Proportional gain. */
- double i_gain_; /**< Integral gain. */
- double d_gain_; /**< Derivative gain. */
- double i_max_; /**< Maximum allowable integral term. */
- double i_min_; /**< Minimum allowable integral term. */
- double cmd_; /**< Command to send. */
-};
Modified: pkg/trunk/mechanism/mechanism_model/manifest.xml
===================================================================
--- pkg/trunk/mechanism/mechanism_model/manifest.xml 2008-09-18 23:50:44 UTC (rev 4455)
+++ pkg/trunk/mechanism/mechanism_model/manifest.xml 2008-09-18 23:51:22 UTC (rev 4456)
@@ -3,14 +3,15 @@
</description>
<author>Eric Berger be...@wi...</author>
<license>BSD</license>
-<depend package='roscpp'/>
-<depend package='hardware_interface'/>
+<depend package="roscpp" />
+<depend package="hardware_interface" />
<depend package="stl_utils" />
<depend package="misc_utils" />
<depend package="tinyxml" />
<depend package="wg_robot_description_parser" />
<depend package="kdl" />
<depend package="libTF" />
+<depend package="control_toolbox" />
<url>http://pr.willowgarage.com</url>
<export>
<cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -lmechanism_model -Wl,-rpath,${prefix}/lib"/>
Modified: pkg/trunk/mechanism/mechanism_model/src/gripper_transmission.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_model/src/gripper_transmission.cpp 2008-09-18 23:50:44 UTC (rev 4455)
+++ pkg/trunk/mechanism/mechanism_model/src/gripper_transmission.cpp 2008-09-18 23:51:22 UTC (rev 4456)
@@ -76,7 +76,7 @@
TiXmlElement *pel = config->FirstChildElement("pid");
if (pel)
{
- Pid pid;
+ control_toolbox::Pid pid;
pid.initXml(pel);
for (unsigned int i = 0; i < pids_.size(); ++i)
pids_[i] = pid;
Deleted: pkg/trunk/mechanism/mechanism_model/src/pid.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_model/src/pid.cpp 2008-09-18 23:50:44 UTC (rev 4455)
+++ pkg/trunk/mechanism/mechanism_model/src/pid.cpp 2008-09-18 23:51:22 UTC (rev 4456)
@@ -1,191 +0,0 @@
-/*********************************************************************
- * Software License Agreement (BSD License)
- *
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of the Willow Garage nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *********************************************************************/
-#include "mechanism_model/pid.h"
-#include "tinyxml/tinyxml.h"
-
-Pid::Pid(double P, double I, double D, double I1, double I2) :
- p_gain_(P), i_gain_(I), d_gain_(D), i_max_(I1), i_min_(I2)
-{
- p_error_last_ = 0.0;
- p_error_ = 0.0;
- d_error_ = 0.0;
- i_error_ = 0.0;
- cmd_ = 0.0;
-}
-
-Pid::~Pid()
-{
-}
-
-void Pid::initPid(double P, double I, double D, double I1, double I2)
-{
- p_gain_ = P;
- i_gain_ = I;
- d_gain_ = D;
- i_max_ = I1;
- i_min_ = I2;
- p_error_last_ = 0.0;
- p_error_ = 0.0;
- d_error_ = 0.0;
- i_error_ = 0.0;
- cmd_ = 0.0;
-}
-
-void Pid::getGains(double &p, double &i, double &d, double &i_max, double &i_min)
-{
- p = p_gain_;
- i = i_gain_;
- d = d_gain_;
- i_max = i_max_;
- i_min = i_min_;
-}
-
-void Pid::setGains(double P, double I, double D, double I1, double I2)
-{
- p_gain_ = P;
- i_gain_ = I;
- d_gain_ = D;
- i_max_ = I1;
- i_min_ = I2;
-}
-
-void Pid::initXml(TiXmlElement *config)
-{
- p_gain_ = config->Attribute("p") ? atof(config->Attribute("p")) : 0.0;
- i_gain_ = config->Attribute("i") ? atof(config->Attribute("i")) : 0.0;
- d_gain_ = config->Attribute("d") ? atof(config->Attribute("d")) : 0.0;
- i_max_ = config->Attribute("iClamp") ? atof(config->Attribute("iClamp")) : 0.0;
- i_min_ = -i_max_;
-}
-
-double Pid::updatePid(double error, double dt)
-{
- double p_term, d_term, i_term;
- p_error_ = error; //this is pError = pState-pTarget
-
- if (dt == 0)
- {
- throw "dividebyzero"; //TODO: not sure how to deal with this
- }
- else
- {
- // Calculate proportional contribution to command
- p_term = p_gain_ * p_error_;
-
- // Calculate the integral error
- i_error_ = i_error_ + dt * p_error_;
-
- //Calculate integral contribution to command
- i_term = i_gain_ * i_error_;
-
- // Limit i_term so that the limit is meaningful in the output
- if (i_term > i_max_)
- {
- i_term = i_max_;
- }
- else if (i_term < i_min_)
- {
- i_term = i_min_;
- }
-
- // Calculate the derivative error
- if (dt != 0)
- {
- d_error_ = (p_error_ - p_error_last_) / dt;
- p_error_last_ = p_error_;
- }
- // Calculate derivative contribution to command
- d_term = d_gain_ * d_error_;
- cmd_ = -p_term - i_term - d_term;
- }
- return cmd_;
-}
-
-
-double Pid::updatePid(double error, double error_dot, double dt)
-{
- double p_term, d_term, i_term;
- p_error_ = error; //this is pError = pState-pTarget
- d_error_ = error_dot;
- if (dt == 0)
- {
- throw "dividebyzero"; //TODO: not sure how to deal with this
- }
- else
- {
- // Calculate proportional contribution to command
- p_term = p_gain_ * p_error_;
-
- // Calculate the integral error
- i_error_ = i_error_ + dt * p_error_;
-
- //Calculate integral contribution to command
- i_term = i_gain_ * i_error_;
-
- // Limit i_term so that the limit is meaningful in the output
- if (i_term > i_max_)
- {
- i_term = i_max_;
- }
- else if (i_term < i_min_)
- {
- i_term = i_min_;
- }
-
- // Calculate derivative contribution to command
- d_term = d_gain_ * d_error_;
- cmd_ = -p_term - i_term - d_term;
- }
- return cmd_;
-}
-
-
-
-void Pid::setCurrentCmd(double cmd)
-{
- cmd_ = cmd;
-}
-
-double Pid::getCurrentCmd()
-{
- return cmd_;
-}
-
-void Pid::getCurrentPIDErrors(double *pe, double *ie, double *de)
-{
- *pe = p_error_;
- *ie = i_error_;
- *de = d_error_;
-}
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <stu...@us...> - 2008-09-18 16:53:18
|
Revision: 4458
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4458&view=rev
Author: stuglaser
Date: 2008-09-18 23:53:29 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Changed mechanism_control and gazebo_plugin to be consistent with the new controller layout.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt
pkg/trunk/drivers/simulator/gazebo_plugin/manifest.xml
pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h
pkg/trunk/mechanism/mechanism_control/manifest.xml
pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt 2008-09-18 23:52:56 UTC (rev 4457)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt 2008-09-18 23:53:29 UTC (rev 4458)
@@ -17,7 +17,7 @@
rospack_add_library(Ros_PTZ src/Ros_PTZ.cc)
rospack_add_library(P3D src/P3D.cc)
rospack_add_library(gazebo_actuators src/gazebo_actuators.cpp)
-rospack_add_library(test_actuators src/test_actuators.cpp)
+#rospack_add_library(test_actuators src/test_actuators.cpp)
# This target requires adding player to the manifest.xml.
#rospack_add_executable(player_pr2 src/player/Pr2_Player.cc)
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/manifest.xml
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/manifest.xml 2008-09-18 23:52:56 UTC (rev 4457)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/manifest.xml 2008-09-18 23:53:29 UTC (rev 4458)
@@ -11,8 +11,8 @@
<depend package="gazebo"/>
<depend package="opende"/>
<depend package="newmat10"/>
-<depend package="generic_controllers"/>
-<depend package="pr2_controllers"/>
+<depend package="robot_mechanism_controllers"/>
+<depend package="pr2_mechanism_controllers"/>
<depend package="roscpp"/>
<depend package="std_msgs" />
<depend package="pr2_msgs" />
Modified: pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h
===================================================================
--- pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h 2008-09-18 23:52:56 UTC (rev 4457)
+++ pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h 2008-09-18 23:53:29 UTC (rev 4458)
@@ -42,7 +42,7 @@
#include <hardware_interface/hardware_interface.h>
#include <mechanism_model/robot.h>
#include <rosthread/mutex.h>
-#include <generic_controllers/controller.h>
+#include <mechanism_model/controller.h>
#include <misc_utils/realtime_publisher.h>
#include "mechanism_control/ListControllerTypes.h"
Modified: pkg/trunk/mechanism/mechanism_control/manifest.xml
===================================================================
--- pkg/trunk/mechanism/mechanism_control/manifest.xml 2008-09-18 23:52:56 UTC (rev 4457)
+++ pkg/trunk/mechanism/mechanism_control/manifest.xml 2008-09-18 23:53:29 UTC (rev 4458)
@@ -9,7 +9,6 @@
<depend package="hardware_interface"/>
<depend package="tinyxml"/>
<depend package="mechanism_model"/>
-<depend package="generic_controllers"/>
<depend package="misc_utils" />
<depend package="rospy" />
<depend package="rosTF" />
Modified: pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2008-09-18 23:52:56 UTC (rev 4457)
+++ pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2008-09-18 23:53:29 UTC (rev 4458)
@@ -29,7 +29,6 @@
*/
#include "mechanism_control/mechanism_control.h"
-#include "generic_controllers/controller.h"
#include "rosthread/member_thread.h"
#include "rosTF/rosTF.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <stu...@us...> - 2008-09-18 16:54:25
|
Revision: 4459
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4459&view=rev
Author: stuglaser
Date: 2008-09-18 23:54:36 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Updated qualification controllers and pr2_etherCAT to work with new controller layout.
Modified Paths:
--------------
pkg/trunk/controllers/testing_controllers/gripper_qualification_controllers/manifest.xml
pkg/trunk/controllers/testing_controllers/motor_qualification_controllers/manifest.xml
pkg/trunk/mechanism/mechanism_control_rt/manifest.xml
pkg/trunk/robot_control_loops/pr2_etherCAT/manifest.xml
Modified: pkg/trunk/controllers/testing_controllers/gripper_qualification_controllers/manifest.xml
===================================================================
--- pkg/trunk/controllers/testing_controllers/gripper_qualification_controllers/manifest.xml 2008-09-18 23:53:29 UTC (rev 4458)
+++ pkg/trunk/controllers/testing_controllers/gripper_qualification_controllers/manifest.xml 2008-09-18 23:54:36 UTC (rev 4459)
@@ -10,7 +10,7 @@
<depend package="newmat10" />
<depend package="misc_utils" />
<depend package="robot_msgs" />
- <depend package="generic_controllers" />
+ <depend package="robot_mechanism_controllers" />
<url>http://pr.willowgarage.com</url>
<repository>http://pr.willowgarage.com/repos</repository>
<export>
Modified: pkg/trunk/controllers/testing_controllers/motor_qualification_controllers/manifest.xml
===================================================================
--- pkg/trunk/controllers/testing_controllers/motor_qualification_controllers/manifest.xml 2008-09-18 23:53:29 UTC (rev 4458)
+++ pkg/trunk/controllers/testing_controllers/motor_qualification_controllers/manifest.xml 2008-09-18 23:54:36 UTC (rev 4459)
@@ -10,7 +10,7 @@
<depend package="newmat10" />
<depend package="misc_utils" />
<depend package="robot_msgs" />
- <depend package="generic_controllers" />
+ <depend package="robot_mechanism_controllers" />
<url>http://pr.willowgarage.com</url>
<repository>http://pr.willowgarage.com/repos</repository>
<export>
Modified: pkg/trunk/mechanism/mechanism_control_rt/manifest.xml
===================================================================
--- pkg/trunk/mechanism/mechanism_control_rt/manifest.xml 2008-09-18 23:53:29 UTC (rev 4458)
+++ pkg/trunk/mechanism/mechanism_control_rt/manifest.xml 2008-09-18 23:54:36 UTC (rev 4459)
@@ -9,7 +9,6 @@
<depend package="hardware_interface"/>
<depend package="tinyxml"/>
<depend package="mechanism_model"/>
-<depend package="generic_controllers"/>
<depend package="misc_utils" />
<depend package="rospy" />
<depend package="rosTF" />
Modified: pkg/trunk/robot_control_loops/pr2_etherCAT/manifest.xml
===================================================================
--- pkg/trunk/robot_control_loops/pr2_etherCAT/manifest.xml 2008-09-18 23:53:29 UTC (rev 4458)
+++ pkg/trunk/robot_control_loops/pr2_etherCAT/manifest.xml 2008-09-18 23:54:36 UTC (rev 4459)
@@ -9,8 +9,8 @@
<depend package="ethercat_hardware"/>
<depend package="hardware_interface"/>
<depend package="std_srvs"/>
- <depend package="generic_controllers"/>
- <depend package="pr2_controllers"/>
+ <depend package="robot_mechanism_controllers"/>
+ <depend package="pr2_mechanism_controllers"/>
<depend package="motor_qualification_controllers"/>
<depend package="gripper_qualification_controllers"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-09-18 16:58:40
|
Revision: 4460
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4460&view=rev
Author: hsujohnhsu
Date: 2008-09-18 23:58:50 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
updates to use gazebo_actuators in place of test_actuators.
Modified Paths:
--------------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
pkg/trunk/demos/2dnav-gazebo/hztest.xml
pkg/trunk/demos/2dnav-gazebo/odom_hz_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_headless.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -1,7 +1,7 @@
<launch>
<group name="wg">
- <!--include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/-->
- <include file="$(find gazebo_robot_description)/pr2_test.xml"/>
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
+ <!--include file="$(find gazebo_robot_description)/pr2_test.xml"/-->
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -1,7 +1,7 @@
<launch>
<group name="wg">
- <!--include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/-->
- <include file="$(find gazebo_robot_description)/pr2_test_headless.xml"/>
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
+ <!--include file="$(find gazebo_robot_description)/pr2_test_headless.xml"/-->
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -1,7 +1,7 @@
<launch>
<group name="wg">
- <!--include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/-->
- <include file="$(find gazebo_robot_description)/pr2_test_headless.xml"/>
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
+ <!--include file="$(find gazebo_robot_description)/pr2_test_headless.xml"/-->
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -1,7 +1,7 @@
<launch>
<group name="wg">
- <!--include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/-->
- <include file="$(find gazebo_robot_description)/pr2_test.xml"/>
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
+ <!--include file="$(find gazebo_robot_description)/pr2_test.xml"/-->
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/hztest.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/hztest.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/demos/2dnav-gazebo/hztest.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -1,6 +1,7 @@
<launch>
<!-- Bring up the node we want to test. -->
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
+ <!--include file="$(find gazebo_robot_description)/pr2_test_headless.xml"/-->
<!-- Run hztest -->
<!-- Test for publication of 'base_scan' topic -->
@@ -9,12 +10,12 @@
<param name="topic" value="base_scan" />
<!-- The expected publication rate [Hz]. Set to 0.0 to only check that
at least one message is received. -->
- <param name="hz" value="10.0" />
+ <param name="hz" value="5.0" />
<!-- Acceptable error in the publication rate [Hz]. Ignored if hz is set
to 0.0. -->
<param name="hzerror" value="3.0" />
<!-- Time to listen for [seconds] -->
- <param name="test_duration" value="1.0" />
+ <param name="test_duration" value="5.0" />
<!-- Whether each inter-message time interval should be checked against
the expected publication rate and error bound [boolean]. If true, then
the test will fail if the time elapsed between *any* two consecutive
@@ -28,8 +29,8 @@
<!-- Note how we use a different parameter namespace and node name
for this test (odom_test vs. scan_test). -->
<param name="topic" value="odom" />
- <param name="hz" value="3.0" />
- <param name="hzerror" value="1.0" />
+ <param name="hz" value="50.0" />
+ <param name="hzerror" value="3.0" />
<param name="test_duration" value="5.0" />
<param name="check_intervals" value="false" />
</test>
Modified: pkg/trunk/demos/2dnav-gazebo/odom_hz_test.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/odom_hz_test.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/demos/2dnav-gazebo/odom_hz_test.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -1,6 +1,6 @@
<launch>
<!-- Bring up the node we want to test. -->
- <include file="$(find gazebo_robot_description)/pr2_test.xml"/>
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
<!-- Test for publication of 'odom' topic. -->
<test test-name="hztest_test_odom" pkg="rostest" type="hztest" name="odom_test">
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -8,7 +8,7 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
- <node pkg="generic_controllers" type="controllers.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
+ <node pkg="generic_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
</group>
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_headless.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_headless.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_headless.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -8,7 +8,7 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
- <node pkg="generic_controllers" type="controllers.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
+ <node pkg="generic_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
</group>
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -9,7 +9,7 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
- <node pkg="generic_controllers" type="controllers.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
+ <node pkg="generic_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
</group>
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg_headless.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg_headless.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg_headless.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -9,7 +9,7 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
- <node pkg="generic_controllers" type="controllers.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
+ <node pkg="generic_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
</group>
</launch>
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml 2008-09-18 23:54:36 UTC (rev 4459)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml 2008-09-18 23:58:50 UTC (rev 4460)
@@ -865,7 +865,7 @@
<link name="base"><!-- link specifying the base of the robot -->
- <parent name=" world" />
+ <parent name="world" />
<!-- rotation of a local coordinate frame attached to the link with respect to a global coordinate frame -->
<origin xyz=" robot_inital_position_x robot_inital_position_y robot_inital_position_z " rpy=" 0 0 0" /> <!-- position of a local coordinate frame attached to the link with respect to the parent link's coordinate frame -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-09-18 17:51:00
|
Revision: 4471
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4471&view=rev
Author: hsujohnhsu
Date: 2008-09-19 00:51:10 +0000 (Fri, 19 Sep 2008)
Log Message:
-----------
updates to demos to use new pr2_gui.
Modified Paths:
--------------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_headless.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/backup/pr2.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -8,11 +8,7 @@
<node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
<!-- for visualization -->
- <node pkg="wx_camera_panel" type="standalone_camera.py" args="-i PTZL_image -s PTZL_state -c PTZL_cmd" respawn="true" output="screen" />
- <node pkg="wx_camera_panel" type="standalone_camera.py" args="-i PTZR_image -s PTZR_state -c PTZR_cmd" respawn="true" output="screen" />
- <node pkg="laser_view" type="laser_view" args="scan:=tilt_scan" respawn="true" output="screen" />
- <node pkg="ogre_visualizer" type="visualizer_test" respawn="true" output="screen" />
- <!--node pkg="wxpy_ros" type="ros_panel" respawn="false" output="screen" /--><!-- does not start correctly-->
+ <node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
<!-- for manual control -->
<!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -9,7 +9,6 @@
<!-- for visualization -->
<node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
- <!--node pkg="wxpy_ros" type="ros_panel" respawn="false" output="screen" /--><!-- does not start correctly-->
<!-- for manual control -->
<!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -7,11 +7,7 @@
<node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
<!-- for visualization -->
- <node pkg="wx_camera_panel" type="standalone_camera.py" args="-i PTZL_image -s PTZL_state -c PTZL_cmd" respawn="true" output="screen" />
- <node pkg="wx_camera_panel" type="standalone_camera.py" args="-i PTZR_image -s PTZR_state -c PTZR_cmd" respawn="true" output="screen" />
- <node pkg="laser_view" type="laser_view" args="scan:=tilt_scan" respawn="true" output="screen" />
- <node pkg="ogre_visualizer" type="visualizer_test" respawn="true" output="screen" />
- <!--node pkg="wxpy_ros" type="ros_panel" respawn="false" output="screen" /--><!-- does not start correctly-->
+ <node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
<!-- for manual control -->
<!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -7,11 +7,7 @@
<node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
<!-- for visualization -->
- <node pkg="wx_camera_panel" type="standalone_camera.py" args="-i PTZL_image -s PTZL_state -c PTZL_cmd" respawn="true" output="screen" />
- <node pkg="wx_camera_panel" type="standalone_camera.py" args="-i PTZR_image -s PTZR_state -c PTZR_cmd" respawn="true" output="screen" />
- <node pkg="laser_view" type="laser_view" args="scan:=tilt_scan" respawn="true" output="screen" />
- <node pkg="ogre_visualizer" type="visualizer_test" respawn="true" output="screen" />
- <!--node pkg="wxpy_ros" type="ros_panel" respawn="false" output="screen" /--><!-- does not start correctly-->
+ <node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
<!-- for manual control -->
<!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -8,7 +8,7 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
- <node pkg="generic_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
+ <node pkg="robot_mechanism_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
</group>
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_headless.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_headless.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_headless.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -8,7 +8,7 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
- <node pkg="generic_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
+ <node pkg="robot_mechanism_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
</group>
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -9,7 +9,7 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
- <node pkg="generic_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
+ <node pkg="robot_mechanism_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
</group>
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg_headless.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg_headless.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_gazebo_actuators_wg_headless.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -9,7 +9,7 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
- <node pkg="generic_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
+ <node pkg="robot_mechanism_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
</group>
</launch>
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/backup/pr2.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/backup/pr2.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/backup/pr2.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -865,7 +865,7 @@
<link name="base"><!-- link specifying the base of the robot -->
- <parent name=" world" />
+ <parent name="world" />
<!-- rotation of a local coordinate frame attached to the link with respect to a global coordinate frame -->
<origin xyz=" robot_inital_position_x robot_inital_position_y robot_inital_position_z " rpy=" 0 0 0" /> <!-- position of a local coordinate frame attached to the link with respect to the parent link's coordinate frame -->
@@ -2384,8 +2384,8 @@
<map name="sensor" flag="gazebo">
<verbatim key="sensor_ray">
<sensor:ray name="stereo_laser">
- <rayCount>100</rayCount>
- <rangeCount>100</rangeCount>
+ <rayCount>30</rayCount>
+ <rangeCount>30</rangeCount>
<laserCount>1</laserCount>
<origin>0.0 0.0 0.05</origin>
@@ -2398,8 +2398,8 @@
<maxRange>100.0</maxRange>
<updateRate>10.0</updateRate>
- <verticalRayCount>100</verticalRayCount>
- <verticalRangeCount>100</verticalRangeCount>
+ <verticalRayCount>30</verticalRayCount>
+ <verticalRangeCount>30</verticalRangeCount>
<verticalMinAngle>-20</verticalMinAngle>
<verticalMaxAngle> 0</verticalMaxAngle>
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml 2008-09-19 00:31:51 UTC (rev 4470)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml 2008-09-19 00:51:10 UTC (rev 4471)
@@ -2384,8 +2384,8 @@
<map name="sensor" flag="gazebo">
<verbatim key="sensor_ray">
<sensor:ray name="stereo_laser">
- <rayCount>100</rayCount>
- <rangeCount>100</rangeCount>
+ <rayCount>30</rayCount>
+ <rangeCount>30</rangeCount>
<laserCount>1</laserCount>
<origin>0.0 0.0 0.05</origin>
@@ -2398,8 +2398,8 @@
<maxRange>100.0</maxRange>
<updateRate>10.0</updateRate>
- <verticalRayCount>100</verticalRayCount>
- <verticalRangeCount>100</verticalRangeCount>
+ <verticalRayCount>30</verticalRayCount>
+ <verticalRangeCount>30</verticalRangeCount>
<verticalMinAngle>-20</verticalMinAngle>
<verticalMaxAngle> 0</verticalMaxAngle>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-09-22 17:50:30
|
Revision: 4543
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4543&view=rev
Author: hsujohnhsu
Date: 2008-09-22 17:50:12 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
cleanup, removed test_actuators and unused plugins.
clean up of roslaunch demo test cases to reflect usage of gazebo_actuators.
Modified Paths:
--------------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
pkg/trunk/demos/2dnav-gazebo/hztest.xml
pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc
pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.xml
pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.py
pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_floorobj.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_headless.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_obs.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_test_coord.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg_headless.world
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers_gazebo.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm/pr2d2.xml
pkg/trunk/robot_descriptions/wg_robot_description/send_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/send_arm_test_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/single_link_test/controllers_gazebo_single_link.xml
pkg/trunk/robot_descriptions/wg_robot_description_parser/src/URDF.cpp
Added Paths:
-----------
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers_gazebo_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_gazebo_actuators_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/actuators_arm.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/controllers_arm.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/controllers_gazebo_arm.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/controllers_gazebo_arm_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/gazebo_joints_arm.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/groups_arm.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/pr2_arm.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/pr2_arm_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/transmissions_arm.xml
Removed Paths:
-------------
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Pr2_Actarray.hh
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Pr2_Gripper.hh
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/test_actuators.h
pkg/trunk/drivers/simulator/gazebo_plugin/src/Pr2_Actarray.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/Pr2_Gripper.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_arm_test_tjh.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_test_headless.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_test_wg.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/pr2_test_wg_headless.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/actuators_arm_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/controller_base.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/controllers_arm_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/controllers_arm_test_tjh.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/controllers_gazebo_arm_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/controllers_gazebo_arm_test_tjh.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/controllers_gazebo_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/gazebo_joints_arm_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/gazebo_joints_arm_test_tjh.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/groups_arm_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/groups_arm_test_tjh.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_arm_test.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_arm_test_tjh.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_test_actuators.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_arm_test_tjh.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_test.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_test_headless.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_test_nolimit.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_test_wg.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_test_wg_headless.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/transmissions_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/actuators_old.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers_gazebo_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers_gazebo_test_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_test_actuators.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_test_actuators_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/actuators_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/controllers_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/controllers_gazebo_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/controllers_gazebo_arm_test_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/gazebo_joints_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/groups_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/pr2_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/pr2_arm_test_headless.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_arm_test/transmissions_arm_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/send_arm_test_tjh.xml
pkg/trunk/robot_descriptions/wg_robot_description/send_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/send_test_headless.xml
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,7 +1,6 @@
<launch>
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
- <!--include file="$(find gazebo_robot_description)/pr2_test.xml"/-->
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,7 +1,6 @@
<launch>
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
- <!--include file="$(find gazebo_robot_description)/pr2_test_headless.xml"/-->
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,7 +1,6 @@
<launch>
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
- <!--include file="$(find gazebo_robot_description)/pr2_test_headless.xml"/-->
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,7 +1,7 @@
<launch>
+ <!--master auto="start"/-->
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
- <!--include file="$(find gazebo_robot_description)/pr2_test.xml"/-->
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/hztest.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/hztest.xml 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/demos/2dnav-gazebo/hztest.xml 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,7 +1,6 @@
<launch>
<!-- Bring up the node we want to test. -->
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
- <!--include file="$(find gazebo_robot_description)/pr2_test_headless.xml"/-->
<!-- Run hztest -->
<!-- Test for publication of 'base_scan' topic -->
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt 2008-09-22 17:50:12 UTC (rev 4543)
@@ -7,8 +7,6 @@
include_directories(srv/cpp)
add_definitions(-Wall)
-#rospack_add_library(Pr2_Actarray src/Pr2_Actarray.cc)
-#rospack_add_library(Pr2_Gripper src/Pr2_Gripper.cc)
rospack_add_library(Ros_Stereo_Camera src/Ros_Stereo_Camera.cc)
rospack_add_library(Ros_Camera src/Ros_Camera.cc)
rospack_add_library(Ros_Laser src/Ros_Laser.cc)
@@ -17,7 +15,6 @@
rospack_add_library(Ros_PTZ src/Ros_PTZ.cc)
rospack_add_library(P3D src/P3D.cc)
rospack_add_library(gazebo_actuators src/gazebo_actuators.cpp)
-#rospack_add_library(test_actuators src/test_actuators.cpp)
# This target requires adding player to the manifest.xml.
#rospack_add_executable(player_pr2 src/player/Pr2_Player.cc)
Deleted: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Pr2_Actarray.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Pr2_Actarray.hh 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Pr2_Actarray.hh 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,138 +0,0 @@
-/*
- * Gazebo - Outdoor Multi-Robot Simulator
- * Copyright (C) 2003
- * Nate Koenig & Andrew Howard
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-/*
- * Desc: Actuator array controller for a Pr2 robot.
- * Author: John Hsu, Sachin Chitta
- * Date: 19 Sept 2007
- * SVN: $Id$
- */
-#ifndef PR2_ACTARRAY_HH
-#define PR2_ACTARRAY_HH
-
-#include <gazebo/Controller.hh>
-#include <gazebo/Entity.hh>
-#include <pr2Core/pr2Core.h>
-
-#include <vector>
-#include <mechanism_model/pid.h>
-
-namespace gazebo
-{
- class HingeJoint;
- class PositionIface;
-
-/// \addtogroup gazebo_controller
- /// \{
- /** \defgroup pr2_actarray pr2_actarray
-
- \brief Pr2 controller using Gazebo's Actuator array interface.
-
- \verbatim
- <controller:pr2_actarray name="controller-name">
- <interface:actarray name="iface-name"/>
- </controller:pr2_actarray>
- \endverbatim
-
- \{
- */
-
- /// \brief Pr2 actuator array controller
- /// This is a controller that simulates a Pr2 torso
- class Pr2_Actarray : public Controller
- {
- /// Constructor
- public: Pr2_Actarray(Entity *parent );
-
- /// Destructor
- public: virtual ~Pr2_Actarray();
-
- /// Load the controller
- /// \param node XML config node
- /// \return 0 on success
- protected: virtual void LoadChild(XMLConfigNode *node);
-
- /// Init the controller
- /// \return 0 on success
- protected: virtual void InitChild();
-
- /// Update the controller
- /// \return 0 on success
- protected: virtual void UpdateChild();
-
- /// Finalize the controller
- /// \return 0 on success
- protected: virtual void FiniChild();
-
- /// The actarray interface
- private: PR2ArrayIface *myIface;
-
- /// The parent Model
- private: Model *myParent;
-
- // Gazebo/ODE joints
- private: Joint *joints[GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
-
- // we'll declare a pid controller for each hinger/slider/... joint
- private: Pid *pids[GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
-
- // number of joints in this array
- private: int num_joints;
-
- // save last time for dt calc for pid's
- private: double lastTime;
-
- // explicit damping coefficient for the joint
- private: double dampCoef;
-
- // get joints names from xml fields
- private: std::string finger_l_name [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: std::string finger_tip_l_name [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: std::string finger_r_name [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: std::string finger_tip_r_name [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
-
- // get the joints from parent
- private: HingeJoint *finger_l_joint [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: HingeJoint *finger_tip_l_joint [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: HingeJoint *finger_r_joint [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: HingeJoint *finger_tip_r_joint [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
-
- // assign pid for each finger for PD_CONTROL
- private: Pid *finger_l_pids [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: Pid *finger_tip_l_pids [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: Pid *finger_r_pids [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
- private: Pid *finger_tip_r_pids [GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
-
- // get name of each child, e.g. front_left_caster_steer
- std::string actarrayName[GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
-
- // get type of each child, only check for special case for grippers for now. All others ignored. (TODO)
- std::string actarrayType[GAZEBO_PR2ARRAY_MAX_NUM_ACTUATORS];
-
- };
-
-/** \} */
-/// \}
-
-
-}
-
-#endif
-
Deleted: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Pr2_Gripper.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Pr2_Gripper.hh 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Pr2_Gripper.hh 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,101 +0,0 @@
-/*
- * Gazebo - Outdoor Multi-Robot Simulator
- * Copyright (C) 2003
- * Nate Koenig & Andrew Howard
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-/*
- * Desc: Controller for a pr2 gripper
- * Author: Nathan Koenig
- * Date: 01 Feb 2007
- * SVN: $Id$
- */
-#ifndef PR2_GRIPPER_HH
-#define PR2_GRIPPER_HH
-
-#include <gazebo/Controller.hh>
-#include <gazebo/Entity.hh>
-#include <pr2Core/pr2Core.h>
-
-namespace gazebo
-{
- class SliderJoint;
- class PR2GripperIface;
-
- /// \addtogroup gazebo_controller
- /// \{
- /** \defgroup pr2_gripper pr2_gripper
-
- \brief Pr 2 Position2D controller.
-
- This is a controller that simulates a Pr 2 Gripper
-
- \verbatim
- <controller:pr2_gripper name="controller-name">
- <leftJoint>left-joint-name</leftJoint>
- <rightJoint>right-join-name</rightJoint>
- <interface:position name="iface-name"/>
- </controller:pr2_gripper>
- \endverbatim
-
- \{
- */
-
- /// \brief Pr 2 DX Position2D controller.
- /// This is a controller that simulates a Pr 2 motion
- class Pr2_Gripper : public Controller
- {
- /// Constructor
- public: Pr2_Gripper(Entity *parent);
-
- /// Destructor
- public: virtual ~Pr2_Gripper();
-
- /// Load the controller
- /// \param node XML config node
- /// \return 0 on success
- protected: virtual void LoadChild(XMLConfigNode *node);
-
- /// Init the controller
- /// \return 0 on success
- protected: virtual void InitChild();
-
- /// Update the controller
- /// \return 0 on success
- protected: virtual void UpdateChild();
-
- /// Finalize the controller
- /// \return 0 on success
- protected: virtual void FiniChild();
-
- /// The Position interface
- private: PR2GripperIface *myIface;
-
- /// The parent Model
- private: Model *myParent;
-
- private: SliderJoint *joints[2];
-
- };
-
- /** \} */
- /// \}
-
-}
-
-#endif
-
Deleted: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/test_actuators.h
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/test_actuators.h 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/test_actuators.h 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the Willow Garage, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef TEST_ACTUATORS_H
-#define TEST_ACTUATORS_H
-
-#include <vector>
-#include <gazebo/Controller.hh>
-#include <gazebo/Entity.hh>
-#include <gazebo/Model.hh>
-
-#include <generic_controllers/joint_position_controller.h>
-#include <generic_controllers/joint_velocity_controller.h>
-
-#include <pr2_controllers/arm_position_controller.h>
-#include <pr2_controllers/base_controller.h>
-#include <pr2_controllers/laser_scanner_controller.h>
-#include "hardware_interface/hardware_interface.h"
-#include <mechanism_control/mechanism_control.h>
-
-//#include <rosTF/rosTF.h>
-//#include <ros/node.h>
-
-// ros messages
-//#include <std_msgs/PR2Arm.h>
-//#include <pr2_msgs/EndEffectorState.h>
-
-// Advait and Gil's cartesian services
-//#include <gazebo_plugin/MoveCartesian.h>
-//#include <gazebo_plugin/GripperCmd.h>
-
-namespace gazebo
-{
-class HingeJoint;
-class PositionIface;
-class XMLConfigNode;
-
-class TestActuators : public gazebo::Controller
-{
-public:
- TestActuators(Entity *parent);
- virtual ~TestActuators();
-
-protected:
- // Inherited from gazebo::Controller
- virtual void LoadChild(XMLConfigNode *node);
- virtual void InitChild();
- virtual void UpdateChild();
- virtual void FiniChild();
-
- // Callbacks for subscribed messages
- //void CmdLeftarmconfigReceived();
- //void CmdRightarmconfigReceived();
- //void CmdLeftarmcartesianReceived();
- //void CmdRightarmcartesianReceived();
-#if 0
- bool reset_IK_guess(gazebo_plugin::VoidVoid::request &req, gazebo_plugin::VoidVoid::response &res);
- bool SetRightArmCartesian(gazebo_plugin::MoveCartesian::request &req, gazebo_plugin::MoveCartesian::response &res);
- bool OperateRightGripper(gazebo_plugin::GripperCmd::request &req, gazebo_plugin::GripperCmd::response &res);
- // arm joint data
- std_msgs::PR2Arm leftarm;
- std_msgs::PR2Arm rightarm;
-
- // end effector cmds
- pr2_msgs::EndEffectorState cmd_leftarmcartesian;
- pr2_msgs::EndEffectorState cmd_rightarmcartesian;
-
- // need newRightArmPos, UpdateRightArm(), etc...
-
-#endif
-
-private:
-
- Model *parent_model_;
-
- //---------------------------------------------------------------------
- // for mechanism control
- //---------------------------------------------------------------------
- MechanismControl mc_;
- MechanismControlNode mcn_;
-
- mechanism::RobotState *fake_state_;
-
-
- void LoadMC(XMLConfigNode *node);
- void UpdateMC();
- void UpdateMCJoints();
- void UpdateGazeboJoints();
-
- // for the mechanism control code loading xml
- //std::string interface; // xml filename for the hardware interface
- //std::string xml_file; // xml filename for the robot
- //TiXmlElement *root;
-
- HardwareInterface hw_;
-
- //---------------------------------------------------------------------
- // --
- // BELOW IS JOHN'S VERSION OF MECHANISM CONTROL, WAITING ... FOR --
- // THE ACTUAL ONE TO BE FUNCTIONAL. --
- // --
- //---------------------------------------------------------------------
- // Ioan's ultimate parser
- //robot_desc::URDF pr2Description;
- //std::vector<robot_desc::URDF::Link*> pr2Links;
-
- // for storing pr2 xml
- //mechanism::Robot* mech_robot_;
-
- // for storing reverse transmission results
- //mechanism::Robot* reverse_mech_robot_;
-
- //std_msgs::PR2Arm larm,rarm;
-
- // for storing controller xml
- struct Gazebo_joint_
- {
- std::string* name_;
- std::vector<gazebo::Joint*> gaz_joints_;
- mechanism::JointState* fake_joint_state_;
- double saturationTorque;
- double explicitDampingCoefficient;
- };
- std::vector<Gazebo_joint_*> gazebo_joints_;
- double currentTime;
- double lastTime;
-
-};
-
-}
-
-#endif
-
Deleted: pkg/trunk/drivers/simulator/gazebo_plugin/src/Pr2_Actarray.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Pr2_Actarray.cc 2008-09-21 08:05:52 UTC (rev 4542)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Pr2_Actarray.cc 2008-09-22 17:50:12 UTC (rev 4543)
@@ -1,701 +0,0 @@
-/*
- * Gazebo - Outdoor Multi-Robot Simulator
- * Copyright (C) 2003
- * Nate Koenig & Andrew Howard
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-/*
- * Desc: Actuator array controller for a Pr2 robot.
- * Author: Sachin Chitta and John Hsu
- * Date: 1 June 2008
- * SVN info: $Id$
- */
-
-#include <gazebo/Global.hh>
-#include <gazebo/XMLConfig.hh>
-#include <gazebo/Model.hh>
-#include <gazebo/HingeJoint.hh>
-#include <gazebo/SliderJoint.hh>
-#include <gazebo/Simulator.hh>
-#include <gazebo/gazebo.h>
-#include <gazebo/GazeboError.hh>
-#include <gazebo/ControllerFactory.hh>
-#include <fstream>
-#include <iostream>
-
-#include <gazebo_plugin/Pr2_Actarray.hh>
-#include <math.h>
-
-#include <unistd.h>
-
-using namespace gazebo;
-using namespace PR2;
-
-
-//GZ_REGISTER_STATIC_CONTROLLER("pr2_actarray", Pr2_Actarray);
-GZ_REGISTER_DYNAMIC_CONTROLLER("pr2_actarray", Pr2_Actarray);
-
-double ModNPi2Pi(double angle)
-{
- double theta = angle - ((int)(angle/(2*M_PI))*2*M_PI);
- //double theta = fmod(angle,2*M_PI);
- double result = theta;
-
- if (theta > M_PI)
- result = theta - 2*M_PI;
- if(theta < -M_PI)
- result = theta + 2*M_PI;
-
- return result;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Constructor
-//
-////////////////////////////////////////////////////////////////////////////////
-Pr2_Actarray::Pr2_Actarray(Entity *parent )
- : Controller(parent)
-{
-
- this->myParent = dynamic_cast<Model*>(this->parent);
-
- if (!this->myParent)
- gzthrow("Pr2_Actarray controller requires a Model as its parent");
-
-
-
-
-
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Destructor
-//
-////////////////////////////////////////////////////////////////////////////////
-Pr2_Actarray::~Pr2_Actarray()
-{
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Load the controller
-//
-// loop through all joints
-// check joint type
-// initialize variables
-//
-////////////////////////////////////////////////////////////////////////////////
-void Pr2_Actarray::LoadChild(XMLConfigNode *node)
-{
- // gazebo pr2 actarray interface: connect and check
- // this->ifaces[0] is inherited from parent class
-
- XMLConfigNode *jNode;
- this->myIface = dynamic_cast<PR2ArrayIface*>(this->ifaces[0]);
- if (!this->myIface)
- gzthrow("Pr2_Actarray controller requires a Actarray Iface");
-
- SliderJoint *sjoint;
- HingeJoint *hjoint;
-
- // get children of the actarray, add to actuators object list
- int count =0;
- for (jNode = node->GetChild("joint"); jNode ;)
- {
- // add each child
- //actuators.AddJoint();
-
- // get name of each child, e.g. front_left_caster_steer
- actarrayName[count] = jN...
[truncated message content] |
|
From: <jl...@us...> - 2008-09-22 18:46:36
|
Revision: 4549
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4549&view=rev
Author: jleibs
Date: 2008-09-22 18:46:22 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
Changing hokuyourg_player to hokuyourg_node, which is a more appropriate name given the node code no longer depends on player.
Modified Paths:
--------------
pkg/trunk/drivers/robot/sensor_cart/color_sensors.xml
pkg/trunk/drivers/robot/sensor_cart/manifest.xml
pkg/trunk/drivers/robot/sensor_cart/sensors.xml
pkg/trunk/hardware_test/qualification/manifest.xml
pkg/trunk/hardware_test/qualification/src/qualification/tests/hokuyo_test/hokuyo_test.xml
pkg/trunk/vision/urg_ipdcmot/manifest.xml
Added Paths:
-----------
pkg/trunk/drivers/laser/hokuyourg_driver/
pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyourg_driver/COPYING.lib
pkg/trunk/drivers/laser/hokuyourg_driver/Makefile
pkg/trunk/drivers/laser/hokuyourg_driver/manifest.xml
pkg/trunk/drivers/laser/hokuyourg_driver/urg_laser.cc
pkg/trunk/drivers/laser/hokuyourg_driver/urg_laser.h
pkg/trunk/drivers/laser/hokuyourg_node/
pkg/trunk/drivers/laser/hokuyourg_node/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyourg_node/Makefile
pkg/trunk/drivers/laser/hokuyourg_node/hokuyourg_player.cc
pkg/trunk/drivers/laser/hokuyourg_node/manifest.xml
Removed Paths:
-------------
pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyourg_driver/COPYING.lib
pkg/trunk/drivers/laser/hokuyourg_driver/Makefile
pkg/trunk/drivers/laser/hokuyourg_driver/manifest.xml
pkg/trunk/drivers/laser/hokuyourg_driver/urg_laser.cc
pkg/trunk/drivers/laser/hokuyourg_driver/urg_laser.h
pkg/trunk/drivers/laser/hokuyourg_node/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyourg_node/Makefile
pkg/trunk/drivers/laser/hokuyourg_node/hokuyourg_player.cc
pkg/trunk/drivers/laser/hokuyourg_node/manifest.xml
pkg/trunk/drivers/laser/hokuyourg_player/
pkg/trunk/drivers/laser/urg_driver/
pkg/trunk/hardware_test/sensors/
Deleted: pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt
===================================================================
--- pkg/trunk/drivers/laser/urg_driver/CMakeLists.txt 2008-09-17 17:48:48 UTC (rev 4386)
+++ pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt 2008-09-22 18:46:22 UTC (rev 4549)
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-include(rosbuild)
-rospack(urg_driver)
-rospack_add_library(urg urg_laser.cc)
Copied: pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt (from rev 4548, pkg/trunk/drivers/laser/urg_driver/CMakeLists.txt)
===================================================================
--- pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt (rev 0)
+++ pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt 2008-09-22 18:46:22 UTC (rev 4549)
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(hokuyourg_driver)
+rospack_add_library(urg urg_laser.cc)
Deleted: pkg/trunk/drivers/laser/hokuyourg_driver/COPYING.lib
===================================================================
--- pkg/trunk/drivers/laser/urg_driver/COPYING.lib 2008-09-17 17:48:48 UTC (rev 4386)
+++ pkg/trunk/drivers/laser/hokuyourg_driver/COPYING.lib 2008-09-22 18:46:22 UTC (rev 4549)
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there i...
[truncated message content] |
|
From: <hsu...@us...> - 2008-09-22 22:10:26
|
Revision: 4557
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4557&view=rev
Author: hsujohnhsu
Date: 2008-09-22 22:10:14 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
added F3D force feedback groundtruth plugin for fingers.
update P3D to broadcast velocity as well, using new TransformWithRateStamped.msg.
Modified Paths:
--------------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml
pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/P3D.hh
pkg/trunk/drivers/simulator/gazebo_plugin/src/P3D.cc
pkg/trunk/nav/fake_localization/fake_localization.cpp
pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt
pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/controllers_gazebo.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/controllers_gazebo_headless.xml
pkg/trunk/simulators/rosstage/rosstage.cc
Added Paths:
-----------
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/F3D.hh
pkg/trunk/drivers/simulator/gazebo_plugin/src/F3D.cc
pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/actuators.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/groups.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/groups_collision.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/transmissions.xml
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -1,4 +1,5 @@
<launch>
+ <!--master auto="start"/-->
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -1,4 +1,5 @@
<launch>
+ <!--master auto="start"/-->
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -1,4 +1,5 @@
<launch>
+ <!--master auto="start"/-->
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -1,4 +1,5 @@
<launch>
+ <!--master auto="start"/-->
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_wg.xml"/>
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/willowMap.png 0.1" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -1,4 +1,5 @@
<launch>
+ <!--master auto="start"/-->
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_wg_headless.xml"/>
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/willowMap.png 0.1" respawn="false" output="screen" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -1,4 +1,5 @@
<launch>
+ <!--master auto="start"/-->
<group name="wg">
<include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_wg.xml"/>
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/willowMap.png 0.1" respawn="false" />
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/CMakeLists.txt 2008-09-22 22:10:14 UTC (rev 4557)
@@ -14,6 +14,7 @@
rospack_add_library(Ros_Time src/Ros_Time.cc)
rospack_add_library(Ros_PTZ src/Ros_PTZ.cc)
rospack_add_library(P3D src/P3D.cc)
+rospack_add_library(F3D src/F3D.cc)
rospack_add_library(gazebo_actuators src/gazebo_actuators.cpp)
# This target requires adding player to the manifest.xml.
Added: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/F3D.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/F3D.hh (rev 0)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/F3D.hh 2008-09-22 22:10:14 UTC (rev 4557)
@@ -0,0 +1,118 @@
+/*
+ * Gazebo - Outdoor Multi-Robot Simulator
+ * Copyright (C) 2003
+ * Nate Koenig & Andrew Howard
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+/*
+ * Desc: 3D position interface.
+ * Author: Sachin Chitta and John Hsu
+ * Date: 10 June 2008
+ * SVN: $Id$
+ */
+#ifndef F3D_HH
+#define F3D_HH
+
+#include <gazebo/Controller.hh>
+#include <gazebo/Entity.hh>
+
+#include <ros/node.h>
+#include <std_msgs/Pose3DStamped.h>
+#include <std_msgs/Vector3Stamped.h>
+
+namespace gazebo
+{
+ class PositionIface;
+
+/// \addtogroup gazebo_controller
+ /// \{
+ /** \defgroup F3D f3D
+
+ \brief F3D controller.
+
+ \verbatim
+ <controller:F3D name="controller-name">
+ <interface:actarray name="iface-name"/>
+ </controller:F3D>
+ \endverbatim
+
+ \{
+ */
+
+ /// \brief F3D controller
+ /// This is a controller that simulates a 6 dof position sensor
+ class F3D : public Controller
+ {
+ /// Constructor
+ public: F3D(Entity *parent );
+
+ /// Destructor
+ public: virtual ~F3D();
+
+ /// Load the controller
+ /// \param node XML config node
+ /// \return 0 on success
+ protected: virtual void LoadChild(XMLConfigNode *node);
+
+ /// Init the controller
+ /// \return 0 on success
+ protected: virtual void InitChild();
+
+ /// Update the controller
+ /// \return 0 on success
+ protected: virtual void UpdateChild();
+
+ /// Finalize the controller
+ /// \return 0 on success
+ protected: virtual void FiniChild();
+
+ /// The actarray interface
+ private: PositionIface *myIface;
+
+ /// The parent Model
+ private: Model *myParent;
+
+ private: Body *myBody; //Gazebo/ODE body
+
+
+
+ // added for ros message
+ // pointer to ros node
+ private: ros::node *rosnode;
+
+ // ros message
+ private: std_msgs::Vector3Stamped vector3Msg;
+
+ // topic name
+ private: std::string topicName;
+
+ // frame transform name, should match link name "map"
+ private: std::string frameName;
+
+ // A mutex to lock access to fields that are used in message callbacks
+ private: ros::thread::mutex lock;
+
+ };
+
+/** \} */
+/// \}
+
+
+}
+
+#endif
+
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/P3D.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/P3D.hh 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/P3D.hh 2008-09-22 22:10:14 UTC (rev 4557)
@@ -32,6 +32,7 @@
#include <ros/node.h>
#include <std_msgs/Pose3DStamped.h>
+#include <std_msgs/TransformWithRateStamped.h>
namespace gazebo
{
@@ -94,7 +95,7 @@
private: ros::node *rosnode;
// ros message
- private: std_msgs::Pose3DStamped poseMsg;
+ private: std_msgs::TransformWithRateStamped transformMsg;
// topic name
private: std::string topicName;
Added: pkg/trunk/drivers/simulator/gazebo_plugin/src/F3D.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/F3D.cc (rev 0)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/F3D.cc 2008-09-22 22:10:14 UTC (rev 4557)
@@ -0,0 +1,154 @@
+/*
+ * Gazebo - Outdoor Multi-Robot Simulator
+ * Copyright (C) 2003
+ * Nate Koenig & Andrew Howard
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+/*
+ * Desc: 3D position interface for ground truth.
+ * Author: Sachin Chitta and John Hsu
+ * Date: 1 June 2008
+ * SVN info: $Id$
+ */
+
+#include <gazebo/Global.hh>
+#include <gazebo/XMLConfig.hh>
+#include <gazebo/Model.hh>
+#include <gazebo/HingeJoint.hh>
+#include <gazebo/Body.hh>
+#include <gazebo/SliderJoint.hh>
+#include <gazebo/Simulator.hh>
+#include <gazebo/gazebo.h>
+#include <gazebo/GazeboError.hh>
+#include <gazebo/ControllerFactory.hh>
+#include <gazebo_plugin/F3D.hh>
+
+using namespace gazebo;
+
+GZ_REGISTER_DYNAMIC_CONTROLLER("F3D", F3D);
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Constructor
+F3D::F3D(Entity *parent )
+ : Controller(parent)
+{
+ this->myParent = dynamic_cast<Model*>(this->parent);
+
+ if (!this->myParent)
+ gzthrow("F3D controller requires a Model as its parent");
+
+ rosnode = ros::g_node; // comes from where?
+ int argc = 0;
+ char** argv = NULL;
+ if (rosnode == NULL)
+ {
+ // this only works for a single camera.
+ ros::init(argc,argv);
+ rosnode = new ros::node("ros_gazebo",ros::node::DONT_HANDLE_SIGINT);
+ printf("-------------------- starting node in F3D \n");
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Destructor
+F3D::~F3D()
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Load the controller
+void F3D::LoadChild(XMLConfigNode *node)
+{
+ this->myIface = dynamic_cast<PositionIface*>(this->ifaces[0]);
+
+ if (!this->myIface)
+ gzthrow("F3D controller requires a Actarray Iface");
+
+ std::string bodyName = node->GetString("bodyName", "", 1);
+ this->myBody = dynamic_cast<Body*>(this->myParent->GetBody(bodyName));
+// this->myBody = dynamic_cast<Body*>(this->myParent->GetBody(bodyName));
+
+ this->topicName = node->GetString("topicName", "", 1);
+ this->frameName = node->GetString("frameName", "", 1);
+
+ std::cout << "==== topic name for F3D ======== " << this->topicName << std::endl;
+ rosnode->advertise<std_msgs::Vector3Stamped>(this->topicName);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Initialize the controller
+void F3D::InitChild()
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Update the controller
+void F3D::UpdateChild()
+{
+ Vector3 torque;
+ Vector3 force;
+
+ // get force on body
+ force = this->myBody->GetForce();
+
+ // get torque on body
+ torque = this->myBody->GetTorque();
+
+ this->myIface->Lock(1);
+ this->myIface->data->head.time = Simulator::Instance()->GetSimTime();
+
+ this->myIface->data->pose.pos.x = force.x;
+ this->myIface->data->pose.pos.y = force.y;
+ this->myIface->data->pose.pos.z = force.z;
+
+ this->myIface->data->pose.roll = torque.x;
+ this->myIface->data->pose.pitch = torque.y;
+ this->myIface->data->pose.yaw = torque.z;
+
+ //FIXME: toque not published, need new message type of new topic name for torque
+ //FIXME: use name space of body id (link name)?
+ this->lock.lock();
+ // copy data into pose message
+ this->vector3Msg.header.frame_id = this->frameName;
+ this->vector3Msg.header.stamp.sec = (unsigned long)floor(this->myIface->data->head.time);
+ this->vector3Msg.header.stamp.nsec = (unsigned long)floor( 1e9 * ( this->myIface->data->head.time - this->vector3Msg.header.stamp.sec) );
+
+ this->vector3Msg.vector.x = force.x;
+ this->vector3Msg.vector.y = force.y;
+ this->vector3Msg.vector.z = force.z;
+
+ // publish to ros
+ rosnode->publish(this->topicName,this->vector3Msg);
+ this->lock.unlock();
+
+ this->myIface->Unlock();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Finalize the controller
+void F3D::FiniChild()
+{
+ // TODO: will be replaced by global ros node eventually
+ if (rosnode != NULL)
+ {
+ std::cout << "shutdown rosnode in F3D" << std::endl;
+ //ros::fini();
+ rosnode->shutdown();
+ //delete rosnode;
+ }
+}
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/P3D.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/P3D.cc 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/P3D.cc 2008-09-22 22:10:14 UTC (rev 4557)
@@ -89,7 +89,7 @@
this->rpyOffsets = node->GetVector3("rpyOffsets", Vector3(0,0,0));
std::cout << "==== topic name for P3D ======== " << this->topicName << std::endl;
- rosnode->advertise<std_msgs::Pose3DStamped>(this->topicName);
+ rosnode->advertise<std_msgs::TransformWithRateStamped>(this->topicName);
}
////////////////////////////////////////////////////////////////////////////////
@@ -127,30 +127,38 @@
this->myIface->data->pose.pitch = rot.GetPitch();
this->myIface->data->pose.yaw = rot.GetYaw();
+ // get Rates
+ Vector3 vpos = this->myBody->GetPositionRate(); // get velocity in gazebo frame
+ Quatern vrot = this->myBody->GetRotationRate(); // get velocity in gazebo frame
-
this->lock.lock();
// copy data into pose message
- this->poseMsg.header.frame_id = this->frameName;
- this->poseMsg.header.stamp.sec = (unsigned long)floor(this->myIface->data->head.time);
- this->poseMsg.header.stamp.nsec = (unsigned long)floor( 1e9 * ( this->myIface->data->head.time - this->poseMsg.header.stamp.sec) );
+ this->transformMsg.header.frame_id = this->frameName;
+ this->transformMsg.header.stamp.sec = (unsigned long)floor(this->myIface->data->head.time);
+ this->transformMsg.header.stamp.nsec = (unsigned long)floor( 1e9 * ( this->myIface->data->head.time - this->transformMsg.header.stamp.sec) );
- this->poseMsg.pose3D.position.x = pos.x;
- this->poseMsg.pose3D.position.y = pos.y;
- this->poseMsg.pose3D.position.z = pos.z;
+ this->transformMsg.transform.translation.x = pos.x;
+ this->transformMsg.transform.translation.y = pos.y;
+ this->transformMsg.transform.translation.z = pos.z;
- this->poseMsg.pose3D.orientation.x = rot.x;
- this->poseMsg.pose3D.orientation.y = rot.y;
- this->poseMsg.pose3D.orientation.z = rot.z;
- this->poseMsg.pose3D.orientation.w = rot.u;
+ this->transformMsg.transform.rotation.x = rot.x;
+ this->transformMsg.transform.rotation.y = rot.y;
+ this->transformMsg.transform.rotation.z = rot.z;
+ this->transformMsg.transform.rotation.w = rot.u;
+ this->transformMsg.rate.translation.x = vpos.x;
+ this->transformMsg.rate.translation.y = vpos.y;
+ this->transformMsg.rate.translation.z = vpos.z;
+
+ this->transformMsg.rate.rotation.x = vrot.x;
+ this->transformMsg.rate.rotation.y = vrot.y;
+ this->transformMsg.rate.rotation.z = vrot.z;
+ this->transformMsg.rate.rotation.w = vrot.u;
+
// publish to ros
- rosnode->publish(this->topicName,this->poseMsg);
+ rosnode->publish(this->topicName,this->transformMsg);
this->lock.unlock();
-
-
-
this->myIface->Unlock();
}
Modified: pkg/trunk/nav/fake_localization/fake_localization.cpp
===================================================================
--- pkg/trunk/nav/fake_localization/fake_localization.cpp 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/nav/fake_localization/fake_localization.cpp 2008-09-22 22:10:14 UTC (rev 4557)
@@ -54,7 +54,7 @@
@section topic ROS topics
Subscribes to (name/type):
-- @b "base_pose_gazebo_ground_truth"/Pose3DEulerFloat32 : robot's odometric pose. Only the position information is used (velocity is ignored).
+- @b "base_pose_ground_truth"/Pose3DEulerFloat32 : robot's odometric pose. Only the position information is used (velocity is ignored).
- @b "initialpose"/Pose2DFloat32 : robot's odometric pose. Only the position information is used (velocity is ignored).
Publishes to (name / type):
@@ -73,6 +73,7 @@
#include <ros/time.h>
#include <std_msgs/RobotBase2DOdom.h>
+#include <std_msgs/TransformWithRateStamped.h>
#include <std_msgs/Pose3DStamped.h>
#include <std_msgs/ParticleCloud2D.h>
#include <std_msgs/Pose2DFloat32.h>
@@ -99,7 +100,7 @@
param("max_publish_frequency", m_maxPublishFrequency, 0.5);
- subscribe("base_pose_gazebo_ground_truth", m_basePosMsg, &FakeOdomNode::basePosReceived);
+ subscribe("base_pose_ground_truth", m_basePosMsg, &FakeOdomNode::basePosReceived);
subscribe("initialpose", m_iniPos, &FakeOdomNode::initialPoseReceived);
}
@@ -116,7 +117,7 @@
ros::Time m_lastUpdate;
double m_maxPublishFrequency;
- std_msgs::Pose3DStamped m_basePosMsg;
+ std_msgs::TransformWithRateStamped m_basePosMsg;
std_msgs::ParticleCloud2D m_particleCloud;
std_msgs::RobotBase2DOdom m_currentPos;
std_msgs::Pose2DFloat32 m_iniPos;
@@ -141,11 +142,23 @@
//since the msg uses Quaternion use libTF to get yaw
libTF::Pose3D pose;
- pose.setFromMessage(m_basePosMsg.pose3D);
+
+ // FIXME: temp work around during libtf upgrade transition
+ std_msgs::Pose3DStamped messagePose3D;
+ messagePose3D.header = m_basePosMsg.header;
+ messagePose3D.pose3D.position.x = m_basePosMsg.transform.translation.x;
+ messagePose3D.pose3D.position.y = m_basePosMsg.transform.translation.y;
+ messagePose3D.pose3D.position.z = m_basePosMsg.transform.translation.z;
+ messagePose3D.pose3D.orientation.x = m_basePosMsg.transform.rotation.x;
+ messagePose3D.pose3D.orientation.y = m_basePosMsg.transform.rotation.y;
+ messagePose3D.pose3D.orientation.z = m_basePosMsg.transform.rotation.z;
+ messagePose3D.pose3D.orientation.w = m_basePosMsg.transform.rotation.w;
+
+ pose.setFromMessage(messagePose3D.pose3D);
m_currentPos.header = m_basePosMsg.header;
- m_currentPos.pos.x = m_basePosMsg.pose3D.position.x;
- m_currentPos.pos.y = m_basePosMsg.pose3D.position.y;
+ m_currentPos.pos.x = m_basePosMsg.transform.translation.x;
+ m_currentPos.pos.y = m_basePosMsg.transform.translation.y;
m_currentPos.pos.th = pose.getEuler().yaw;
m_currentPos.pos.x += m_iniPos.x;
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt 2008-09-22 22:10:14 UTC (rev 4557)
@@ -21,12 +21,12 @@
add_custom_target(pr2_gazebo_model_headless ALL
COMMAND ${urdf2gazebo_exe} ${wg_robot_description_PACKAGE_PATH}/pr2/gazebo/pr2_gazebo_actuators_headless.xml ${gazebo_robot_description_PACKAGE_PATH}/world/pr2_xml_headless.model
DEPENDS urdf2gazebo
- COMMENT "Building Gazebo model for PR2 Test Actuators")
+ COMMENT "Building Gazebo model for PR2 Gazebo Actuators")
add_custom_target(pr2_gazebo_model_nolimit ALL
COMMAND ${urdf2gazebo_exe} ${wg_robot_description_PACKAGE_PATH}/pr2/gazebo/pr2_gazebo_actuators.xml ${gazebo_robot_description_PACKAGE_PATH}/world/pr2_xml_nolimit.model 1
DEPENDS urdf2gazebo
- COMMENT "Building Gazebo model for PR2 Test Actuators with no limits")
+ COMMENT "Building Gazebo model for PR2 Gazebo Actuators with no limits")
#pr2_arm
add_custom_target(pr2d2 ALL
Added: pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/actuators.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/actuators.xml (rev 0)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/actuators.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -0,0 +1 @@
+link ../actuators.xml
\ No newline at end of file
Property changes on: pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/actuators.xml
___________________________________________________________________
Added: svn:special
+ *
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/controllers_gazebo.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/controllers_gazebo.xml 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/controllers_gazebo.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -53,7 +53,7 @@
<updateRate>100.0</updateRate>
<bodyName>gripper_roll_right</bodyName>
<topicName>gripper_roll_right_pose_ground_truth</topicName>
- <frameName>gripper_roll_right_frame</frameName>
+ <frameName>map</frameName>
<interface:position name="p3d_right_wrist_position"/>
</controller:P3D>
@@ -62,22 +62,57 @@
<updateRate>100.0</updateRate>
<bodyName>gripper_roll_left</bodyName>
<topicName>gripper_roll_left_pose_ground_truth</topicName>
- <frameName>gripper_roll_left_frame</frameName>
+ <frameName>map</frameName>
<interface:position name="p3d_left_wrist_position"/>
</controller:P3D>
<controller:P3D name="p3d_base_controller" plugin="libP3D.so">
<alwaysOn>true</alwaysOn>
- <updateRate>1000.0</updateRate>
+ <updateRate>100.0</updateRate>
<bodyName>base</bodyName>
<topicName>base_pose_ground_truth</topicName>
- <frameName>base_frame</frameName>
+ <frameName>map</frameName>
<xyzOffsets>25.65 25.65 0</xyzOffsets> <!-- initialize odometry for fake localization-->
<rpyOffsets>0 0 0</rpyOffsets>
<interface:position name="p3d_base_position"/>
</controller:P3D>
+ <controller:F3D name="f3d_finger_tip_l_left_controller" plugin="libF3D.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>100.0</updateRate>
+ <bodyName>finger_tip_l_left</bodyName>
+ <topicName>finger_tip_l_left_ground_truth</topicName>
+ <frameName>map</frameName>
+ <interface:position name="f3d_finger_tip_l_left_position"/>
+ </controller:F3D>
+ <controller:F3D name="f3d_finger_tip_r_left_controller" plugin="libF3D.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>100.0</updateRate>
+ <bodyName>finger_tip_r_left</bodyName>
+ <topicName>finger_tip_r_left_ground_truth</topicName>
+ <frameName>map</frameName>
+ <interface:position name="f3d_finger_tip_r_left_position"/>
+ </controller:F3D>
+
+ <controller:F3D name="f3d_finger_tip_l_right_controller" plugin="libF3D.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>100.0</updateRate>
+ <bodyName>finger_tip_l_right</bodyName>
+ <topicName>finger_tip_l_right_ground_truth</topicName>
+ <frameName>map</frameName>
+ <interface:position name="f3d_finger_tip_l_right_position"/>
+ </controller:F3D>
+
+ <controller:F3D name="f3d_finger_tip_r_right_controller" plugin="libF3D.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>100.0</updateRate>
+ <bodyName>finger_tip_r_right</bodyName>
+ <topicName>finger_tip_r_right_ground_truth</topicName>
+ <frameName>map</frameName>
+ <interface:position name="f3d_finger_tip_r_right_position"/>
+ </controller:F3D>
+
</verbatim>
</map>
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/controllers_gazebo_headless.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/controllers_gazebo_headless.xml 2008-09-22 22:07:57 UTC (rev 4556)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/gazebo/controllers_gazebo_headless.xml 2008-09-22 22:10:14 UTC (rev 4557)
@@ -50,19 +50,19 @@
<!-- P3D for position groundtruth -->
<controller:P3D name="p3d_right_wrist_controller" plugin="libP3D.so">
<alwaysOn>true</alwaysOn>
- <updateRate>100.0</updateRate>
+ <updateRate>1000.0</updateRate>
<bodyName>gripper_roll_right</bodyName>
<topicName>gripper_roll_right_pose_ground_truth</topicName>
- <frameName>gripper_roll_right_frame</frameName>
+ <frameName>map</frameName>
<interface:position name="p3d_right_wrist_position"/>
</controller:P3D>
<controller:P3D name="p3d_left_wrist_controller" plugin="libP3D.so">
<alwaysOn>true</alwaysOn>
- <updateRate>100.0</updateRate>
+ <updateRate>1000.0</updateRate>
<bodyName>gripper_roll_left</bodyName>
<topicName>gripper_roll_left_pose_ground_truth</topicName>
- <frameName>gripper_roll_left_frame</frameName>
+ <frameName>map</frameName>
<interface:position name="p3d_left_wrist_position"/>
</controller:P3D>
@@ -71,13 +71,48 @@
<updateRate>1000.0</updateRate>
<bodyName>base</bodyName>
<topicName>base_pose_ground_truth</topicName>
- <frameName>base_frame</frameName>
+ <frameName>map</frameName>
<xyzOffsets>25.65 25.65 0</xyzOffsets> <!-- initialize odometry for fake localization-->
<rpyOffsets>0 0 0</rpyOffsets>
<interface:position name="p3d_base_position"/>
</controller:P3D>
+ <controller:F3D name="f3d_finger_tip_l_left_controller" plugin="libF3D.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>1000.0</updateRate>
+ <bodyName>finger_tip_l_left</bodyName>
+ <topicName>finger_tip_l_left_ground_truth</topicName>
+ <frameName>map</frameName>
+ <interface:position name="f3d_finger_tip_l_left_position"/>
+ </controller:F3D>
+ <controller:F3D name="f3d_finger_tip_r_left_controller" plugin="libF3D.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>1000.0</updateRate>
+ <bodyName>finger_tip_r_left</bodyName>
+ <topicName>finger_tip_r_left_ground_truth</topicName>
+ <frameName>map</frameName>
+ <interface:position name="f3d_finger_tip_r_left_position"/>
+ </controller:F3D>
+
+ <controller:F3D name="f3d_finger_tip_l_right_controller" plugin="libF3D.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>1000.0</updateRate>
+ <bodyName>finger_tip_l_right</bodyName>
+ <topicName>finger_tip_l_right_ground_truth</topicName>
+ <frameName>map</frameName>
+ <interface:position name="f3d_finger_tip_l_right_position"/>
+ </controller:F3D>
+
+ <controller:F3D name="f3d_finger_tip_r_right_controller" plugin="libF3D.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>1000.0</updateRate>
+ <bodyName>finger_tip_r_right</bodyName>
+ <topicName>finger_tip_r_right_ground_truth</topicName>
+ <frameName>map</frameName>
+ <interface:position name="f3d_finger_tip_r_right_position"/>
+ </controller:F3D>
+
</verbatim>
</m...
[truncated message content] |
|
From: <tf...@us...> - 2008-09-22 22:45:53
|
Revision: 4559
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4559&view=rev
Author: tfoote
Date: 2008-09-22 22:45:38 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
adding getFrameStrings to tf API for ticket:337
Modified Paths:
--------------
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Source/Include/swigconfig.h
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Source/Makefile.in
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/config.guess
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/config.sub
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/depcomp
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/install-sh
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/aclocal.m4
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/output.0
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/output.1
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/requests
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/traces.0
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/traces.1
pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/configure
pkg/trunk/demos/2dnav-stage/2dnav_stage.xml
pkg/trunk/util/tf/include/tf/tf.h
pkg/trunk/util/tf/src/tf.cpp
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Source/Include/swigconfig.h
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Source/Include/swigconfig.h 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Source/Include/swigconfig.h 2008-09-22 22:45:38 UTC (rev 4559)
@@ -68,7 +68,7 @@
#define SWIG_CXX "g++"
/* Directory for SWIG system-independent libraries */
-#define SWIG_LIB "/u/jfaust/ros/ros-pkg/3rdparty/wxswig/share/swig/1.3.29"
+#define SWIG_LIB "/u/tfoote/pkg-ros/3rdparty/wxswig/share/swig/1.3.29"
/* Platform that SWIG is built for */
#define SWIG_PLATFORM "i686-pc-linux-gnu"
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Source/Makefile.in
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Source/Makefile.in 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Source/Makefile.in 2008-09-22 22:45:38 UTC (rev 4559)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -807,8 +807,8 @@
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -820,8 +820,8 @@
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -831,12 +831,13 @@
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
+ here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/config.guess
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/config.guess 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/config.guess 2008-09-22 22:45:38 UTC (rev 4559)
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
-timestamp='2007-07-22'
+timestamp='2006-07-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -161,7 +161,6 @@
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
@@ -330,7 +329,7 @@
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
@@ -781,7 +780,7 @@
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
- *:MINGW*:*)
+ i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
@@ -791,15 +790,12 @@
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
- *:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T | authenticamd)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
+ x86:Interix*:[3456]*)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T:Interix*:[3456]*)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
@@ -954,9 +950,6 @@
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
- xtensa:Linux:*:*)
- echo xtensa-unknown-linux-gnu
- exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -1215,15 +1208,6 @@
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/config.sub
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/config.sub 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/config.sub 2008-09-22 22:45:38 UTC (rev 4559)
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
-timestamp='2007-06-28'
+timestamp='2006-09-20'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -245,12 +245,12 @@
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
- | fido | fr30 | frv \
+ | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep \
+ | maxq | mb | microblaze | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -324,7 +324,7 @@
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
@@ -475,8 +475,8 @@
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
- basic_machine=cr16-unknown
+ cr16c)
+ basic_machine=cr16c-unknown
os=-elf
;;
crds | unos)
@@ -683,10 +683,6 @@
basic_machine=i386-pc
os=-mingw32
;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
miniframe)
basic_machine=m68000-convergent
;;
@@ -929,9 +925,6 @@
basic_machine=sh-hitachi
os=-hms
;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
sh64)
basic_machine=sh64-unknown
;;
@@ -1226,7 +1219,7 @@
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku* | -rdos* | -toppers*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1421,9 +1414,6 @@
m68*-cisco)
os=-aout
;;
- mep-*)
- os=-elf
- ;;
mips*-cisco)
os=-elf
;;
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/depcomp
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/depcomp 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/depcomp 2008-09-22 22:45:38 UTC (rev 4559)
@@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2007-03-29.01
+scriptversion=2006-10-15.18
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -215,39 +215,34 @@
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$base.u
- tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$dir$base.u
- tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
if test $stat -eq 0; then :
else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ rm -f "$tmpdepfile"
exit $stat
fi
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/install-sh
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/install-sh 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/Tools/config/install-sh 2008-09-22 22:45:38 UTC (rev 4559)
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2006-12-25.00
+scriptversion=2006-10-14.15
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -48,7 +48,7 @@
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
+doit="${DOITPROG-}"
if test -z "$doit"; then
doit_exec=exec
else
@@ -58,49 +58,34 @@
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
+posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
-chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
+chgrpcmd=
stripcmd=
-
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
src=
dst=
dir_arg=
-dst_arg=
-
-copy_on_change=false
+dstarg=
no_target_directory=
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
@@ -110,55 +95,65 @@
In the 4th, create DIRECTORIES.
Options:
- --help display this help and exit.
- --version display version info and exit.
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
- -c) ;;
+ -c) shift
+ continue;;
- -C) copy_on_change=true;;
+ -d) dir_arg=true
+ shift
+ continue;;
- -d) dir_arg=true;;
-
-g) chgrpcmd="$chgrpprog $2"
- shift;;
+ shift
+ shift
+ continue;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
+ shift
+ shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
- shift;;
+ continue;;
-o) chowncmd="$chownprog $2"
- shift;;
+ shift
+ shift
+ continue;;
- -s) stripcmd=$stripprog;;
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
- -t) dst_arg=$2
- shift;;
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
- -T) no_target_directory=true;;
+ -T) no_target_directory=true
+ shift
+ continue;;
--version) echo "$0 $scriptversion"; exit $?;;
@@ -170,22 +165,21 @@
*) break;;
esac
- shift
done
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
- if test -n "$dst_arg"; then
+ if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
+ set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
- dst_arg=$arg
+ dstarg=$arg
done
fi
@@ -230,7 +224,7 @@
do
# Protect names starting with `-'.
case $src in
- -*) src=./$src;;
+ -*) src=./$src ;;
esac
if test -n "$dir_arg"; then
@@ -248,22 +242,22 @@
exit 1
fi
- if test -z "$dst_arg"; then
+ if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
- dst=$dst_arg
+ dst=$dstarg
# Protect names starting with `-'.
case $dst in
- -*) dst=./$dst;;
+ -*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
+ echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dstdir=$dst
@@ -384,19 +378,26 @@
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix='/';;
- -*) prefix='./';;
- *) prefix='';;
+ /*) prefix=/ ;;
+ -*) prefix=./ ;;
+ *) prefix= ;;
esac
- eval "$initialize_posix_glob"
+ case $posix_glob in
+ '')
+ if (set -f) 2>/dev/null; then
+ posix_glob=true
+ else
+ posix_glob=false
+ fi ;;
+ esac
oIFS=$IFS
IFS=/
- $posix_glob set -f
+ $posix_glob && set -f
set fnord $dstdir
shift
- $posix_glob set +f
+ $posix_glob && set +f
IFS=$oIFS
prefixes=
@@ -458,55 +459,42 @@
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dst"; then
+ $doit $rmcmd -f "$dst" 2>/dev/null \
+ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+ || {
+ echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ } || exit 1
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
trap '' 0
fi
done
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/aclocal.m4
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/aclocal.m4 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/aclocal.m4 2008-09-22 22:45:38 UTC (rev 4559)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.10 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2005, 2006 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,15 +11,12 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.61],,
-[m4_warning([this file was generated for autoconf 2.61.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+m4_if(m4_PACKAGE_VERSION, [2.61],,
+[m4_fatal([this file was generated for autoconf 2.61.
+You have another version of autoconf. If you want to use that,
+you should regenerate the build system entirely.], [63])])
-# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -34,7 +31,7 @@
[am__api_version='1.10'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.10.1], [],
+m4_if([$1], [1.10], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -50,10 +47,8 @@
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.1])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+[AM_AUTOMAKE_VERSION([1.10])dnl
+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
@@ -325,7 +320,7 @@
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
@@ -373,13 +368,13 @@
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008 Free Software Foundation, Inc.
+# 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 13
+# serial 12
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
@@ -484,17 +479,16 @@
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
-_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $_am_arg | $_am_arg:* )
+ $1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
@@ -800,7 +794,7 @@
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/output.0
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/output.0 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/output.0 2008-09-22 22:45:38 UTC (rev 4559)
@@ -11210,22 +11210,21 @@
fi
rm -f "$tmp/out12"
# Compute $ac_file's index in $config_headers.
-_am_arg=$ac_file
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $_am_arg | $_am_arg:* )
+ $ac_file | $ac_file:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$_am_arg" |
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -11262,7 +11261,7 @@
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/output.1
===================================================================
--- pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/output.1 2008-09-22 22:42:19 UTC (rev 4558)
+++ pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/output.1 2008-09-22 22:45:38 UTC (rev 4559)
@@ -11210,22 +11210,21 @@
fi
rm -f "$tmp/out12"
# Compute $ac_file's index in $config_headers.
-_am_arg=$ac_file
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $_am_arg | $_am_arg:* )
+ $ac_file | $ac_file:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$_am_arg" |
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -11262,7 +11261,7 @@
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
Modified: pkg/trunk/3rdparty/wxswig/SWIG-1.3.29-wx/autom4te.cache/requests
===================================================================
--- pkg/trunk/3rd...
[truncated message content] |
|
From: <hsu...@us...> - 2008-09-23 00:39:36
|
Revision: 4566
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4566&view=rev
Author: hsujohnhsu
Date: 2008-09-23 00:39:27 +0000 (Tue, 23 Sep 2008)
Log Message:
-----------
update advertise and subscribe with default queue length of 10.
Modified Paths:
--------------
pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller.cpp
pkg/trunk/drivers/simulator/gazebo_plugin/src/F3D.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/P3D.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_PTZ.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Time.cc
Modified: pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller.cpp
===================================================================
--- pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller.cpp 2008-09-22 23:10:31 UTC (rev 4565)
+++ pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller.cpp 2008-09-23 00:39:27 UTC (rev 4566)
@@ -561,10 +561,10 @@
node->advertise_service(prefix + "/set_command", &BaseControllerNode::setCommand, this);
node->advertise_service(prefix + "/get_actual", &BaseControllerNode::getCommand, this); //FIXME: this is actually get command, just returning command for testing.
- node->advertise<std_msgs::RobotBase2DOdom>("odom");
+ node->advertise<std_msgs::RobotBase2DOdom>("odom",10);
// receive messages from 2dnav stack
- node->subscribe("cmd_vel", baseVelMsg, &BaseControllerNode::CmdBaseVelReceived, this);
+ node->subscribe("cmd_vel", baseVelMsg, &BaseControllerNode::CmdBaseVelReceived, this,10);
// for publishing odometry frame transforms odom
this->tfs = new rosTFServer(*node); //, true, 1 * 1000000000ULL, 0ULL);
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/F3D.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/F3D.cc 2008-09-22 23:10:31 UTC (rev 4565)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/F3D.cc 2008-09-23 00:39:27 UTC (rev 4566)
@@ -87,7 +87,7 @@
this->frameName = node->GetString("frameName", "", 1);
std::cout << "==== topic name for F3D ======== " << this->topicName << std::endl;
- rosnode->advertise<std_msgs::Vector3Stamped>(this->topicName);
+ rosnode->advertise<std_msgs::Vector3Stamped>(this->topicName,10);
}
////////////////////////////////////////////////////////////////////////////////
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/P3D.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/P3D.cc 2008-09-22 23:10:31 UTC (rev 4565)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/P3D.cc 2008-09-23 00:39:27 UTC (rev 4566)
@@ -89,7 +89,7 @@
this->rpyOffsets = node->GetVector3("rpyOffsets", Vector3(0,0,0));
std::cout << "==== topic name for P3D ======== " << this->topicName << std::endl;
- rosnode->advertise<std_msgs::TransformWithRateStamped>(this->topicName);
+ rosnode->advertise<std_msgs::TransformWithRateStamped>(this->topicName,10);
}
////////////////////////////////////////////////////////////////////////////////
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc 2008-09-22 23:10:31 UTC (rev 4565)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc 2008-09-23 00:39:27 UTC (rev 4566)
@@ -96,7 +96,7 @@
this->topicName = node->GetString("topicName","default_ros_laser",0); //read from xml file
std::cout << "================= " << this->topicName << std::endl;
- rosnode->advertise<std_msgs::PointCloudFloat32>(this->topicName);
+ rosnode->advertise<std_msgs::PointCloudFloat32>(this->topicName,10);
this->frameName = node->GetString("frameName","default_ros_laser",0); //read from xml file
this->gaussianNoise = node->GetDouble("gaussianNoise",0.0,0); //read from xml file
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc 2008-09-22 23:10:31 UTC (rev 4565)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc 2008-09-23 00:39:27 UTC (rev 4566)
@@ -93,7 +93,7 @@
this->frameName = node->GetString("frameName","default_ros_camera",0); //read from xml file
std::cout << "================= " << this->topicName << std::endl;
- rosnode->advertise<std_msgs::Image>(this->topicName);
+ rosnode->advertise<std_msgs::Image>(this->topicName,10);
}
////////////////////////////////////////////////////////////////////////////////
@@ -135,13 +135,12 @@
// Finalize the controller
void Ros_Camera::FiniChild()
{
+ rosnode->unadvertise(this->topicName);
// TODO: will be replaced by global ros node eventually
if (rosnode != NULL)
{
std::cout << "shutdown rosnode in Ros_Camera" << std::endl;
- //ros::fini();
rosnode->shutdown();
- //delete rosnode;
}
}
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc 2008-09-22 23:10:31 UTC (rev 4565)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc 2008-09-23 00:39:27 UTC (rev 4566)
@@ -96,7 +96,7 @@
this->topicName = node->GetString("topicName","default_ros_laser",0); //read from xml file
std::cout << "================= " << this->topicName << std::endl;
- rosnode->advertise<std_msgs::LaserScan>(this->topicName);
+ rosnode->advertise<std_msgs::LaserScan>(this->topicName,10);
this->frameName = node->GetString("frameName","default_ros_laser",0); //read from xml file
this->gaussianNoise = node->GetDouble("gaussianNoise",0.0,0); //read from xml file
}
@@ -151,13 +151,12 @@
// Finalize the controller
void Ros_Laser::FiniChild()
{
+ rosnode->unadvertise(this->topicName);
// TODO: will be replaced by global ros node eventually
if (rosnode != NULL)
{
std::cout << "shutdown rosnode in Ros_Laser" << std::endl;
- //ros::fini();
rosnode->shutdown();
- //delete rosnode;
}
}
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_PTZ.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_PTZ.cc 2008-09-22 23:10:31 UTC (rev 4565)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_PTZ.cc 2008-09-23 00:39:27 UTC (rev 4566)
@@ -129,8 +129,8 @@
std::cout << " publishing state topic for ptz " << this->stateTopicName << std::endl;
std::cout << " subscribing command topic for ptz " << this->commandTopicName << std::endl;
- rosnode->advertise<axis_cam::PTZActuatorState>(this->stateTopicName);
- rosnode->subscribe( commandTopicName, PTZControlMessage, &Ros_PTZ::PTZCommandReceived,this);
+ rosnode->advertise<axis_cam::PTZActuatorState>(this->stateTopicName,10);
+ rosnode->subscribe( commandTopicName, PTZControlMessage, &Ros_PTZ::PTZCommandReceived,this,10);
if (!this->panJoint)
gzthrow("couldn't get pan hinge joint");
@@ -227,6 +227,12 @@
{
rosnode->unadvertise(this->stateTopicName);
rosnode->unsubscribe(commandTopicName);
+ // TODO: will be replaced by global ros node eventually
+ if (rosnode != NULL)
+ {
+ std::cout << "shutdown rosnode in Ros_PTZ" << std::endl;
+ rosnode->shutdown();
+ }
}
////////////////////////////////////////////////////////////////////////////////
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Time.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Time.cc 2008-09-22 23:10:31 UTC (rev 4565)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Time.cc 2008-09-23 00:39:27 UTC (rev 4566)
@@ -59,7 +59,7 @@
}
// for rostime
- rosnode_->advertise<rostools::Time>("time");
+ rosnode_->advertise<rostools::Time>("time",10);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jl...@us...> - 2008-09-23 02:15:39
|
Revision: 4583
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4583&view=rev
Author: jleibs
Date: 2008-09-23 02:15:27 +0000 (Tue, 23 Sep 2008)
Log Message:
-----------
Moving hokuyo one more time to reflect correct naming.
Also, cleaning up code to conform to cpp style guide.
Modified Paths:
--------------
pkg/trunk/drivers/robot/sensor_cart/color_sensors.xml
pkg/trunk/drivers/robot/sensor_cart/manifest.xml
pkg/trunk/drivers/robot/sensor_cart/sensors.xml
pkg/trunk/hardware_test/qualification/manifest.xml
pkg/trunk/hardware_test/qualification/src/qualification/tests/hokuyo_test/hokuyo_test.py
pkg/trunk/hardware_test/qualification/src/qualification/tests/hokuyo_test/hokuyo_test.xml
pkg/trunk/vision/urg_ipdcmot/manifest.xml
Added Paths:
-----------
pkg/trunk/drivers/laser/hokuyo_utm_driver/
pkg/trunk/drivers/laser/hokuyo_utm_driver/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyo_utm_driver/COPYING.lib
pkg/trunk/drivers/laser/hokuyo_utm_driver/Makefile
pkg/trunk/drivers/laser/hokuyo_utm_driver/hokuyo_utm.cpp
pkg/trunk/drivers/laser/hokuyo_utm_driver/hokuyo_utm.h
pkg/trunk/drivers/laser/hokuyo_utm_driver/manifest.xml
pkg/trunk/drivers/laser/hokuyo_utm_node/
pkg/trunk/drivers/laser/hokuyo_utm_node/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyo_utm_node/Makefile
pkg/trunk/drivers/laser/hokuyo_utm_node/manifest.xml
Removed Paths:
-------------
pkg/trunk/drivers/laser/hokuyo_utm_driver/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyo_utm_driver/COPYING.lib
pkg/trunk/drivers/laser/hokuyo_utm_driver/Makefile
pkg/trunk/drivers/laser/hokuyo_utm_driver/manifest.xml
pkg/trunk/drivers/laser/hokuyo_utm_driver/urg_laser.cc
pkg/trunk/drivers/laser/hokuyo_utm_driver/urg_laser.h
pkg/trunk/drivers/laser/hokuyo_utm_node/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyo_utm_node/Makefile
pkg/trunk/drivers/laser/hokuyo_utm_node/hokuyourg_player.cc
pkg/trunk/drivers/laser/hokuyo_utm_node/manifest.xml
pkg/trunk/drivers/laser/hokuyourg_driver/
pkg/trunk/drivers/laser/hokuyourg_node/
Deleted: pkg/trunk/drivers/laser/hokuyo_utm_driver/CMakeLists.txt
===================================================================
--- pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt 2008-09-22 18:46:22 UTC (rev 4549)
+++ pkg/trunk/drivers/laser/hokuyo_utm_driver/CMakeLists.txt 2008-09-23 02:15:27 UTC (rev 4583)
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-include(rosbuild)
-rospack(hokuyourg_driver)
-rospack_add_library(urg urg_laser.cc)
Copied: pkg/trunk/drivers/laser/hokuyo_utm_driver/CMakeLists.txt (from rev 4581, pkg/trunk/drivers/laser/hokuyourg_driver/CMakeLists.txt)
===================================================================
--- pkg/trunk/drivers/laser/hokuyo_utm_driver/CMakeLists.txt (rev 0)
+++ pkg/trunk/drivers/laser/hokuyo_utm_driver/CMakeLists.txt 2008-09-23 02:15:27 UTC (rev 4583)
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(hokuyo_utm_driver)
+rospack_add_library(hokuyoutm hokuyo_utm.cpp)
Deleted: pkg/trunk/drivers/laser/hokuyo_utm_driver/COPYING.lib
===================================================================
--- pkg/trunk/drivers/laser/hokuyourg_driver/COPYING.lib 2008-09-22 18:46:22 UTC (rev 4549)
+++ pkg/trunk/drivers/laser/hokuyo_utm_driver/COPYING.lib 2008-09-23 02:15:27 UTC (rev 4583)
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty C...
[truncated message content] |
|
From: <jl...@us...> - 2008-09-23 17:00:03
|
Revision: 4591
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4591&view=rev
Author: jleibs
Date: 2008-09-23 16:59:47 +0000 (Tue, 23 Sep 2008)
Log Message:
-----------
Deeper reflection has revealed hokuyo_utm was also not an appropriate name.
I've now truncated to hokuyo_driver and hokuyo_node in light of the fact
that the driver is compatible with all recent (SCIP2.0-compliant) Hokuyo
laser range-finder devices.
Modified Paths:
--------------
pkg/trunk/drivers/laser/hokuyo_driver/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyo_driver/manifest.xml
pkg/trunk/drivers/laser/hokuyo_node/CMakeLists.txt
pkg/trunk/drivers/laser/hokuyo_node/manifest.xml
pkg/trunk/drivers/robot/sensor_cart/color_sensors.xml
pkg/trunk/drivers/robot/sensor_cart/manifest.xml
pkg/trunk/drivers/robot/sensor_cart/sensors.xml
pkg/trunk/hardware_test/qualification/manifest.xml
pkg/trunk/hardware_test/qualification/src/qualification/tests/hokuyo_test/hokuyo_test.py
pkg/trunk/hardware_test/qualification/src/qualification/tests/hokuyo_test/hokuyo_test.xml
pkg/trunk/vision/urg_ipdcmot/manifest.xml
Added Paths:
-----------
pkg/trunk/drivers/laser/hokuyo_driver/
pkg/trunk/drivers/laser/hokuyo_driver/hokuyo.cpp
pkg/trunk/drivers/laser/hokuyo_driver/hokuyo.h
pkg/trunk/drivers/laser/hokuyo_node/
pkg/trunk/drivers/laser/hokuyo_node/hokuyo_node.cpp
Removed Paths:
-------------
pkg/trunk/drivers/laser/hokuyo_driver/hokuyo_utm.cpp
pkg/trunk/drivers/laser/hokuyo_driver/hokuyo_utm.h
pkg/trunk/drivers/laser/hokuyo_utm_driver/
pkg/trunk/drivers/laser/hokuyo_utm_node/
Modified: pkg/trunk/drivers/laser/hokuyo_driver/CMakeLists.txt
===================================================================
--- pkg/trunk/drivers/laser/hokuyo_utm_driver/CMakeLists.txt 2008-09-23 02:15:27 UTC (rev 4583)
+++ pkg/trunk/drivers/laser/hokuyo_driver/CMakeLists.txt 2008-09-23 16:59:47 UTC (rev 4591)
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
include(rosbuild)
-rospack(hokuyo_utm_driver)
-rospack_add_library(hokuyoutm hokuyo_utm.cpp)
+rospack(hokuyo_driver)
+rospack_add_library(hokuyo hokuyo.cpp)
Copied: pkg/trunk/drivers/laser/hokuyo_driver/hokuyo.cpp (from rev 4583, pkg/trunk/drivers/laser/hokuyo_utm_driver/hokuyo_utm.cpp)
===================================================================
--- pkg/trunk/drivers/laser/hokuyo_driver/hokuyo.cpp (rev 0)
+++ pkg/trunk/drivers/laser/hokuyo_driver/hokuyo.cpp 2008-09-23 16:59:47 UTC (rev 4591)
@@ -0,0 +1,754 @@
+/*
+ * Player - One Hell of a Robot Server
+ * Copyright (C) 2008 Willow Garage
+ *
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#include <stdio.h>
+#include <errno.h>
+#include <termios.h>
+#include <math.h>
+#include <poll.h>
+
+#include "hokuyo.h"
+
+#include <time.h>
+
+#if POSIX_TIMERS <= 0
+#include <sys/time.h>
+#endif
+
+
+//! Macro for throwing an exception with a message
+#define HOKUYO_EXCEPT(except, msg) \
+ { \
+ char buf[100]; \
+ snprintf(buf, 100, "hokuyo::Laser::%s: " msg, __FUNCTION__); \
+ throw except(buf); \
+ }
+
+//! Macro for throwing an exception with a message, passing args
+#define HOKUYO_EXCEPT_ARGS(except, msg, ...) \
+ { \
+ char buf[100]; \
+ snprintf(buf, 100, "hokuyo::laser::%s: " msg, __FUNCTION__, __VA_ARGS__); \
+ throw except(buf); \
+ }
+
+
+//! Helper function for querying the system time
+static unsigned long long timeHelper()
+{
+#if POSIX_TIMERS > 0
+ struct timespec curtime;
+ clock_gettime(CLOCK_REALTIME, &curtime);
+ return (unsigned long long)(curtime.tv_sec) * 1000000000 + (unsigned long long)(curtime.tv_nsec);
+#else
+ struct timeval timeofday;
+ gettimeofday(&timeofday,NULL);
+ return (unsigned long long)(timeofday.tv_sec) * 1000000000 + (unsigned long long)(timeofday.tv_usec) * 1000;
+#endif
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+hokuyo::Laser::Laser() :
+ dmin_(0), dmax_(0), ares_(0), amin_(0), amax_(0), afrt_(0), rate_(0),
+ wrapped_(0), last_time_(0), offset_(0),
+ laser_port_(NULL), laser_fd_(-1)
+{ }
+
+
+///////////////////////////////////////////////////////////////////////////////
+hokuyo::Laser::~Laser ()
+{
+ if (portOpen())
+ close();
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+void
+hokuyo::Laser::open(const char * port_name, bool use_serial, int baud)
+{
+ if (portOpen())
+ close();
+
+ laser_port_ = fopen(port_name, "r+");
+ if (laser_port_ == NULL)
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "Failed to open port: %s -- error = %d: %s", port_name, errno, strerror(errno));
+
+ try
+ {
+
+ laser_fd_ = fileno (laser_port_);
+ if (laser_fd_ == -1)
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "Failed to get file descriptor -- error = %d: %s", errno, strerror(errno));
+
+ int bauds[] = {B115200, B57600, B19200};
+
+ if (use_serial)
+ {
+ int i = 0;
+ for (i = 0; i < 3; i++) {
+ if (changeBaud(bauds[i], baud, 100))
+ break;
+ }
+ if (i == 3)
+ HOKUYO_EXCEPT(hokuyo::Exception, "Failed to connect at any baud rate");
+ }
+ else
+ {
+ // Settings for USB?
+ struct termios newtio;
+ memset (&newtio, 0, sizeof (newtio));
+ newtio.c_cflag = CS8 | CLOCAL | CREAD;
+ newtio.c_iflag = IGNPAR;
+ newtio.c_oflag = 0;
+ newtio.c_lflag = ICANON;
+
+ // activate new settings
+ tcflush (laser_fd_, TCIFLUSH);
+ tcsetattr (laser_fd_, TCSANOW, &newtio);
+ usleep (200000);
+ }
+
+ // Just in case a previous failure mode has left our Hokuyo
+ // spewing data, we send the TM2 and QT commands to be safe.
+ laserFlush();
+ sendCmd("TM2", 1000);
+ sendCmd("QT", 1000);
+ laserFlush();
+
+ querySensorConfig();
+
+ }
+ catch (hokuyo::Exception& e)
+ {
+ // These exceptions mean something failed on open and we should close
+ if (laser_port_ != NULL)
+ fclose(laser_port_);
+ laser_port_ = NULL;
+ laser_fd_ = -1;
+ throw e;
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+void
+hokuyo::Laser::close ()
+{
+ int retval = 0;
+
+ if (portOpen()) {
+ //Try to be a good citizen and turn off the laser before we shutdown communication
+ try
+ {
+ sendCmd("QT",1000);
+ laserFlush();
+ }
+ catch (hokuyo::Exception& e) {
+ //Exceptions here can be safely ignored since we are closing the port anyways
+ }
+
+ retval = fclose(laser_port_);
+ }
+
+ laser_port_ = NULL;
+ laser_fd_ = -1;
+
+ if (retval != 0)
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "Failed to close port properly -- error = %d: %s\n", errno, strerror(errno));
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+int
+hokuyo::Laser::sendCmd(const char* cmd, int timeout)
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ char buf[100];
+
+ laserWrite(cmd);
+ laserWrite("\n");
+
+ laserReadlineAfter(buf, 100, cmd, timeout);
+ laserReadline(buf,100,timeout);
+
+ if (!checkSum(buf,4))
+ HOKUYO_EXCEPT(hokuyo::CorruptedDataException, "Checksum failed on status code.");
+
+ buf[2] = 0;
+
+ if (buf[0] - '0' >= 0 && buf[0] - '0' <= 9 && buf[1] - '0' >= 0 && buf[1] - '0' <= 9)
+ return (buf[0] - '0')*10 + (buf[1] - '0');
+ else
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "Hokuyo error code returned. Cmd: %s -- Error: %s", cmd, buf);
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+int
+hokuyo::Laser::laserWrite(const char* msg)
+{
+ int retval = fputs(msg, laser_port_);
+ if (retval != EOF)
+ return retval;
+ else
+ HOKUYO_EXCEPT(hokuyo::Exception, "fputs failed");
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+int
+hokuyo::Laser::laserFlush()
+{
+ int retval = tcflush(laser_fd_, TCIOFLUSH);
+ if (retval != 0)
+ HOKUYO_EXCEPT(hokuyo::Exception, "tcflush failed");
+
+ return retval;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+int
+hokuyo::Laser::laserReadline(char *buf, int len, int timeout)
+{
+ char* ret;
+ int current=0;
+
+ struct pollfd ufd[1];
+ int retval;
+ ufd[0].fd = laser_fd_;
+ ufd[0].events = POLLIN;
+
+ while (current < len - 1)
+ {
+ if (current > 0)
+ if (buf[current-1] == '\n')
+ return current;
+
+ if(timeout >= 0)
+ {
+ if ((retval = poll(ufd, 1, timeout)) < 0)
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "poll failed -- error = %d: %s", errno, strerror(errno));
+
+ if (retval == 0)
+ HOKUYO_EXCEPT(hokuyo::TimeoutException, "timeout reached");
+ }
+
+ ret = fgets(&buf[current], len-current, laser_port_);
+
+ if (ret != &buf[current])
+ HOKUYO_EXCEPT(hokuyo::Exception, "fgets failed");
+
+ current += strlen(&buf[current]);
+ }
+ HOKUYO_EXCEPT(hokuyo::Exception, "buffer filled without end of line being found");
+}
+
+
+char*
+hokuyo::Laser::laserReadlineAfter(char* buf, int len, const char* str, int timeout)
+{
+ buf[0] = 0;
+ char* ind = &buf[0];
+
+ int bytes_read = 0;
+ int skipped = 0;
+
+ while ((strncmp(buf, str, strlen(str))) != 0) {
+ bytes_read = laserReadline(buf,len,timeout);
+
+ if ((skipped += bytes_read) > MAX_SKIPPED)
+ HOKUYO_EXCEPT(hokuyo::Exception, "too many bytes skipped while searching for match");
+ }
+
+ return ind += strlen(str);
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+void
+hokuyo::Laser::querySensorConfig()
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ if (sendCmd("PP",1000) != 0)
+ HOKUYO_EXCEPT(hokuyo::Exception, "Error requesting configuration information");
+
+ char buf[100];
+ char* ind;
+
+ ind = laserReadlineAfter(buf,100,"DMIN:",-1);
+ sscanf(ind, "%d", &dmin_);
+
+ ind = laserReadlineAfter(buf,100,"DMAX:",-1);
+ sscanf(ind, "%d", &dmax_);
+
+ ind = laserReadlineAfter(buf,100,"ARES:",-1);
+ sscanf(ind, "%d", &ares_);
+
+ ind = laserReadlineAfter(buf,100,"AMIN:",-1);
+ sscanf(ind, "%d", &amin_);
+
+ ind = laserReadlineAfter(buf,100,"AMAX:",-1);
+ sscanf(ind, "%d", &amax_);
+
+ ind = laserReadlineAfter(buf,100,"AFRT:",-1);
+ sscanf(ind, "%d", &afrt_);
+
+ ind = laserReadlineAfter(buf,100,"SCAN:",-1);
+ sscanf(ind, "%d", &rate_);
+
+ return;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+bool
+hokuyo::Laser::changeBaud (int curr_baud, int new_baud, int timeout)
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ struct termios newtio;
+ int fd;
+ fd = fileno (laser_port_);
+
+ if (tcgetattr (fd, &newtio) < 0)
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "tcgetattr failed -- error = %d: %s\n", errno, strerror(errno));
+
+ cfmakeraw (&newtio);
+ cfsetispeed (&newtio, curr_baud);
+ cfsetospeed (&newtio, curr_baud);
+
+ if (tcsetattr (fd, TCSAFLUSH, &newtio) < 0 )
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "tcsetattr failed -- error = %d: %s\n", errno, strerror(errno));
+
+ char buf[100];
+ memset (buf,0,sizeof (buf));
+
+ switch (new_baud)
+ {
+ case B19200:
+ sprintf(buf,"%s","S019200");
+ break;
+ case B57600:
+ sprintf(buf,"%s","S057600");
+ break;
+ case B115200:
+ sprintf(buf,"%s","S115200");
+ break;
+ default:
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "unknown baud rate: %d",new_baud);
+ }
+
+ try
+ {
+ if (sendCmd(buf, timeout) != 0) {
+ return false;
+ }
+ } catch (hokuyo::TimeoutException& e) { }
+
+ if (tcgetattr (fd, &newtio) < 0)
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "tcgetattr failed -- error = %d: %s\n", errno, strerror(errno));
+
+ cfmakeraw (&newtio);
+ cfsetispeed (&newtio, new_baud);
+ cfsetospeed (&newtio, new_baud);
+
+ if (tcsetattr (fd, TCSAFLUSH, &newtio) < 0 )
+ HOKUYO_EXCEPT_ARGS(hokuyo::Exception, "tcsetattr failed -- error = %d: %s\n", errno, strerror(errno));
+
+ usleep (200000);
+ return (0);
+
+}
+
+
+bool
+hokuyo::Laser::checkSum(const char* buf, int buf_len)
+{
+ char sum = 0;
+ for (int i = 0; i < buf_len - 2; i++)
+ sum += (unsigned char)(buf[i]);
+
+ if ((sum & 63) + 0x30 == buf[buf_len - 2])
+ return true;
+ else
+ return false;
+}
+
+
+unsigned long long
+hokuyo::Laser::readTime(int timeout)
+{
+ char buf[100];
+
+ laserReadline(buf, 100, timeout);
+ if (!checkSum(buf, 6))
+ HOKUYO_EXCEPT(hokuyo::CorruptedDataException, "Checksum failed on time stamp.");
+
+ unsigned int laser_time = ((buf[0]-0x30) << 18) | ((buf[1]-0x30) << 12) | ((buf[2]-0x30) << 6) | (buf[3] - 0x30);
+
+ if (laser_time == last_time_)
+ fprintf(stderr, "This timestamp is same as the last timestamp.\nSomething is probably going wrong. Try decreasing data rate.");
+ else if (laser_time < last_time_)
+ wrapped_++;
+
+ last_time_ = laser_time;
+
+ return (unsigned long long)((wrapped_ << 24) | laser_time)*(unsigned long long)(1000000);
+}
+
+void
+hokuyo::Laser::readData(hokuyo::LaserScan* scan, bool has_intensity, int timeout)
+{
+ scan->num_readings = 0;
+
+ int data_size = 3;
+ if (has_intensity)
+ data_size = 6;
+
+ char buf[100];
+
+ int ind = 0;
+
+ scan->self_time_stamp = readTime(timeout);
+
+ int bytes;
+
+ for (;;)
+ {
+ bytes = laserReadline(&buf[ind], 100 - ind, timeout);
+
+ if (bytes == 1) // This is \n\n so we should be done
+ return;
+
+ if (!checkSum(&buf[ind], bytes))
+ HOKUYO_EXCEPT(hokuyo::CorruptedDataException, "Checksum failed on data read.");
+
+ bytes += ind - 2;
+
+ // Read as many ranges as we can get
+ for (int j = 0; j < bytes - (bytes % data_size); j+=data_size)
+ {
+ if (scan->num_readings < MAX_READINGS)
+ {
+ scan->ranges[scan->num_readings] = (((buf[j]-0x30) << 12) | ((buf[j+1]-0x30) << 6) | (buf[j+2]-0x30)) / 1000.0;
+
+ if (has_intensity)
+ scan->intensities[scan->num_readings] = (((buf[j+3]-0x30) << 12) | ((buf[j+4]-0x30) << 6) | (buf[j+5]-0x30));
+ else
+ scan->intensities[scan->num_readings] = 0;
+
+ scan->num_readings++;
+ }
+ else
+ HOKUYO_EXCEPT(hokuyo::CorruptedDataException, "Got more readings than expected");
+ }
+ // Shuffle remaining bytes to front of buffer to get them on the next loop
+ ind = 0;
+ for (int j = bytes - (bytes % data_size); j < bytes ; j++)
+ buf[ind++] = buf[j];
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+int
+hokuyo::Laser::pollScan(hokuyo::LaserScan* scan, double min_ang, double max_ang, int cluster, int timeout)
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ int status;
+
+ // Always set num_readings to 0 so we can return easily in case of erro
+ scan->num_readings = 0;
+
+ if (cluster == 0)
+ cluster = 1;
+
+ int min_i = (int)(afrt_ + min_ang*ares_/(2.0*M_PI));
+ int max_i = (int)(afrt_ + max_ang*ares_/(2.0*M_PI));
+
+ char cmdbuf[MAX_CMD_LEN];
+
+ sprintf(cmdbuf,"GD%.4d%.4d%.2d", min_i, max_i, cluster);
+
+ status = sendCmd(cmdbuf, timeout);
+
+ scan->system_time_stamp = timeHelper() + offset_;
+
+ if (status != 0)
+ return status;
+
+ // Populate configuration
+ scan->config.min_angle = (min_i - afrt_) * (2.0*M_PI)/(ares_);
+ scan->config.max_angle = (max_i - afrt_) * (2.0*M_PI)/(ares_);
+ scan->config.ang_increment = cluster*(2.0*M_PI)/(ares_);
+ scan->config.time_increment = (60.0)/(double)(rate_ * ares_);
+ scan->config.scan_time = 0.0;
+ scan->config.min_range = dmin_ / 1000.0;
+ scan->config.max_range = dmax_ / 1000.0;
+
+ readData(scan, false, timeout);
+
+ long long inc = (long long)(min_i * scan->config.time_increment * 1000000000);
+
+ scan->system_time_stamp += inc;
+ scan->self_time_stamp += inc;
+
+ return 0;
+}
+
+int
+hokuyo::Laser::laserOn() {
+ int res = sendCmd("BM",1000);
+ if (res == 1)
+ HOKUYO_EXCEPT(hokuyo::Exception, "Unable to control laser due to malfunction");
+ return res;
+}
+
+int
+hokuyo::Laser::laserOff() {
+ return sendCmd("QT",1000);
+}
+
+int
+hokuyo::Laser::stopScanning() {
+ return laserOff();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int
+hokuyo::Laser::requestScans(bool intensity, double min_ang, double max_ang, int cluster, int skip, int count, int timeout)
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ int status;
+
+ if (cluster == 0)
+ cluster = 1;
+
+ int min_i = (int)(afrt_ + min_ang*ares_/(2.0*M_PI));
+ int max_i = (int)(afrt_ + max_ang*ares_/(2.0*M_PI));
+
+ char cmdbuf[MAX_CMD_LEN];
+
+ char intensity_char = 'D';
+ if (intensity)
+ intensity_char = 'E';
+
+ sprintf(cmdbuf,"M%c%.4d%.4d%.2d%.1d%.2d", intensity_char, min_i, max_i, cluster, skip, count);
+
+ status = sendCmd(cmdbuf, timeout);
+
+ return status;
+}
+
+
+int
+hokuyo::Laser::serviceScan(hokuyo::LaserScan* scan, int timeout)
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ // Always set num_readings to 0 so we can return easily in case of error
+ scan->num_readings = 0;
+
+ char buf[100];
+
+ bool intensity = false;
+ int min_i;
+ int max_i;
+ int cluster;
+ int skip;
+ int left;
+
+ char* ind;
+
+ int status = -1;
+
+ do {
+ ind = laserReadlineAfter(buf, 100, "M",timeout);
+ scan->system_time_stamp = timeHelper() + offset_;
+
+ if (ind[0] == 'D')
+ intensity = false;
+ else if (ind[0] == 'E')
+ intensity = true;
+ else
+ continue;
+
+ ind++;
+
+ sscanf(ind, "%4d%4d%2d%1d%2d", &min_i, &max_i, &cluster, &skip, &left);
+ laserReadline(buf,100,timeout);
+
+ buf[4] = 0;
+
+ if (!checkSum(buf, 4))
+ HOKUYO_EXCEPT_ARGS(hokuyo::CorruptedDataException, "Checksum failed on status code: %s", buf);
+
+ sscanf(buf, "%2d", &status);
+
+ if (status != 99)
+ return status;
+
+ } while(status != 99);
+
+ scan->config.min_angle = (min_i - afrt_) * (2.0*M_PI)/(ares_);
+ scan->config.max_angle = (max_i - afrt_) * (2.0*M_PI)/(ares_);
+ scan->config.ang_increment = cluster*(2.0*M_PI)/(ares_);
+ scan->config.time_increment = (60.0)/(double)(rate_ * ares_);
+ scan->config.scan_time = (60.0 * (skip + 1))/((double)(rate_));
+ scan->config.min_range = dmin_ / 1000.0;
+ scan->config.max_range = dmax_ / 1000.0;
+
+ readData(scan, intensity, timeout);
+
+ long long inc = (long long)(min_i * scan->config.time_increment * 1000000000);
+
+ scan->system_time_stamp += inc;
+ scan->self_time_stamp += inc;
+
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+std::string
+hokuyo::Laser::getID()
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ if (sendCmd("VV",1000) != 0)
+ HOKUYO_EXCEPT(hokuyo::Exception, "Error requesting version information");
+
+ char buf[100];
+ char* serial = laserReadlineAfter(buf, 100, "SERI:");
+
+ std::string seristring(serial);
+ seristring = std::string("H") + seristring.substr(1,seristring.length() - 4);
+
+ return seristring;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+std::string
+hokuyo::Laser::getStatus()
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ if (sendCmd("II",1000) != 0)
+ HOKUYO_EXCEPT(hokuyo::Exception, "Error requesting device information information");
+
+ char buf[100];
+ char* stat = laserReadlineAfter(buf, 100, "STAT:");
+
+ std::string statstr(stat);
+ statstr = statstr.substr(0,statstr.length() - 3);
+
+ return statstr;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+long long
+hokuyo::Laser::calcLatency(bool intensity, double min_ang, double max_ang, int clustering, int skip, int num, int timeout)
+{
+ if (!portOpen())
+ HOKUYO_EXCEPT(hokuyo::Exception, "Port not open.");
+
+ offset_ = 0;
+
+ unsigned long long comp_time = 0;
+ unsigned long long laser_time = 0;
+ long long diff_time = 0;
+ long long drift_time = 0;
+ long long tmp_offset1 = 0;
+ long long tmp_offset2 = 0;
+
+ int count = 0;
+
+ sendCmd("TM0",timeout);
+ count = 100;
+
+ for (int i = 0; i < count;i++)
+ {
+ usleep(1000);
+ sendCmd("TM1",timeout);
+ comp_time = timeHelper();
+ laser_time = readTime();
+
+ diff_time = comp_time - laser_time;
+
+ tmp_offset1 += diff_time / count;
+ }
+
+ unsigned long long start_time = timeHelper();
+ usleep(5000000);
+ sendCmd("TM1;a",timeout);
+ sendCmd("TM1;b",timeout);
+ comp_time = timeHelper();
+ drift_time = comp_time - start_time;
+ laser_time = readTime() + tmp_offset1;
+ diff_time = comp_time - laser_time;
+ double drift_rate = double(diff_time) / double(drift_time);
+
+ sendCmd("TM2",timeout);
+
+ if (requestScans(intensity, min_ang, max_ang, clustering, skip, num, timeout) != 0)
+ HOKUYO_EXCEPT(hokuyo::Exception, "Error requesting scans during latency calculation");
+
+ hokuyo::LaserScan scan;
+
+ count = 200;
+ for (int i = 0; i < count;i++)
+ {
+ try
+ {
+ serviceScan(&scan, 1000);
+ } catch (hokuyo::CorruptedDataException &e) {
+ continue;
+ }
+
+ comp_time = scan.system_time_stamp;
+ drift_time = comp_time - start_time;
+ laser_time = scan.self_time_stamp + tmp_offset1 + (long long)(drift_time*drift_rate);
+ diff_time = laser_time - comp_time;
+
+ tmp_offset2 += diff_time / count;
+ }
+
+ offset_ = tmp_offset2;
+
+ stopScanning();
+
+ return offset_;
+}
Copied: pkg/trunk/drivers/laser/hokuyo_driver/hokuyo.h (from rev 4583, pkg/trunk/drivers/laser/hokuyo_utm_driver/hokuyo_utm.h)
===================================================================
--- pkg/trunk/drivers/laser/hokuyo_driver/hokuyo.h (rev 0)
+++ pkg/trunk/drivers/laser/hokuyo_driver/hokuyo.h 2008-09-23 16:59:47 UTC (rev 4591)
@@ -0,0 +1,311 @@
+/*
+ * Player - One Hell of a Robot Server
+ * Copyright (C) 2008 Willow Garage
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/*! \mainpage
+ * \htmlinclude manifest.html
+ */
+
+#ifndef HOKUYO_HH
+#define HOKUYO_HH
+
+#include <stdexcept>
+#include <termios.h>
+#include <string>
+
+//! A namespace containing the hokuyo device driver
+namespace hokuyo
+{
+ //! The maximum number of readings that can be returned from a hokuyo
+ const int MAX_READINGS = 1128;
+
+ //! The maximum length a command will ever be
+ const int MAX_CMD_LEN = 100;
+
+ //! The maximum number of bytes that should be skipped when looking for a response
+ const int MAX_SKIPPED = 1000000;
+
+ //! Macro for defining an exception with a given parent (std::runtime_error should be top parent)
+#define DEF_EXCEPTION(name, parent) \
+ class name : public parent { \
+ public: \
+ name(const char* msg) : parent(msg) {} \
+ }
+
+ //! A standard Hokuyo exception
+ DEF_EXCEPTION(Exception, std::runtime_error);
+
+ //! An exception for use when a timeout is exceeded
+ DEF_EXCEPTION(TimeoutException, Exception);
+
+ //! An exception for use when data is corrupted
+ DEF_EXCEPTION(CorruptedDataException, Exception);
+
+#undef DEF_EXCEPTION
+
+ //! A struct for returning configuration from the Hokuyo
+ struct LaserConfig
+ {
+ //! Start angle for the laser scan [rad].
+ float min_angle;
+ //! Stop angle for the laser scan [rad].
+ float max_angle;
+ //! Scan resolution [rad].
+ float ang_increment;
+ //! Scan resoltuion [s]
+ float time_increment;
+ //! Time between scans
+ float scan_time;
+ //! Minimum range [m]
+ float min_range;
+ //! Maximum range [m]
+ float max_range;
+ //! Range Resolution [m]
+ float range_res;
+ };
+
+
+ //! A struct for returning laser readings from the Hokuyo
+ struct LaserScan
+ {
+ //! Array of ranges
+ float ranges[MAX_READINGS];
+ //! Array of intensities
+ float intensities[MAX_READINGS];
+ //! Number of readings
+ int num_readings;
+ //! Self reported time stamp in nanoseconds
+ unsigned long long self_time_stamp;
+ //! System time when first range was measured in nanoseconds
+ unsigned long long system_time_stamp;
+ //! Configuration of scan
+ LaserConfig config;
+ };
+
+
+ //! A class for interfacing to an SCIP2.0-compliant Hokuyo laser device
+ /*!
+ * NOTE: Just about all methods of this class may throw an exception
+ * of type hokuyo::exception in the event of an error when
+ * communicating with the device. However, many methods which wrap
+ * commands that are sent to the hokuyo will return a hokuyo-supplied
+ * status code. This code may indicate some form of failure on the
+ * part of the device itself. For more information, consult the hokuyo
+ * manual.
+ */
+ class Laser
+ {
+ public:
+ //! Constructor
+ Laser();
+
+ //! Destructor
+ ~Laser();
+
+ //! Open the port
+ /*!
+ * This must be done before the hokuyo can be used. This call essentially
+ * wraps fopen, with some additional calls to tcsetattr.
+ *
+ * \param port_name A character array containing the name of the port
+ * \param use_serial Set to 1 if using serial instead of USB
+ * \param baud Baud rate to use when working over serial
+ *
+ */
+ void open(const char * port_name, bool use_serial = 0, int baud = B115200);
+
+ //! Close the port
+ /*!
+ * This call essentiall wraps fclose.
+ */
+ void close();
+
+ //! Check whether the port is open
+ bool portOpen() { return laser_port_ != NULL; }
+
+ //! Sends an SCIP2.0 command to the hokuyo device
+ /*!
+ * This function allows commands to be sent directly to the hokuyo.
+ * Possible commands can be found in the hokuyo documentation. It
+ * will only read up until the end of the status code. Any
+ * additional bytes will be left on the line for parsing.
+ *
+ * \param cmd Command and arguments in a character array
+ * \param timeout Timeout in milliseconds.
+ *
+ * \return Status code returned from hokuyo device.
+ */
+ int sendCmd(const char* cmd, int timeout = -1);
+
+ //! Change the baud rate
+ /*!
+ * Baud rates are specified using defines in termios:
+ *
+ * B19200 - B250000
+ *
+ * \param curr_baud The current baud rate
+ * \param new_baud The desired baud rate
+ * \param timeout Timeout in milliseconds.
+ *
+ * \return Returns true on success, false on failure
+ */
+ bool changeBaud(int curr_baud, int new_baud, int timeout = -1);
+
+ //! Retrieve a single scan from the hokuyo
+ /*!
+ * \param scan A pointer to an LaserScan which will be populated
+ * \param min_ang Minimal angle of the scan
+ * \param max_ang Maximum angle of the scan
+ * \param clustering Number of adjascent ranges to be clustered into a single measurement.
+ * \param timeout Timeout in milliseconds.
+ *
+ * \return Status code returned from hokuyo device.
+ */
+ int pollScan(LaserScan * scan, double min_ang, double max_ang, int clustering = 0, int timeout = -1);
+
+ //! Request a sequence of scans from the hokuyo
+ /*!
+ * This function will request a sequence of scans from the hokuyo. If
+ * indefinite scans are requested, stop_scanning() must be called
+ * to terminate scanning. Service_scan() must be called repeatedly
+ * to receive scans as they come in.
+ *
+ * \param intensity Whether or not intensity data should be provided
+ * \param min_ang Minimal angle of the scan (radians)
+ * \param max_ang Maximum angle of the scan (radians)
+ * \param clustering Number of adjascent ranges to be clustered into a single measurement
+ * \param skip Number of scans to skip between returning measurements
+ * \param num Number of scans to return (0 for indefinite)
+ * \param timeout Timeout in milliseconds.
+ *
+ * \return Status code returned from hokuyo device.
+ */
+ int requestScans(bool intensity, double min_ang, double max_ang, int clustering = 0, int skip = 0, int num = 0, int timeout = -1);
+
+ //! Retrieve a scan if they have been requested
+ /*!
+ * \param scan A pointer to an LaserScan which will be populated.
+ * \param timeout Timeout in milliseconds.
+ *
+ * \return 0 on succes, Status code returned from hokuyo device on failure. (Normally 99 is used for success)
+ */
+ int serviceScan(LaserScan * scan, ...
[truncated message content] |
|
From: <stu...@us...> - 2008-09-23 20:03:25
|
Revision: 4601
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4601&view=rev
Author: stuglaser
Date: 2008-09-23 20:03:09 +0000 (Tue, 23 Sep 2008)
Log Message:
-----------
Calibration back up and running.
Modified Paths:
--------------
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp
pkg/trunk/mechanism/mechanism_control/src/mechanism_control/mechanism.py
pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
pkg/trunk/mechanism/mechanism_control/srv/SpawnController.srv
Added Paths:
-----------
pkg/trunk/manip/teleop_robot/scripts/calibrate.py
Modified: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h 2008-09-23 20:02:30 UTC (rev 4600)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h 2008-09-23 20:03:09 UTC (rev 4601)
@@ -43,6 +43,15 @@
This class moves the joint and reads the value of the clibration_reading_ field to find the zero position of the joint. Once these are determined, these values
* are passed to the joint and enable the joint for the other controllers.
+ Example XML:
+ <controller type="JointBlindCalibrationController">
+ <calibrate joint="upperarm_roll_right_joint"
+ actuator="upperarm_roll_right_act"
+ transmission="upperarm_roll_right_trans"
+ velocity="0.3" />
+ <pid p="15" i="0" d="0" iClamp="0" />
+ </controller>
+
*/
/***************************************************/
@@ -56,7 +65,7 @@
namespace controller
{
-class JointBlindCalibrationController : public JointManualCalibrationController
+class JointBlindCalibrationController : public Controller
{
public:
/*!
@@ -82,17 +91,26 @@
*/
virtual void update();
+ bool calibrated() { return state_ == DONE; }
+ void beginCalibration() {
+ if (state_ == INITIALIZED)
+ state_ = BEGINNING;
+ }
+
protected:
- enum {SearchUp=100,SearchDown,SearchingUp,SearchingDown};
+ enum { INITIALIZED, BEGINNING, STARTING_UP, MOVING_UP,
+ STARTING_DOWN, MOVING_DOWN, DONE };
+ int state_;
double search_velocity_;
+ Actuator *actuator_;
+ mechanism::JointState *joint_;
+ mechanism::Transmission *transmission_;
- double velocity_cmd_;
-
double init_time;
- controller::JointVelocityController vcontroller_; /** The joint velocity controller used to sweep the joint.*/
+ controller::JointVelocityController vc_; /** The joint velocity controller used to sweep the joint.*/
};
Modified: pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp 2008-09-23 20:02:30 UTC (rev 4600)
+++ pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp 2008-09-23 20:03:09 UTC (rev 4601)
@@ -41,145 +41,144 @@
ROS_REGISTER_CONTROLLER(JointBlindCalibrationController)
JointBlindCalibrationController::JointBlindCalibrationController()
- : JointManualCalibrationController()
+: state_(INITIALIZED), joint_(NULL)
{
- std::cout<<"JointBlindCalibration created\n";
}
JointBlindCalibrationController::~JointBlindCalibrationController()
{
- std::cout<<"JointBlindCalibration destroyed\n";
}
-
+#define GOTHERE printf("HERE %s %d\n", __FILE__, __LINE__);
bool JointBlindCalibrationController::initXml(mechanism::RobotState *robot, TiXmlElement *config)
{
assert(robot);
assert(config);
- robot_ = robot->model_;
- bool base=JointManualCalibrationController::initXml(robot, config);
- if(!base)
- return false;
- TiXmlElement *j = config->FirstChildElement("param");
- if (!j)
+
+ TiXmlElement *cal = config->FirstChildElement("calibrate");
+ if (!cal)
{
- std::cerr<<"JointBlindCalibrationController was not given parameters"<<std::endl;
+ std::cerr<<"JointBlindCalibrationController was not given calibration parameters"<<std::endl;
return false;
}
- if(j->QueryDoubleAttribute("velocity", &search_velocity_ ) != TIXML_SUCCESS)
+ if(cal->QueryDoubleAttribute("velocity", &search_velocity_) != TIXML_SUCCESS)
{
std::cerr<<"Velocity value was not specified\n";
return false;
}
- std::cout<<"search vel"<<search_velocity_<<std::endl;
- if(search_velocity_ == 0)
+
+ const char *joint_name = cal->Attribute("joint");
+ joint_ = joint_name ? robot->getJointState(joint_name) : NULL;
+ if (!joint_)
{
- std::cerr<<"You gave zero velocity\n";
+ fprintf(stderr, "Error: JointBlindCalibrationController could not find joint \"%s\"\n",
+ joint_name);
return false;
}
- TiXmlElement *v = config->FirstChildElement("controller");
- if(!v)
+ const char *actuator_name = cal->Attribute("actuator");
+ actuator_ = actuator_name ? robot->model_->getActuator(actuator_name) : NULL;
+ if (!actuator_)
{
- std::cerr<<"JointBlindCalibrationController was not given a controller to move the joint."<<std::endl;
+ fprintf(stderr, "Error: JointBlindCalibrationController could not find actuator \"%s\"\n",
+ actuator_name);
return false;
}
- return vcontroller_.initXml(robot, v);
+ const char *transmission_name = cal->Attribute("transmission");
+ transmission_ = transmission_name ? robot->model_->getTransmission(transmission_name) : NULL;
+ if (!transmission_)
+ {
+ fprintf(stderr, "Error: JointBlindCalibrationController could not find transmission \"%s\"\n",
+ transmission_name);
+ return false;
+ }
+
+ control_toolbox::Pid pid;
+ TiXmlElement *pid_el = config->FirstChildElement("pid");
+ if (!pid_el)
+ {
+ fprintf(stderr, "Error: JointBlindCalibrationController was not given a pid element.\n");
+ return false;
+ }
+ if (!pid.initXml(pid_el))
+ return false;
+
+ if (!vc_.init(robot, joint_name, pid))
+ return false;
+
+ return true;
}
void JointBlindCalibrationController::update()
{
- static const double v_thresh = 0.3*std::abs(search_velocity_);
- assert(joint_state_);
+ assert(joint_);
assert(actuator_);
- if(state_ == Begin)
- {
- std::cout<<"begin procedure"<<std::endl;
- joint_state_->calibrated_ = false;
- init_time= robot_->hw_->current_time_;
- velocity_cmd_ = search_velocity_;
- if(search_velocity_>0)
- state_ = SearchUp;
- else
- state_ = SearchDown;
- }
+ static int count = 0;
+ static double joint_max_raw, joint_min_raw; // Joint angles at the bumps
- if(state_ == SearchUp)
+ switch (state_)
{
- if(joint_state_->velocity_ > v_thresh)
+ case INITIALIZED:
+ return;
+ case BEGINNING:
+ state_ = STARTING_UP;
+ count = 0;
+ joint_->calibrated_ = false;
+ actuator_->state_.zero_offset_ = 0.0;
+ break;
+ case STARTING_UP:
+ vc_.setCommand(search_velocity_);
+ if (++count > 500)
{
- std::cout<<"Searching up\n";
- state_ = SearchingUp;
+ count = 0;
+ state_ = MOVING_UP;
}
- else
- std::cout<<joint_state_->velocity_ <<'\t'<< v_thresh <<std::endl;
- }
-
- if(state_ == SearchDown)
- {
- if(joint_state_->velocity_ < -v_thresh)
+ break;
+ case MOVING_UP:
+ if (fabs(joint_->velocity_) < 0.001)
{
- std::cout<<"Searching down\n";
- state_ = SearchingDown;
+ joint_max_raw = joint_->position_;
+ state_ = STARTING_DOWN;
+ count = 0;
}
+ break;
+ case STARTING_DOWN:
+ vc_.setCommand(-search_velocity_);
+ if (++count > 500)
+ {
+ state_ = MOVING_DOWN;
+ count = 0;
+ }
+ break;
+ case MOVING_DOWN:
+ if (fabs(joint_->velocity_) < 0.001)
+ {
+ joint_min_raw = joint_->position_;
- }
+ // Sets the desired joint zero based on where we bumped the limits.
+ double joint_zero = ((joint_max_raw - joint_->joint_->joint_limit_max_) +
+ (joint_min_raw - joint_->joint_->joint_limit_min_)) / 2.0;
+ std::vector<Actuator*> fake_a;
+ std::vector<mechanism::JointState*> fake_j;
+ fake_a.push_back(new Actuator);
+ fake_j.push_back(new mechanism::JointState);
+ fake_j[0]->position_ = joint_zero;
+ transmission_->propagatePositionBackwards(fake_j, fake_a);
+ actuator_->state_.zero_offset_ = fake_a[0]->state_.position_;
+ joint_->calibrated_ = true;
-// const double cur_time = robot_->hw_->current_time_;
-//
-// if(cur_time - init_time > 1000)
-// {
-// std::cout<<"Finished\n";
-// const double offset_ = offset(actuator_->state_.position_, joint_->joint_limit_max_);
-// std::cout<<"offset "<<offset_<<std::endl;
-// actuator_->state_.zero_offset_ = offset_;
-// state_ = SearchDown; //TODO: get better results by a search down
-// state_ = Initialized;
-//
-// }
-
- if(state_ == SearchingDown && joint_state_->velocity_>=0)
- {
- std::cout<<"Bump\n";
- const double offset_down = offset(actuator_->state_.position_, joint_->joint_limit_min_);
- std::cout<<"offset "<<offset_down<<std::endl;
- actuator_->state_.zero_offset_ = offset_down;
-// state_ = SearchUp; //TODO: get better results by a search down
- state_ = Initialized;
- }
-
- if(state_ == SearchingUp && joint_state_->velocity_<=0)
- {
- std::cout<<"Bump\n";
- const double offset_up = offset(actuator_->state_.position_, joint_->joint_limit_max_);
- std::cout<<"offset "<<offset_up<<std::endl;
- actuator_->state_.zero_offset_ = offset_up;
-// state_ = SearchDown; //TODO: get better results by a search down
- state_ = Initialized;
- }
-
- if(state_ == Initialized)
- {
- joint_state_->calibrated_ = true;
- velocity_cmd_ = 0;
- state_ = Stop;
- state_mutex_.unlock();
+ state_ = DONE;
+ count = 0;
+ }
+ break;
+ case DONE:
+ vc_.setCommand(0.0);
+ break;
}
- if(state_ == Stop)
- {
- velocity_cmd_ = 0;
- }
-
-
-
- if(state_!=Stop)
- {
- vcontroller_.setCommand(velocity_cmd_);
- vcontroller_.update();
- }
+ vc_.update();
}
@@ -204,10 +203,10 @@
bool JointBlindCalibrationControllerNode::calibrateCommand(robot_mechanism_controllers::CalibrateJoint::request &req, robot_mechanism_controllers::CalibrateJoint::response &resp)
{
c_->beginCalibration();
- ros::Duration d=ros::Duration(0,1000000);
+ ros::Duration d = ros::Duration(0,1000000);
while(!c_->calibrated())
d.sleep();
- c_->getOffset(resp.offset);
+ resp.offset = 0.0;
return true;
}
@@ -224,6 +223,7 @@
if (!c_->initXml(robot, config))
return false;
+
node->advertise_service(topic + "/calibrate", &JointBlindCalibrationControllerNode::calibrateCommand, this);
return true;
}
Added: pkg/trunk/manip/teleop_robot/scripts/calibrate.py
===================================================================
--- pkg/trunk/manip/teleop_robot/scripts/calibrate.py (rev 0)
+++ pkg/trunk/manip/teleop_robot/scripts/calibrate.py 2008-09-23 20:03:09 UTC (rev 4601)
@@ -0,0 +1,119 @@
+#!/usr/bin/python
+# Software License Agreement (BSD License)
+#
+# Copyright (c) 2008, Willow Garage, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of the Willow Garage nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# Written by Timothy Hunter <tjh...@wi...> 2008
+
+import rostools
+import copy
+
+# Loads interface with the robot.
+rostools.update_path('teleop_robot')
+import rospy
+from mechanism_control.srv import *
+from robot_mechanism_controllers.srv import *
+from teleop_robot import *
+
+def slurp(filename):
+ f = open(filename)
+ stuff = f.read()
+ f.close()
+ return stuff
+
+rospy.wait_for_service('spawn_controller')
+spawn_controller = rospy.ServiceProxy('spawn_controller', SpawnController)
+kill_controller = rospy.ServiceProxy('kill_controller', KillController)
+
+
+def calibrate_optically(config):
+ resp = spawn_controller(config)
+ if len(resp.ok) != 1 or not resp.ok[0]:
+ print "FAIL"
+ return
+ name = resp.name[0]
+ do_calibration = rospy.ServiceProxy("/%s/calibrate" % name, CalibrateJoint)
+ do_calibration()
+ kill_controller(name)
+ print "Calibrated"
+
+def calibrate_manually(config):
+ resp = spawn_controller(config)
+ if len(resp.ok) != 1 or not resp.ok[0]:
+ print "FAIL"
+ return
+ name = resp.name[0]
+ begin = rospy.ServiceProxy("/%s/begin_manual_calibration" % name, CalibrateJoint)
+ end = rospy.ServiceProxy("/%s/end_manual_calibration" % name, CalibrateJoint)
+ begin()
+ print "Move the joint to the limits, and then hit enter"
+ raw_input()
+ end()
+ kill_controller(name)
+ print "Calibrated manually"
+
+# Hits the joint stops
+def calibrate_blindly(config):
+ resp = spawn_controller(config)
+ if len(resp.ok) != 1 or not resp.ok[0]:
+ print "FAIL"
+ return
+ name = resp.name[0]
+ do_calibration = rospy.ServiceProxy("/%s/calibrate" % name, CalibrateJoint)
+ do_calibration()
+ kill_controller(name)
+ print "Calibrated"
+
+calibrate_optically(slurp('pr2_arm/calibration_shoulder_pan.xml'))
+calibrate_optically(slurp('pr2_arm/calibration_shoulder_lift.xml'))
+
+calibrate_blindly('''
+<controller name="upperarm_calibration" topic="upperarm_calibration" type="JointBlindCalibrationControllerNode">
+ <calibrate joint="upperarm_roll_right_joint"
+ actuator="upperarm_roll_right_act"
+ transmission="upperarm_roll_right_trans"
+ velocity="0.6" />
+ <pid p="5" i="0.5" d="0" iClamp="1.0" />
+</controller>
+
+''')
+
+calibrate_blindly('''
+<controller name="cal_elbow" topic="cal_elbow" type="JointBlindCalibrationControllerNode">
+ <calibrate joint="elbow_right_joint"
+ actuator="elbow_right_act"
+ transmission="elbow_right_trans"
+ velocity="0.6" />
+ <pid p="5" i="0.5" d="0" iClamp="1.0" />
+</controller>
+
+''')
Property changes on: pkg/trunk/manip/teleop_robot/scripts/calibrate.py
___________________________________________________________________
Added: svn:executable
+ *
Modified: pkg/trunk/mechanism/mechanism_control/src/mechanism_control/mechanism.py
===================================================================
--- pkg/trunk/mechanism/mechanism_control/src/mechanism_control/mechanism.py 2008-09-23 20:02:30 UTC (rev 4600)
+++ pkg/trunk/mechanism/mechanism_control/src/mechanism_control/mechanism.py 2008-09-23 20:03:09 UTC (rev 4601)
@@ -26,10 +26,11 @@
rospy.wait_for_service('spawn_controller')
s = rospy.ServiceProxy('spawn_controller', SpawnController)
resp = s.call(SpawnControllerRequest(xml))
- if resp.ok == 1:
- print "Spawned successfully"
- else:
- print "Error when spawning", resp.ok
+ for i in range(len(resp.ok)):
+ if resp.ok[i]:
+ print "Spawned", resp.name[i]
+ else:
+ print "Error when spawning", resp.name[i]
def kill_controller(name):
rospy.wait_for_service('kill_controller')
Modified: pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2008-09-23 20:02:30 UTC (rev 4600)
+++ pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2008-09-23 20:03:09 UTC (rev 4601)
@@ -320,22 +320,41 @@
TiXmlDocument doc;
doc.Parse(req.xml_config.c_str());
+ std::vector<uint8_t> oks;
+ std::vector<std::string> names;
+
TiXmlElement *config = doc.RootElement();
- if (0 == strcmp(config->Value(), "controllers"))
+ if (!config)
+ return false;
+ if (config->ValueStr() != "controllers" &&
+ config->ValueStr() != "controller")
+ return false;
+
+ if (config->ValueStr() == "controllers")
{
config = config->FirstChildElement("controller");
}
for (; config; config = config->NextSiblingElement("controller"))
{
+ bool ok = true;
+
if (!config->Attribute("type"))
- resp.ok = false;
+ ok = false;
else if (!config->Attribute("name"))
- resp.ok = false;
+ ok = false;
else
- resp.ok = mc_->spawnController(config->Attribute("type"), config->Attribute("name"), config);
+ {
+ ok = mc_->spawnController(config->Attribute("type"), config->Attribute("name"), config);
+ }
+
+ oks.push_back(ok);
+ names.push_back(config->Attribute("name") ? config->Attribute("name") : "");
}
+ resp.set_ok_vec(oks);
+ resp.set_name_vec(names);
+
return true;
}
Modified: pkg/trunk/mechanism/mechanism_control/srv/SpawnController.srv
===================================================================
--- pkg/trunk/mechanism/mechanism_control/srv/SpawnController.srv 2008-09-23 20:02:30 UTC (rev 4600)
+++ pkg/trunk/mechanism/mechanism_control/srv/SpawnController.srv 2008-09-23 20:03:09 UTC (rev 4601)
@@ -1,3 +1,4 @@
string xml_config
---
-byte ok
+byte[] ok
+string[] name
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <stu...@us...> - 2008-09-24 17:09:18
|
Revision: 4639
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4639&view=rev
Author: stuglaser
Date: 2008-09-24 17:09:03 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
More controllers now come down cleanly.
Modified Paths:
--------------
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_effort_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_effort_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_effort_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_effort_controller.cpp
pkg/trunk/util/misc_utils/include/misc_utils/advertised_service_guard.h
Modified: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_effort_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_effort_controller.h 2008-09-24 17:08:31 UTC (rev 4638)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_effort_controller.h 2008-09-24 17:09:03 UTC (rev 4639)
@@ -47,6 +47,7 @@
#include "robot_mechanism_controllers/SetVectorCommand.h"
#include "mechanism_model/controller.h"
#include "LinearMath/btVector3.h"
+#include "misc_utils/advertised_service_guard.h"
namespace controller {
@@ -80,6 +81,7 @@
private:
CartesianEffortController c_;
+ AdvertisedServiceGuard guard_set_actual_;
};
}
Modified: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h 2008-09-24 17:08:31 UTC (rev 4638)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_blind_calibration_controller.h 2008-09-24 17:09:03 UTC (rev 4639)
@@ -56,7 +56,9 @@
/***************************************************/
-#include "joint_manual_calibration_controller.h"
+#include "mechanism_model/controller.h"
+#include "robot_mechanism_controllers/joint_velocity_controller.h"
+#include "misc_utils/advertised_service_guard.h"
// Services
#include <robot_mechanism_controllers/CalibrateJoint.h>
@@ -147,6 +149,7 @@
private:
JointBlindCalibrationController *c_;
+ AdvertisedServiceGuard guard_calibrate_;
};
}
Modified: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_effort_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_effort_controller.h 2008-09-24 17:08:31 UTC (rev 4638)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_effort_controller.h 2008-09-24 17:09:03 UTC (rev 4639)
@@ -51,6 +51,7 @@
#include <ros/node.h>
#include <mechanism_model/controller.h>
+#include "misc_utils/advertised_service_guard.h"
// Services
#include <robot_mechanism_controllers/SetCommand.h>
@@ -150,6 +151,7 @@
private:
JointEffortController *c_;
+ AdvertisedServiceGuard guard_set_command_, guard_get_actual_;
};
}
Modified: pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_effort_controller.cpp
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_effort_controller.cpp 2008-09-24 17:08:31 UTC (rev 4638)
+++ pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_effort_controller.cpp 2008-09-24 17:09:03 UTC (rev 4639)
@@ -39,7 +39,9 @@
ROS_REGISTER_CONTROLLER(CartesianEffortController)
CartesianEffortController::CartesianEffortController()
-: command_(0,0,0), links_(0,(mechanism::LinkState*)NULL), joints_(0,(mechanism::JointState*)NULL)
+: command_(0,0,0),
+ links_(0,(mechanism::LinkState*)NULL),
+ joints_(0,(mechanism::JointState*)NULL)
{
}
@@ -195,6 +197,7 @@
node->advertise_service(topic + "/set_command",
&CartesianEffortControllerNode::setCommand, this);
+ guard_set_actual_.set(topic + "/set_command");
return true;
}
Modified: pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp 2008-09-24 17:08:31 UTC (rev 4638)
+++ pkg/trunk/controllers/robot_mechanism_controllers/src/joint_blind_calibration_controller.cpp 2008-09-24 17:09:03 UTC (rev 4639)
@@ -225,5 +225,6 @@
return false;
node->advertise_service(topic + "/calibrate", &JointBlindCalibrationControllerNode::calibrateCommand, this);
+ guard_calibrate_.set(topic + "/calibrate");
return true;
}
Modified: pkg/trunk/controllers/robot_mechanism_controllers/src/joint_effort_controller.cpp
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/src/joint_effort_controller.cpp 2008-09-24 17:08:31 UTC (rev 4638)
+++ pkg/trunk/controllers/robot_mechanism_controllers/src/joint_effort_controller.cpp 2008-09-24 17:09:03 UTC (rev 4639)
@@ -151,7 +151,9 @@
if (!c_->initXml(robot, config))
return false;
node->advertise_service(topic + "/set_command", &JointEffortControllerNode::setCommand, this);
+ guard_set_command_.set(topic + "/set_command");
node->advertise_service(topic + "/get_actual", &JointEffortControllerNode::getActual, this);
+ guard_get_actual_.set(topic + "/get_actual");
return true;
}
Modified: pkg/trunk/util/misc_utils/include/misc_utils/advertised_service_guard.h
===================================================================
--- pkg/trunk/util/misc_utils/include/misc_utils/advertised_service_guard.h 2008-09-24 17:08:31 UTC (rev 4638)
+++ pkg/trunk/util/misc_utils/include/misc_utils/advertised_service_guard.h 2008-09-24 17:09:03 UTC (rev 4639)
@@ -30,6 +30,8 @@
/*
* Author: Stuart Glaser
*/
+#ifndef ADVERTISED_SERVICE_GUARD
+#define ADVERTISED_SERVICE_GUARD
#include <ros/node.h>
@@ -61,3 +63,5 @@
bool valid_;
std::string service_name_;
};
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jl...@us...> - 2008-09-25 02:16:54
|
Revision: 4666
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4666&view=rev
Author: jleibs
Date: 2008-09-25 02:16:41 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
Logging now stores data types of logged data in a new, slightly different format.
Backwards compatibility has been maintained. The flexibility of LogPlayback has
also been improved with more template magic and the ability to use callbacks which
are class members.
Modified Paths:
--------------
pkg/trunk/drivers/imu/imu_node/manifest.xml
pkg/trunk/nav/laser_pose_interpolator/gen_carmen_laser.cpp
pkg/trunk/util/logging/include/logging/LogPlayer.h
pkg/trunk/util/logging/include/logging/LogRecorder.h
pkg/trunk/util/logsetta/CMakeLists.txt
pkg/trunk/util/logsetta/base_actual/CMakeLists.txt
pkg/trunk/util/logsetta/base_actual/base_actual_extract.cpp
pkg/trunk/util/logsetta/carmen/genlog_carmen/genlog_carmen.cpp
pkg/trunk/util/logsetta/imu/imu_extract.cpp
pkg/trunk/util/logsetta/localize_extract/localize_extract.cpp
pkg/trunk/util/logsetta/manifest.xml
pkg/trunk/util/logsetta/odom/odom_extract.cpp
pkg/trunk/util/megamaid/src/central_vac/central_vac.cpp
pkg/trunk/util/megamaid/src/dustbuster/dustbuster.cpp
pkg/trunk/util/megamaid/src/playback/playback.cpp
pkg/trunk/util/megamaid/src/stepback/stepback.cpp
pkg/trunk/util/megamaid/src/vacuum/vacuum.cpp
pkg/trunk/vision/calib_converter/src/calib_converter.cpp
Added Paths:
-----------
pkg/trunk/util/logging/CMakeLists.txt
pkg/trunk/util/logging/FORMATS
pkg/trunk/util/logging/Makefile
pkg/trunk/util/logging/include/logging/LogFunctor.h
pkg/trunk/util/logging/src/
pkg/trunk/util/logging/src/checklog/
pkg/trunk/util/logging/src/checklog/checklog.cpp
pkg/trunk/util/logging/src/demo/
pkg/trunk/util/logging/src/demo/demo.cpp
Modified: pkg/trunk/drivers/imu/imu_node/manifest.xml
===================================================================
--- pkg/trunk/drivers/imu/imu_node/manifest.xml 2008-09-25 01:29:12 UTC (rev 4665)
+++ pkg/trunk/drivers/imu/imu_node/manifest.xml 2008-09-25 02:16:41 UTC (rev 4666)
@@ -8,4 +8,7 @@
<depend package='std_msgs'/>
<depend package='3dmgx2_driver'/>
<depend package='self_test'/>
+ <export>
+ <cpp cflags="-I${prefix}/msg/cpp"/>
+ </export>
</package>
Modified: pkg/trunk/nav/laser_pose_interpolator/gen_carmen_laser.cpp
===================================================================
--- pkg/trunk/nav/laser_pose_interpolator/gen_carmen_laser.cpp 2008-09-25 01:29:12 UTC (rev 4665)
+++ pkg/trunk/nav/laser_pose_interpolator/gen_carmen_laser.cpp 2008-09-25 02:16:41 UTC (rev 4666)
@@ -42,11 +42,8 @@
const float LASER_POSITION = 0.05;
-void scan_callback(string name, ros::msg* m, ros::Time t, void* n)
+void scan_callback(string name, laser_pose_interpolator::PoseLaserScan* scan, ros::Time t, void* n)
{
-
- laser_pose_interpolator::PoseLaserScan* scan = (laser_pose_interpolator::PoseLaserScan*)(m);
-
double rel_time = t.to_double();
//const double fov = fabs(scan->scan.angle_max - scan->scan.angle_min);
@@ -99,16 +96,8 @@
player.open(files, ros::Time(0));
- int count;
+ player.addHandler<laser_pose_interpolator::PoseLaserScan>(string("pose_scan"), &scan_callback, NULL);
- count = player.addHandler<laser_pose_interpolator::PoseLaserScan>(string("pose_scan"), &scan_callback, NULL, true);
-
- if (count != 1)
- {
- printf("Found %d '/pose_scan' topics when expecting 1\n", count);
- return 1;
- }
-
clog = fopen("carmen.txt", "w");
while(player.nextMsg()) {}
Added: pkg/trunk/util/logging/CMakeLists.txt
===================================================================
--- pkg/trunk/util/logging/CMakeLists.txt (rev 0)
+++ pkg/trunk/util/logging/CMakeLists.txt 2008-09-25 02:16:41 UTC (rev 4666)
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(logging)
+
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
+
+rospack_add_executable(checklog src/checklog/checklog.cpp)
+rospack_add_executable(demo src/demo/demo.cpp)
\ No newline at end of file
Added: pkg/trunk/util/logging/FORMATS
===================================================================
--- pkg/trunk/util/logging/FORMATS (rev 0)
+++ pkg/trunk/util/logging/FORMATS 2008-09-25 02:16:41 UTC (rev 4666)
@@ -0,0 +1,40 @@
+Version 0:
+-------------
+topic_name
+md5sum
+datatype
+<repeating N>
+ time.sec
+ time.nsec
+ length
+ MSGDATA
+-------------
+
+Version 1.0:
+-------------
+#ROSLOG V1.0
+quantity
+<repeating quantity>
+ topic_name
+ md5sum
+ datatype
+<repeating N>
+ topic_name
+ time.sec
+ time.nsec
+ length
+ MSGDATA
+-------------
+
+Version 1.1:
+-------------
+#ROSLOG V1.1
+<repeating N>
+ topic_name
+ md5sum
+ datatype
+ time.sec
+ time.nsec
+ length
+ MSGDATA
+-------------
Added: pkg/trunk/util/logging/Makefile
===================================================================
--- pkg/trunk/util/logging/Makefile (rev 0)
+++ pkg/trunk/util/logging/Makefile 2008-09-25 02:16:41 UTC (rev 4666)
@@ -0,0 +1 @@
+include $(shell rospack find mk)/cmake.mk
Added: pkg/trunk/util/logging/include/logging/LogFunctor.h
===================================================================
--- pkg/trunk/util/logging/include/logging/LogFunctor.h (rev 0)
+++ pkg/trunk/util/logging/include/logging/LogFunctor.h 2008-09-25 02:16:41 UTC (rev 4666)
@@ -0,0 +1,103 @@
+/*********************************************************************
+* Software License Agreement (BSD License)
+*
+* Copyright (c) 2008, Willow Garage, Inc.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of the Willow Garage nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*********************************************************************/
+
+#ifndef LOGFUNCTOR_H
+#define LOGFUNCTOR_H
+
+#include "ros/time.h"
+#include <string>
+
+class AbstractLogFunctor
+{
+public:
+ virtual void call(std::string, ros::msg*, ros::Time) = 0;
+ virtual ros::msg* allocateMsg() = 0;
+ virtual ~AbstractLogFunctor() {}
+};
+
+class EmptyObject
+{
+
+};
+
+template<class M, class T = EmptyObject>
+class LogFunctor : public AbstractLogFunctor
+{
+public:
+ LogFunctor(void (*fp)(std::string, M*, ros::Time, void*), void* user_data)
+ : inflate_(true), obj_(NULL), fp_(NULL), fp_typed_(fp), fp_obj_(NULL), fp_typed_obj_(NULL), user_data_(user_data) { }
+
+ LogFunctor(void (*fp)(std::string, ros::msg*, ros::Time, void*), void* user_data, bool inflate)
+ : inflate_(inflate), obj_(NULL), fp_(fp), fp_typed_(NULL), fp_obj_(NULL), fp_typed_obj_(NULL), user_data_(user_data) { }
+
+ LogFunctor(T* obj, void (T::*fp)(std::string, M*, ros::Time, void*), void* user_data)
+ : inflate_(true), obj_(obj), fp_(NULL), fp_typed_(NULL), fp_obj_(NULL), fp_typed_obj_(fp), user_data_(user_data) { }
+
+ LogFunctor(T* obj, void (T::*fp)(std::string, ros::msg*, ros::Time, void*), void* user_data, bool inflate)
+ : inflate_(inflate), obj_(obj), fp_(NULL), fp_typed_(NULL), fp_obj_(fp), fp_typed_obj_(NULL), user_data_(user_data) { }
+
+ virtual void call(std::string topic_name, ros::msg* msg, ros::Time time)
+ {
+ if (obj_)
+ {
+ if (fp_obj_)
+ (*obj_.*fp_obj_)(topic_name, msg, time, user_data_);
+ else if(fp_typed_obj_)
+ (*obj_.*fp_typed_obj_)(topic_name, (M*)msg, time, user_data_);
+ } else {
+ if (fp_)
+ (*fp_)(topic_name, msg, time, user_data_);
+ else if (fp_typed_)
+ (*fp_typed_)(topic_name, (M*)msg, time, user_data_);
+ }
+ }
+
+ virtual ros::msg* allocateMsg()
+ {
+ if (fp_typed_ || fp_typed_obj_)
+ return new M;
+ else
+ return NULL;
+ }
+private:
+ bool inflate_;
+ T* obj_;
+ void (*fp_)(std::string, ros::msg*, ros::Time, void*);
+ void (*fp_typed_)(std::string, M*, ros::Time, void*);
+ void (T::*fp_obj_)(std::string, ros::msg*, ros::Time, void*);
+ void (T::*fp_typed_obj_)(std::string, M*, ros::Time, void*);
+ void *user_data_;
+};
+
+#endif
Modified: pkg/trunk/util/logging/include/logging/LogPlayer.h
===================================================================
--- pkg/trunk/util/logging/include/logging/LogPlayer.h 2008-09-25 01:29:12 UTC (rev 4665)
+++ pkg/trunk/util/logging/include/logging/LogPlayer.h 2008-09-25 02:16:41 UTC (rev 4666)
@@ -38,30 +38,39 @@
#include "ros/node.h"
#include "ros/time.h"
#include "logging/AnyMsg.h"
+#include "logging/LogFunctor.h"
#include <fstream>
#include <sstream>
+#include <cstdio>
class LogPlayer
{
-
+ struct FilteredLogFunctor
+ {
+ std::string topic_name;
+ std::string md5sum;
+ std::string datatype;
+ bool inflate;
+ AbstractLogFunctor* f;
+ };
+
+
class LogHelper : public ros::msg
{
- typedef std::pair<void (*)(std::string, ros::msg*, ros::Time, void*), void*> Callback;
+ LogPlayer* log_player_;
std::string topic_name_;
+ std::string md5sum_;
std::string datatype_;
- std::string md5sum_;
- std::vector<Callback> callbacks_;
-
ros::msg* msg_;
uint8_t* next_msg_;
uint32_t next_msg_size_;
public:
- LogHelper(std::string topic_name, std::string datatype, std::string md5sum)
- : topic_name_(topic_name), datatype_(datatype), md5sum_(md5sum),
+ LogHelper(LogPlayer* log_player, std::string topic_name, std::string md5sum, std::string datatype)
+ : log_player_(log_player), topic_name_(topic_name), md5sum_(md5sum), datatype_(datatype),
msg_(NULL), next_msg_(NULL), next_msg_size_(0) {}
virtual ~LogHelper()
@@ -70,38 +79,55 @@
delete msg_;
}
- void addHandler(ros::msg* msg, void (*fp)(std::string, ros::msg*, ros::Time, void*), void* ptr)
+ void callHandlers()
{
- if (msg)
- {
- if (msg_)
- delete msg_;
- msg_ = msg;
- }
- callbacks_.push_back(Callback(fp, ptr));
- }
+ next_msg_ = log_player_->next_msg_;
+ next_msg_size_ = log_player_->next_msg_size_;
- void callHandlers(uint8_t* next_msg, uint32_t next_msg_size, ros::Time time)
- {
- next_msg_ = next_msg;
- next_msg_size_ = next_msg_size;
-
__serialized_length = next_msg_size_;
- ros::msg* msg = this;
-
if (msg_)
{
msg_->__serialized_length = next_msg_size_;
msg_->deserialize(next_msg_);
- msg = msg_;
}
- for (std::vector<Callback>::iterator cb_it = callbacks_.begin();
- cb_it != callbacks_.end();
- cb_it++)
- (*(cb_it->first))(topic_name_, msg, time, (cb_it->second));
+ for (std::vector<FilteredLogFunctor>::iterator flf_it = log_player_->callbacks_.begin();
+ flf_it != log_player_->callbacks_.end();
+ flf_it++)
+ {
+
+ if (topic_name_ == flf_it->topic_name ||
+ flf_it->topic_name == std::string("*"))
+ {
+
+ if (flf_it->md5sum != md5sum_ &&
+ md5sum_ != std::string("*"))
+ break;
+
+ if (flf_it->datatype != datatype_ &&
+ flf_it->datatype != std::string("*") &&
+ datatype_ != std::string("*"))
+ break;
+
+ if (flf_it->inflate && msg_ == NULL)
+ {
+ msg_ = flf_it->f->allocateMsg();
+
+ if (msg_)
+ {
+ msg_->__serialized_length = next_msg_size_;
+ msg_->deserialize(next_msg_);
+ }
+ }
+
+ if (flf_it->inflate)
+ flf_it->f->call(topic_name_, msg_, log_player_->next_msg_time_);
+ else
+ flf_it->f->call(topic_name_, this, log_player_->next_msg_time_);
+ }
+ }
}
std::string get_topic_name() {return topic_name_;}
@@ -124,25 +150,30 @@
std::ifstream log_file_;
- bool old_format_;
+ int version_;
ros::Time start_time_;
std::map<std::string, LogHelper*> topics_;
std::string next_msg_name_;
- uint8_t *next_msg_;
- uint32_t next_msg_size_, next_msg_alloc_size_;
+
ros::Time next_msg_time_;
bool done_;
public:
- LogPlayer() : old_format_(false), next_msg_(NULL), next_msg_size_(0), next_msg_alloc_size_(0), done_(false) {}
+ LogPlayer() : version_(0), done_(false), next_msg_(NULL), next_msg_size_(0), next_msg_alloc_size_(0) {}
virtual ~LogPlayer()
{
+ for (std::vector<FilteredLogFunctor>::iterator flf_it = callbacks_.begin();
+ flf_it != callbacks_.end();
+ flf_it++)
+ if (flf_it->f)
+ delete (flf_it->f);
+
close();
}
@@ -175,44 +206,65 @@
return false;
}
- std::string comment_line;
- getline(log_file_, comment_line);
+ int version_major = 0;
+ int version_minor = 0;
- if (comment_line[0] != '#')
- log_file_.seekg(0, std::ios_base::beg);
+ std::string version_line;
+ getline(log_file_, version_line);
- std::string quantity_line;
- getline(log_file_,quantity_line);
+ sscanf(version_line.c_str(), "#ROSLOG V%d.%d", &version_major, &version_minor);
- std::istringstream iss(quantity_line);
+ if (version_major == 0 && version_line[0] == '#')
+ {
+ version_major = 1;
+ }
- int quantity = -1;
- iss >> quantity;
-
- std::cout << "Reading " << quantity << " topics from " << file_name << std::endl;
+ version_ = version_major * 100 + version_minor;
- if (quantity == -1)
+ int quantity = 0;
+
+ if (version_ == 0)
{
- old_format_ = true;
+ std::cout << "Opening ROSLOG version 0" << std::endl;
+
+ log_file_.seekg(0, std::ios_base::beg);
+
quantity = 1;
- log_file_.seekg(-(int)(quantity_line.size() + 1), std::ios_base::cur);
+
}
+ else if (version_ == 100)
+ {
+ std::cout << "Opening ROSLOG version 1.0" << std::endl;
- std::string topic_name;
- std::string md5sum;
- std::string datatype;
+ std::string quantity_line;
+ getline(log_file_,quantity_line);
+ sscanf(quantity_line.c_str(), "%d", &quantity);
+ }
+ else if (version_ == 101)
+ {
+ std::cout << "Opening ROSLOG version 1.1" << std::endl;
+ }
- for (int i = 0; i < quantity; i++)
+ if (version_ == 0 || version_ == 100)
{
- getline(log_file_,topic_name);
- getline(log_file_,md5sum);
- getline(log_file_,datatype);
+ // std::cout << "Reading " << quantity << " topics from " << file_name << std::endl;
- std::cout << " (" << i << "): " << topic_name << ", " << md5sum << ", " << datatype << std::endl;
+ std::string topic_name;
+ std::string md5sum;
+ std::string datatype;
- LogHelper* l = new LogHelper(topic_name, md5sum, datatype);
-
- topics_[topic_name] = l;
+ for (int i = 0; i < quantity; i++)
+ {
+ getline(log_file_,topic_name);
+ getline(log_file_,md5sum);
+ getline(log_file_,datatype);
+
+ // std::cout << " (" << i << "): " << topic_name << ", " << md5sum << ", " << datatype << std::endl;
+
+ LogHelper* l = new LogHelper(this, topic_name, md5sum, datatype);
+
+ topics_[topic_name] = l;
+ }
}
readNextMsg();
@@ -220,53 +272,62 @@
return true;
}
+ template <class M>
+ void addHandler(std::string topic_name, void (*fp)(std::string, ros::msg*, ros::Time, void*), void* ptr, bool inflate)
+ {
+ FilteredLogFunctor flf;
- std::vector<std::string> getNames() {
- std::vector<std::string> names;
- for (std::map<std::string, LogHelper*>::iterator topic_it = topics_.begin();
- topic_it != topics_.end();
- topic_it++)
- names.push_back(topic_it->first);
+ flf.topic_name = topic_name;
+ flf.md5sum = M::__s_get_md5sum();
+ flf.datatype = M::__s_get_datatype();
+ flf.inflate = inflate;
+ flf.f = new LogFunctor<M>(fp, ptr, inflate);
- return names;
+ callbacks_.push_back(flf);
}
template <class M>
- int addHandler(std::string topic_name, void (*fp)(std::string, ros::msg*, ros::Time, void*), void* ptr, bool inflate)
+ void addHandler(std::string topic_name, void (*fp)(std::string, M*, ros::Time, void*), void* ptr)
{
+ FilteredLogFunctor flf;
- int count = 0;
+ flf.topic_name = topic_name;
+ flf.md5sum = M::__s_get_md5sum();
+ flf.datatype = M::__s_get_datatype();
+ flf.inflate = true;
+ flf.f = new LogFunctor<M>(fp, ptr);
- for (std::map<std::string, LogHelper*>::iterator topic_it = topics_.begin();
- topic_it != topics_.end();
- topic_it++)
- {
- if (topic_name == std::string("*") ||
- topic_name == (topic_it->second)->get_topic_name())
- {
+ callbacks_.push_back(flf);
+ }
- if (M::__s_get_md5sum() != (topic_it->second)->__get_md5sum() &&
- (topic_it->second)->__get_md5sum() != std::string("*"))
- break;
+ template <class M, class T>
+ void addHandler(std::string topic_name, void (T::*fp)(std::string, ros::msg*, ros::Time, void*), T* obj, void* ptr, bool inflate)
+ {
+ FilteredLogFunctor flf;
- if (M::__s_get_datatype() != (topic_it->second)->__get_datatype() &&
- M::__s_get_datatype() != std::string("*") && (topic_it->second)->__get_datatype() != std::string("*"))
- break;
-
- M* msg = NULL;
+ flf.topic_name = topic_name;
+ flf.md5sum = M::__s_get_md5sum();
+ flf.datatype = M::__s_get_datatype();
+ flf.inflate = inflate;
+ flf.f = new LogFunctor<M, T>(obj, fp, ptr, inflate);
- if (inflate)
- msg = new M;
-
- (topic_it->second)->addHandler(msg, fp, ptr);
- count++;
-
- }
- }
- return count;
+ callbacks_.push_back(flf);
}
+ template <class M, class T>
+ void addHandler(std::string topic_name, void (T::*fp)(std::string, M*, ros::Time, void*), T* obj, void* ptr)
+ {
+ FilteredLogFunctor flf;
+ flf.topic_name = topic_name;
+ flf.md5sum = M::__s_get_md5sum();
+ flf.datatype = M::__s_get_datatype();
+ flf.inflate = true;
+ flf.f = new LogFunctor<M, T>(obj, fp, ptr);
+
+ callbacks_.push_back(flf);
+ }
+
ros::Time get_next_msg_time()
{
if (!done_)
@@ -279,17 +340,24 @@
{
if (done_)
return false;
-
+
if (topics_.find(next_msg_name_) != topics_.end())
- topics_[next_msg_name_]->callHandlers(next_msg_, next_msg_size_, next_msg_time_);
-
+ {
+ topics_[next_msg_name_]->callHandlers();
+ }
+
readNextMsg();
-
+
return true;
}
-
+
protected:
+ uint8_t *next_msg_;
+ uint32_t next_msg_size_, next_msg_alloc_size_;
+
+ std::vector<FilteredLogFunctor> callbacks_;
+
bool readNextMsg()
{
if (!log_file_.good())
@@ -297,28 +365,51 @@
done_ = true;
return false;
}
+
+ if (version_ <= 100)
+ {
+ if (version_ == 0)
+ next_msg_name_ = (topics_.begin())->first;
+ else
+ getline(log_file_, next_msg_name_);
+
+ ros::Duration next_msg_dur;
- if (old_format_)
- {
- next_msg_name_ = (topics_.begin())->first;
+
} else {
- getline(log_file_, next_msg_name_);
+
+ std::string topic_name;
+ std::string md5sum;
+ std::string datatype;
+
+ getline(log_file_,topic_name);
+ getline(log_file_,md5sum);
+ getline(log_file_,datatype);
+
+ next_msg_name_ = topic_name;
+
+ if (topics_.find(topic_name) == topics_.end())
+ {
+ LogHelper* l = new LogHelper(this, topic_name, md5sum, datatype);
+ topics_[topic_name] = l;
+ }
+
}
ros::Duration next_msg_dur;
-
+
log_file_.read((char*)&next_msg_dur.sec, 4);
log_file_.read((char*)&next_msg_dur.nsec, 4);
log_file_.read((char*)&next_msg_size_, 4);
-
+
next_msg_time_ = start_time_ + next_msg_dur;
-
+
if (log_file_.eof())
{
done_ = true;
return false;
}
-
+
if (next_msg_size_ > next_msg_alloc_size_)
{
if (next_msg_)
@@ -326,7 +417,7 @@
next_msg_alloc_size_ = next_msg_size_ * 2;
next_msg_ = new uint8_t[next_msg_alloc_size_];
}
-
+
log_file_.read((char*)next_msg_, next_msg_size_);
if (log_file_.eof())
@@ -334,10 +425,10 @@
done_ = true;
return false;
}
+
+ return true;
- return true;
}
-
};
class MultiLogPlayer
@@ -379,25 +470,6 @@
return true;
}
- std::vector<std::string> getNames() {
-
- std::vector<std::string> names;
-
- for (std::vector<LogPlayer*>::iterator player_it = players_.begin();
- player_it != players_.end();
- player_it++)
- {
- std::vector<std::string> n = (*player_it)->getNames();
-
- for (std::vector<std::string>::iterator topic_it = n.begin();
- topic_it != n.end();
- topic_it++)
- names.push_back(*topic_it);
- }
-
- return names;
- }
-
bool nextMsg()
{
LogPlayer* next_player = 0;
@@ -433,17 +505,49 @@
}
template <class M>
- int addHandler(std::string topic_name, void (*fp)(std::string, ros::msg*, ros::Time, void*), void* ptr, bool inflate)
+ void addHandler(std::string topic_name, void (*fp)(std::string, ros::msg*, ros::Time, void*), void* ptr, bool inflate)
{
- int count = 0;
for (std::vector<LogPlayer*>::iterator player_it = players_.begin();
player_it != players_.end();
player_it++)
{
- count += (*player_it)->addHandler<M>(topic_name, fp, ptr, inflate);
+ (*player_it)->addHandler<M>(topic_name, fp, ptr, inflate);
}
- return count;
}
+
+ template <class M>
+ void addHandler(std::string topic_name, void (*fp)(std::string, M*, ros::Time, void*), void* ptr)
+ {
+ for (std::vector<LogPlayer*>::iterator player_it = players_.begin();
+ player_it != players_.end();
+ player_it++)
+ {
+ (*player_it)->addHandler<M>(topic_name, fp, ptr);
+ }
+ }
+
+ template <class M, class T>
+ void addHandler(std::string topic_name, void (T::*fp)(std::string, ros::msg*, ros::Time, void*), T* obj, void* ptr, bool inflate)
+ {
+ for (std::vector<LogPlayer*>::iterator player_it = players_.begin();
+ player_it != players_.end();
+ player_it++)
+ {
+ (*player_it)->addHandler<M>(topic_name, fp, obj, ptr, inflate);
+ }
+ }
+
+ template <class M, class T>
+ void addHandler(std::string topic_name, void (T::*fp)(std::string, M*, ros::Time, void*), T* obj, void* ptr)
+ {
+ for (std::vector<LogPlayer*>::iterator player_it = players_.begin();
+ player_it != players_.end();
+ player_it++)
+ {
+ (*player_it)->addHandler<M>(topic_name, fp, obj, ptr);
+ }
+ }
};
#endif
+
Modified: pkg/trunk/util/logging/include/logging/LogRecorder.h
===================================================================
--- pkg/trunk/util/logging/include/logging/LogRecorder.h 2008-09-25 01:29:12 UTC (rev 4665)
+++ pkg/trunk/util/logging/include/logging/LogRecorder.h 2008-09-25 02:16:41 UTC (rev 4666)
@@ -37,7 +37,7 @@
#include "ros/time.h"
#include "rosthread/mutex.h"
-#include "logging/AnyMsg.h"
+#include "logging/LogFunctor.h"
#include <fstream>
#include <iostream>
@@ -47,34 +47,35 @@
class LogRecorder
{
+ typedef std::vector<std::pair<std::string, std::string> > TopicList;
+
class LogHelper : public ros::msg
{
- typedef std::pair<void (*)(std::string, ros::msg*, void*), void*> Callback;
-
LogRecorder* log_recorder_;
std::string topic_name_;
std::string datatype_;
std::string md5sum_;
- Callback* callback_;
+ AbstractLogFunctor* callback_;
ros::msg* msg_;
- unsigned int max_count_;
- unsigned int count_;
+ unsigned int max_queue_;
+ bool first_;
public:
- LogHelper(LogRecorder* log_recorder, std::string topic_name, std::string datatype, std::string md5sum, unsigned int max_count = 0)
+ LogHelper(LogRecorder* log_recorder, std::string topic_name, std::string datatype, std::string md5sum, unsigned int max_queue)
: log_recorder_(log_recorder),
topic_name_(topic_name), datatype_(datatype), md5sum_(md5sum),
callback_(NULL),
msg_(NULL),
- max_count_(max_count),
- count_(0) {}
+ max_queue_(max_queue),
+ first_(true)
+ {}
virtual ~LogHelper()
{
@@ -85,36 +86,29 @@
delete callback_;
}
-
- void addHandler(ros::msg* msg, void (*fp)(std::string, ros::msg*, void*), void* ptr)
+ void addHandler(AbstractLogFunctor* callback)
{
- if (msg)
- {
- if (msg_)
- delete msg_;
- msg_ = msg;
- }
+ if (msg_ == NULL)
+ msg_ = callback->allocateMsg();
+ else
+ msg_ = this;
- callback_ = new Callback(fp, ptr);
+ callback_ = callback;
}
void callHandler()
{
- if (count_++ < max_count_ || max_count_ == 0)
+ if (callback_)
{
- ros::msg* msg = this;
-
- if (msg_)
- msg = msg_;
-
- if (callback_)
- (*(callback_->first))(topic_name_, msg, (callback_->second));
+ ros::Time now = ros::Time::now();
+ callback_->call(topic_name_, msg_, now);
}
}
-
std::string get_topic_name() {return topic_name_;}
+ int get_max_queue() {return max_queue_;}
+
virtual const std::string __get_datatype() const { return datatype_; }
virtual const std::string __get_md5sum() const { return md5sum_; }
@@ -125,24 +119,39 @@
virtual uint8_t *deserialize(uint8_t *read_ptr)
{
+ if (first_)
+ {
+ std::string mapped_topic_name = log_recorder_->node_->map_name(topic_name_);
+
+ if (datatype_ == "*")
+ {
+ TopicList topics;
+
+ log_recorder_->node_->get_published_topics(&topics);
+
+ for (TopicList::iterator i = topics.begin(); i != topics.end(); i++)
+ if (i->first == mapped_topic_name)
+ {
+ datatype_ = i->second;
+ break;
+ }
+ }
+ }
+
uint8_t* sz = read_ptr + __serialized_length;
- if (count_ < max_count_ || max_count_ == 0)
- {
- sz = log_recorder_->log(get_topic_name(), read_ptr, __serialized_length);
- if (msg_)
- {
- msg_->__serialized_length = __serialized_length;
- msg_->deserialize(read_ptr);
- }
+ sz = log_recorder_->log(get_topic_name(), __get_datatype(), __get_md5sum(), read_ptr, __serialized_length);
+
+ if (msg_)
+ {
+ msg_->__serialized_length = __serialized_length;
+ msg_->deserialize(read_ptr);
}
return sz;
}
};
- ros::node* node_;
-
std::ofstream log_file_;
ros::thread::mutex log_mutex_;
@@ -151,9 +160,11 @@
std::vector<LogHelper*> topics_;
+ bool started_;
+
public:
- LogRecorder(ros::node* node) : node_(node) {}
+ LogRecorder(ros::node* node) : started_(false), node_(node) {}
virtual ~LogRecorder()
{
@@ -179,62 +190,93 @@
return false;
}
- log_file_ << "#ROSLOG V1.0" << std::endl << std::setw(4) << std::setfill('0') << 0 << std::endl;
+ log_file_ << "#ROSLOG V1.1" << std::endl;
return true;
}
+ template <class M>
+ LogHelper* addTopic_(std::string topic_name, int max_queue)
+ {
+ if (!started_)
+ {
+ std::string datatype = M::__s_get_datatype();
+ std::string md5sum = M::__s_get_md5sum();
+
+ LogHelper* l = new LogHelper(this, topic_name, datatype, md5sum, max_queue);
+
+ topics_.push_back(l);
+
+ return l;
+
+ } else {
+ std::cerr << "Tried to add topic \"" << topic_name << "\" after logging started." << std::endl;
+ return NULL;
+ }
+ }
+
template <class M>
- void addTopic(std::string topic_name, void (*fp)(std::string, ros::msg*, void*) = NULL, void* ptr = NULL, bool inflate = false, unsigned int max_count = 0)
+ void addTopic(std::string topic_name, int max_queue)
{
-
- LogHelper* l = new LogHelper(this, topic_name, M::__s_get_datatype(), M::__s_get_md5sum(), max_count);
- topics_.push_back(l);
+ addTopic_<M>(topic_name, max_queue);
+ }
- log_mutex_.lock();
+ template <class M>
+ void addTopic(std::string topic_name, int max_queue, void (*fp)(std::string, ros::msg*, ros::Time, void*), void* ptr = NULL, bool inflate = false)
+ {
+ LogHelper* l = addTopic_<M>(topic_name, max_queue);
+
+ if (!l)
+ return;
- log_file_.seekp(0, std::ios_base::beg);
- log_file_ << "#ROSLOG V1.0" << std::endl << std::setw(4) << std::setfill('0') << topics_.size() << std::endl;
- log_file_.seekp(0, std::ios_base::end);
+ if (fp != NULL)
+ {
+ Abstra...
[truncated message content] |
|
From: <hsu...@us...> - 2008-09-25 16:25:23
|
Revision: 4675
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4675&view=rev
Author: hsujohnhsu
Date: 2008-09-25 16:25:17 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
testslide now passes.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.py
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testscan.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.py
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.py 2008-09-25 05:54:46 UTC (rev 4674)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.py 2008-09-25 16:25:17 UTC (rev 4675)
@@ -49,9 +49,9 @@
from std_msgs.msg import *
from robot_msgs.msg import *
-TARGET_X = -5.4
-TARGET_Y = 0.0
-TARGET_Z = 2.6
+TARGET_X = -5.4 + 25.65 #contains offset specified in P3D for base, alternatively, use the gripper roll ground truths
+TARGET_Y = 0.0 + 25.65 #contains offset specified in P3D for base, alternatively, use the gripper roll ground truths
+TARGET_Z = 3.8
TARGET_RAD = 4.5
class TestSlide(unittest.TestCase):
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world 2008-09-25 05:54:46 UTC (rev 4674)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world 2008-09-25 16:25:17 UTC (rev 4675)
@@ -29,10 +29,6 @@
<erp>0.2</erp>
</physics:ode>
- <geo:origin>
- <lat>37.4270909558</lat><lon>-122.077919338</lon>
- </geo:origin>
-
<rendering:gui>
<type>fltk</type>
<size>1024 800</size>
@@ -219,5 +215,27 @@
</light>
</model:renderable>
+ <geo:origin>
+ <lat>37.4270909558</lat><lon>-122.077919338</lon>
+ </geo:origin>
+ <model:physical name="robot_model1">
+
+ <controller:ros_time name="ros_time" plugin="libRos_Time.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>100.0</updateRate>
+ <interface:audio name="dummy_ros_time_iface_should_not_be_here"/>
+ </controller:ros_time>
+
+ <xyz>0.0 0.0 0.0 </xyz>
+ <rpy>0.0 0.0 0.0 </rpy>
+
+ <!-- base, torso and arms -->
+ <include embedded="true">
+ <xi:include href="pr2_xml.model" />
+ </include>
+
+ </model:physical>
+
+
</gazebo:world>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/testscan.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/testscan.world 2008-09-25 05:54:46 UTC (rev 4674)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/testscan.world 2008-09-25 16:25:17 UTC (rev 4675)
@@ -29,10 +29,6 @@
<erp>0.2</erp>
</physics:ode>
- <geo:origin>
- <lat>37.4270909558</lat><lon>-122.077919338</lon>
- </geo:origin>
-
<rendering:gui>
<type>fltk</type>
<size>1024 800</size>
@@ -199,12 +195,19 @@
</model:renderable>
<model:physical name="robot_model1">
- <xyz>0.0 0.0 0.02</xyz> <!-- bottom of base off the ground by this much, basically wheel height below skirt -->
- <rpy>0.0 0.0 0.0 </rpy>
+ <controller:ros_time name="ros_time" plugin="libRos_Time.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>100.0</updateRate>
+ <interface:audio name="dummy_ros_time_iface_should_not_be_here"/>
+ </controller:ros_time>
+
+ <xyz>0.0 0.0 0.0 </xyz>
+ <rpy>0.0 0.0 0.0 </rpy>
+
<!-- base, torso and arms -->
<include embedded="true">
- <xi:include href="pr2_xml_test.model" />
+ <xi:include href="pr2_xml.model" />
</include>
</model:physical>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world 2008-09-25 05:54:46 UTC (rev 4674)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world 2008-09-25 16:25:17 UTC (rev 4675)
@@ -112,7 +112,9 @@
<geom:trimesh name="endbin_geom">
<static>true</static>
<kp>10000000000.0</kp>
- <kd>9000</kd>
+ <kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<scale> 4 2 4</scale>
<mesh>cup.mesh</mesh>
@@ -142,16 +144,16 @@
<xyz> 0.0 0.0 0.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<body:box name="slide1_legs_body">
- <kp>10</kp>
- <kd>0.1</kd>
<geom:box name="slide_base_geom">
<kp>1000000000000000</kp>
<kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<xyz> 0.0 5.0 13</xyz>
<rpy> 45.0 0.0 0.00</rpy>
<size> 2.0 14.14 1.0</size>
- <mass> 10.0</mass>
+ <mass> 1000.0</mass>
<visual>
<size>2.0 14.14 1.0</size>
<material>Gazebo/Rocky</material>
@@ -163,10 +165,12 @@
<geom:box name="slide_side1_geom">
<kp>100000</kp>
<kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<xyz> 1.0 5.0 13.7</xyz>
<rpy> 135.0 0.0 0.00</rpy>
<size> 1.0 1.0 14.14</size>
- <mass> 10.0</mass>
+ <mass> 1000.0</mass>
<visual>
<size>0.1 1.0 14.14</size>
<material>Gazebo/Rocky</material>
@@ -176,10 +180,12 @@
<geom:box name="slide_side2_geom">
<kp>100000</kp>
<kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<xyz> -1.0 7.0 15.5</xyz>
<rpy> 135.0 0.0 0.00</rpy>
<size> 1.0 1.0 10.0</size>
- <mass> 10.0</mass>
+ <mass> 1000.0</mass>
<visual>
<size>0.1 1.0 9.0</size>
<material>Gazebo/Rocky</material>
@@ -191,7 +197,9 @@
<geom:sphere name="slide_end_geom">
<kp>1000000.0</kp>
- <kd>0.1</kd>
+ <kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<mesh>default</mesh>
<xyz> 1.0 -1.0 9.5</xyz>
<size> 2.5</size>
@@ -216,7 +224,9 @@
<geom:box name="support_1">
<kp>10000000.0</kp>
- <kd>0.1</kd>
+ <kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<xyz>1000.0 1000.0 1.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<mesh>default</mesh>
@@ -230,7 +240,9 @@
</geom:box>
<geom:box name="support_2">
<kp>10000000.0</kp>
- <kd>0.1</kd>
+ <kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<xyz>1000.0 -1000.0 1.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<mesh>default</mesh>
@@ -244,7 +256,9 @@
</geom:box>
<geom:box name="support_3">
<kp>10000000.0</kp>
- <kd>0.1</kd>
+ <kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<xyz>-1000.0 -1000.0 1.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<mesh>default</mesh>
@@ -258,7 +272,9 @@
</geom:box>
<geom:box name="support_4">
<kp>10000000.0</kp>
- <kd>0.1</kd>
+ <kd>1</kd>
+ <mu1>0.0</mu1>
+ <mu2>0.0</mu2>
<xyz>-1000.0 1000.0 1.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<mesh>default</mesh>
@@ -282,6 +298,8 @@
<geom:sphere name="ball_geom">
<kp>100000.0</kp>
<kd>1.0</kd>
+ <mu1>5.0</mu1>
+ <mu2>5.0</mu2>
<mesh>default</mesh>
<size> 0.25</size>
<mass> 10.0</mass>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-09-25 20:07:15
|
Revision: 4682
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4682&view=rev
Author: hsujohnhsu
Date: 2008-09-25 20:07:06 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
camera test working.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.py
pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.xml
pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world
Added Paths:
-----------
pkg/trunk/drivers/simulator/gazebo_plugin/test/testcamera.valid.ppm
Removed Paths:
-------------
pkg/trunk/drivers/simulator/gazebo_plugin/test/testcamera.valid.jpg
Property changes on: pkg/trunk/drivers/simulator/gazebo_plugin/test/testcamera.valid.ppm
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.py
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.py 2008-09-25 19:07:59 UTC (rev 4681)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.py 2008-09-25 20:07:06 UTC (rev 4682)
@@ -37,15 +37,23 @@
PKG = 'gazebo_plugin'
NAME = 'testcameras'
+import math
import rostools
rostools.update_path(PKG)
+rostools.update_path('rostest')
+rostools.update_path('std_msgs')
+rostools.update_path('robot_msgs')
+rostools.update_path('rostest')
+rostools.update_path('rospy')
import sys, unittest
import os, os.path, threading, time
import rospy, rostest
from std_msgs.msg import *
+from PIL import Image as pili
+from PIL import ImageChops as pilic
-FRAME_TARGET = "cam_sen-0050.jpg"
+FRAME_TARGET = "cam_sen-0050.ppm"
FRAME_DIR = "testcameraframes"
class PollCameraThread(threading.Thread):
@@ -69,11 +77,12 @@
def __init__(self, *args):
super(TestCameras, self).__init__(*args)
self.success = False
- self.pollThread = PollCameraThread(self, FRAME_DIR)
+ self.tested = False
+ #self.pollThread = PollCameraThread(self, FRAME_DIR)
def onTargetFrame(self):
time.sleep(0.5) #Safety, to make sure the image is really done being written.
- ps = "diff -q " + FRAME_DIR + "/" + FRAME_TARGET + " test/testcamera.valid.jpg"
+ ps = "diff -q " + FRAME_DIR + "/" + FRAME_TARGET + " test/testcamera.valid.ppm"
#print "CMD: " + ps + "\n"
result = os.system(ps)
if (result == 0):
@@ -82,26 +91,68 @@
else:
self.success = False
#print "Failure\n"
- os.system("killall gazebo") #Huge temp hack to kill gazebo.
rospy.signal_shutdown('test done')
-
- def test_cameras(self):
+
+ def images_are_the_same(self,i0,i1):
+ # assume len(i0)==len(i1)
+ print "lengths ",len(i0), len(i1)
+ for i in range(len(i0)):
+ (r0,g0,b0) = i0[i-1]
+ (r1,g1,b1) = i1[i-1]
+ if abs(r0-r1) > 0 or abs(g0-g1) > 0 or abs(b0-b1) > 0:
+ print "debug errors ",i,abs(r0-r1),abs(g0-g1),abs(b0-b1)
+ tol = 10
+ if abs(r0-r1) > tol or abs(g0-g1) > tol or abs(b0-b1) > tol:
+ return False
+ return True
+
+ def imageInput(self,image):
+ print " got image from ROS, begin comparing images "
+ print " - load validation image from file testcamera.valid.ppm "
+ im0 = pili.open("testcamera.valid.ppm")
+ print " - load image from ROS "
+ size = image.width,image.height
+ im1 = pili.new("RGBA",size)
+ im1 = pili.frombuffer("RGB",size,str(image.data));
+ im1 = im1.transpose(pili.FLIP_LEFT_RIGHT).rotate(180);
+ imc = pilic.difference(im0,im1)
+ print " - comparing images "
+ #im1.save("testsave.ppm") # to capture a new valid frame when things change
+ #im1.show()
+ #im0.show()
+ #imc.show()
+ comp_result = self.images_are_the_same(im0.getdata(),im1.getdata())
+ print "test comparison ", comp_result
+ #print "proofcomparison ", self.images_are_the_same(im1.getdata(),im1.getdata())
+ if (comp_result == 1):
+ print " - images are the Same "
+ self.success = True
+ else:
+ print " - images differ "
+ self.success = False
+ self.tested = True
+
+ def testcameras(self):
+ print " wait 3 sec for objects to settle "
+ time.sleep(3)
+ print " subscribe image from ROS "
+ rospy.subscribe_topic("test_camera/image", Image, self.imageInput)
rospy.ready(NAME, anonymous=True)
- self.pollThread.start()
- timeout_t = time.time() + 30.0 #30 seconds
- while not rospy.is_shutdown() and not self.success and time.time() < timeout_t:
+ #self.pollThread.start()
+ timeout_t = time.time() + 60 #60 seconds delay for processing comparison
+ while not rospy.is_shutdown() and not self.tested and time.time() < timeout_t:
time.sleep(0.1)
- os.system("killall gazebo")
self.assert_(self.success)
if __name__ == '__main__':
- while (os.path.isfile(FRAME_DIR + "/" + FRAME_TARGET)):
- print "Old test case still alive."
- time.sleep(0.00001)
+ #while (os.path.isfile(FRAME_DIR + "/" + FRAME_TARGET)):
+ # print "Old test case still alive."
+ # time.sleep(1)
- rostest.run(PKG, sys.argv[0], TestCameras, sys.argv) #, text_mode=True)
+ print " starting test "
+ rostest.run(PKG, sys.argv[0], TestCameras, sys.argv)
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.xml
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.xml 2008-09-25 19:07:59 UTC (rev 4681)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/testcameras.xml 2008-09-25 20:07:06 UTC (rev 4682)
@@ -1,6 +1,12 @@
<launch>
- <master start="auto" />
- <include file="$(find wg_robot_description)/send_test.xml"/>
- <node pkg="gazebo" type="gazebo" args="$(find gazebo_robot_description)/world/testcameras.world" />
- <test test-name="gazebo_plugin_testcameras" pkg="gazebo_plugin" type="testcameras.py" />
+ <master auto="start" />
+ <param name="robotdesc/pr2" command="$(find wg_robot_description_parser)/merge "$(find wg_robot_description)/pr2/pr2.xml"" />
+ <node pkg="gazebo" type="gazebo" args="-n $(find gazebo_robot_description)/world/testcameras.world" respawn="false" output="screen">
+ <env name="LD_LIBRARY_PATH" value="$(find gazebo_plugin)/lib:$(find gazebo)/gazebo/lib:$(find Cg)/Cg/lib:$LD_LIBRARY_PATH" />
+ <env name="GAZEBO_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
+ <env name="OGRE_RESOURCE_PATH" value="$(find ogre)/ogre/lib/OGRE" />
+ <env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
+ </node>
+ <!--<node pkg="gazebo_plugin" type="groundtruthtransform" args="" respawn="true" />-->
+ <test test-name="gazebo_plugin_testcameras" pkg="gazebo_plugin" type="testcameras.py" />
</launch>
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.xml
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.xml 2008-09-25 19:07:59 UTC (rev 4681)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.xml 2008-09-25 20:07:06 UTC (rev 4682)
@@ -1,6 +1,12 @@
<launch>
- <master start="auto" />
- <include file="$(find wg_robot_description)/send_test.xml"/>
- <node pkg="gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/testscan.world" respawn="true" />
- <test test-name="gazebo_plugin_testpointclouds" pkg="gazebo_plugin" type="testscan.py" />
+ <master auto="start" />
+ <param name="robotdesc/pr2" command="$(find wg_robot_description_parser)/merge "$(find wg_robot_description)/pr2/pr2.xml"" />
+ <node pkg="gazebo" type="gazebo" args="-n $(find gazebo_robot_description)/world/testscan.world" respawn="false" output="screen">
+ <env name="LD_LIBRARY_PATH" value="$(find gazebo_plugin)/lib:$(find gazebo)/gazebo/lib:$(find Cg)/Cg/lib:$LD_LIBRARY_PATH" />
+ <env name="GAZEBO_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
+ <env name="OGRE_RESOURCE_PATH" value="$(find ogre)/ogre/lib/OGRE" />
+ <env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
+ </node>
+ <!--<node pkg="gazebo_plugin" type="groundtruthtransform" args="" respawn="true" />-->
+ <test test-name="gazebo_plugin_testpointclouds" pkg="gazebo_plugin" type="testscan.py" />
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world 2008-09-25 19:07:59 UTC (rev 4681)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world 2008-09-25 20:07:06 UTC (rev 4682)
@@ -40,17 +40,19 @@
<rpy>0 45 0</rpy>
<saveFrames>true</saveFrames>
<startSaveFrames>true</startSaveFrames>
- <saveFramePath>testcameraframes</saveFramePath>
+ <saveFramePath>testguicameraframes</saveFramePath>
</camera>
</row>
</frames>
</rendering:gui>
- <model:physical name="cam_mod">
- <body:empty name="cam_bod">
+ <!-- camera used to test Ros_Camera plugin -->
+ <model:physical name="test_camera_model">
+ <body:empty name="test_camera_body">
<xyz>-1 0 3</xyz>
<rpy>0 45 0</rpy>
- <sensor:camera name="cam_sen">
+ <sensor:camera name="test_camera_sensor">
+ <alwaysOn>true</alwaysOn>
<size>1024 800</size>
<hfov>60</hfov>
<nearClip>0.1</nearClip>
@@ -58,11 +60,12 @@
<updateRate>15.0</updateRate>
<saveFrames>true</saveFrames>
<saveFramePath>testcameraframes</saveFramePath>
- <controller:ros_camera name="cam_controller" plugin="libRos_Camera.so">
+ <controller:ros_camera name="test_camera_controller" plugin="libRos_Camera.so">
+ <alwaysOn>true</alwaysOn>
<updateRate>15.0</updateRate>
- <topicName>cam_test</topicName>
- <frameName>cam_test</frameName>
- <interface:camera name="cam_iface" />
+ <topicName>test_camera/image</topicName>
+ <frameName>test_camera_body</frameName>
+ <interface:camera name="test_camera_iface" />
</controller:ros_camera>
</sensor:camera>
</body:empty>
@@ -71,7 +74,7 @@
<rendering:ogre>
<ambient>1.0 1.0 1.0 1.0</ambient>
<sky>
- <material>Gazebo/CloudySky</material>
+ <material>Gazebo/White</material>
</sky>
<gazeboPath>media</gazeboPath>
<grid>false</grid>
@@ -92,46 +95,12 @@
<normal>0 0 1</normal>
<size>51.3 51.3</size>
<!-- map3.png -->
- <material>PR2/floor_texture</material>
+ <material>Gazebo/White</material>
</geom:plane>
</body:plane>
</model:physical>
- <!-- The "desk"-->
- <model:physical name="desk1_model">
- <xyz> 2.28 -0.21 -0.10</xyz>
- <rpy> 0.0 0.0 0.50</rpy>
- <body:box name="desk1_legs_body">
- <geom:box name="desk1_legs_geom">
- <kp>100000000.0</kp>
- <kd>1.0</kd>
- <xyz> 0.0 0.0 0.50</xyz>
- <mesh>default</mesh>
- <size>0.5 1.0 0.75</size>
- <mass> 10.0</mass>
- <visual>
- <size> 0.5 1.0 0.75</size>
- <material>Gazebo/Rocky</material>
- <mesh>unit_box</mesh>
- </visual>
- </geom:box>
- <geom:box name="desk1_top_geom">
- <kp>100000000.0</kp>
- <kd>0.1</kd>
- <xyz> 0.0 0.0 0.90</xyz>
- <mesh>default</mesh>
- <size>0.75 1.5 0.05</size>
- <mass> 10.0</mass>
- <visual>
- <size> 0.75 1.5 0.05</size>
- <material>Gazebo/Rocky</material>
- <mesh>unit_box</mesh>
- </visual>
- </geom:box>
- </body:box>
- </model:physical>
-
<!-- The small cuboidal "cup" -->
<model:physical name="cylinder1_model">
<xyz> 0.78 1.0 0.075</xyz>
@@ -215,10 +184,6 @@
</light>
</model:renderable>
- <geo:origin>
- <lat>37.4270909558</lat><lon>-122.077919338</lon>
- </geo:origin>
-
<model:physical name="robot_model1">
<controller:ros_time name="ros_time" plugin="libRos_Time.so">
@@ -227,8 +192,8 @@
<interface:audio name="dummy_ros_time_iface_should_not_be_here"/>
</controller:ros_time>
- <xyz>0.0 0.0 0.0 </xyz>
- <rpy>0.0 0.0 0.0 </rpy>
+ <xyz> -3.0 0.0 0.0 </xyz>
+ <rpy> 0.0 0.0 0.0 </rpy>
<!-- base, torso and arms -->
<include embedded="true">
@@ -237,5 +202,4 @@
</model:physical>
-
</gazebo:world>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-09-25 22:23:33
|
Revision: 4686
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4686&view=rev
Author: hsujohnhsu
Date: 2008-09-25 22:23:20 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
* update robot height on startup so it does not bounce around.
* laser scan test for base scan working and passes.
* move hztest to gazebo_plugin
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc
pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.py
pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_arm_test.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_arm_test_headless.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_floorobj.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_headless.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_obs.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_obstacle.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_single_link.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_tablegrasp.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_test_coord.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg_headless.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testscan.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world
Added Paths:
-----------
pkg/trunk/drivers/simulator/gazebo_plugin/test/hztest.xml
pkg/trunk/drivers/simulator/gazebo_plugin/test/odom_hztest.xml
pkg/trunk/drivers/simulator/gazebo_plugin/test/rostime_hztest.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/teststereo.world
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc 2008-09-25 21:34:42 UTC (rev 4685)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Block_Laser.cc 2008-09-25 22:23:20 UTC (rev 4686)
@@ -188,7 +188,6 @@
double r1, r2, r3, r4, r; // four corner values + interpolated range
int v;
-
Angle maxAngle = this->myParent->GetMaxAngle();
Angle minAngle = this->myParent->GetMinAngle();
@@ -284,6 +283,12 @@
v = (int) this->myParent->GetRetro(j1) || (int) this->myParent->GetRetro(j2) ||
(int) this->myParent->GetRetro(j3) || (int) this->myParent->GetRetro(j4);
+ std::cout << " block debug "
+ << " ij("<<i<<","<<j<<")"
+ << " j1234("<<j1<<","<<j2<<","<<j3<<","<<j4<<")"
+ << " r1234("<<r1<<","<<r2<<","<<r3<<","<<r4<<")"
+ << std::endl;
+
this->laserIface->data->ranges[i] = r + minRange;
this->laserIface->data->intensity[i] = v;
Copied: pkg/trunk/drivers/simulator/gazebo_plugin/test/hztest.xml (from rev 4680, pkg/trunk/demos/2dnav-gazebo/hztest.xml)
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/hztest.xml (rev 0)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/hztest.xml 2008-09-25 22:23:20 UTC (rev 4686)
@@ -0,0 +1,36 @@
+<launch>
+ <!-- Bring up the node we want to test. -->
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
+
+ <!-- Run hztest -->
+ <!-- Test for publication of 'base_scan' topic -->
+ <test test-name="hztest_test_scan" pkg="rostest" type="hztest" name="base_scan_test">
+ <!-- The topic to listen for -->
+ <param name="topic" value="base_scan" />
+ <!-- The expected publication rate [Hz]. Set to 0.0 to only check that
+ at least one message is received. -->
+ <param name="hz" value="5.0" />
+ <!-- Acceptable error in the publication rate [Hz]. Ignored if hz is set
+ to 0.0. -->
+ <param name="hzerror" value="3.0" />
+ <!-- Time to listen for [seconds] -->
+ <param name="test_duration" value="5.0" />
+ <!-- Whether each inter-message time interval should be checked against
+ the expected publication rate and error bound [boolean]. If true, then
+ the test will fail if the time elapsed between *any* two consecutive
+ messages exceeded the specified limits. If false, then we only check
+ the average publication rate over the entire test. Default: false. -->
+ <param name="check_intervals" value="false" />
+ </test>
+
+ <!-- Test for publication of 'tilt_scan' topic. -->
+ <test test-name="hztest_test_tilt_scan" pkg="rostest" type="hztest" name="tilt_scan_test">
+ <!-- Note how we use a different parameter namespace and node name
+ for this test (tilt_scan_test vs. scan_test). -->
+ <param name="topic" value="tilt_scan" />
+ <param name="hz" value="5.0" />
+ <param name="hzerror" value="3.0" />
+ <param name="test_duration" value="5.0" />
+ <param name="check_intervals" value="false" />
+ </test>
+</launch>
Copied: pkg/trunk/drivers/simulator/gazebo_plugin/test/odom_hztest.xml (from rev 4680, pkg/trunk/demos/2dnav-gazebo/odom_hz_test.xml)
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/odom_hztest.xml (rev 0)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/odom_hztest.xml 2008-09-25 22:23:20 UTC (rev 4686)
@@ -0,0 +1,15 @@
+<launch>
+ <!-- Bring up the node we want to test. -->
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
+
+ <!-- Test for publication of 'odom' topic. -->
+ <test test-name="hztest_test_odom" pkg="rostest" type="hztest" name="odom_test">
+ <!-- Note how we use a different parameter namespace and node name
+ for this test (odom_test vs. scan_test). -->
+ <param name="topic" value="odom" />
+ <param name="hz" value="25.0" />
+ <param name="hzerror" value="10.0" />
+ <param name="test_duration" value="5.0" />
+ <param name="check_intervals" value="false" />
+ </test>
+</launch>
Copied: pkg/trunk/drivers/simulator/gazebo_plugin/test/rostime_hztest.xml (from rev 4680, pkg/trunk/demos/2dnav-gazebo/rostime_hztest.xml)
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/rostime_hztest.xml (rev 0)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/rostime_hztest.xml 2008-09-25 22:23:20 UTC (rev 4686)
@@ -0,0 +1,15 @@
+<launch>
+ <!-- Bring up the node we want to test. -->
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
+
+ <!-- Test for publication of 'odom' topic. -->
+ <test test-name="hztest_test_rostime" pkg="rostest" type="hztest" name="rostime_test">
+ <!-- Note how we use a different parameter namespace and node name
+ for this test (odom_test vs. scan_test). -->
+ <param name="topic" value="ros_time" />
+ <param name="hz" value="25.0" />
+ <param name="hzerror" value="10.0" />
+ <param name="test_duration" value="10.0" />
+ <param name="check_intervals" value="false" />
+ </test>
+</launch>
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.py
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.py 2008-09-25 21:34:42 UTC (rev 4685)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.py 2008-09-25 22:23:20 UTC (rev 4686)
@@ -37,113 +37,121 @@
PKG = 'gazebo_plugin'
NAME = 'testscan'
+import math
import rostools
rostools.update_path(PKG)
+rostools.update_path('rostest')
+rostools.update_path('std_msgs')
+rostools.update_path('robot_msgs')
+rostools.update_path('rostest')
+rostools.update_path('rospy')
+
import sys, unittest
import os, os.path, threading, time
import rospy, rostest
from std_msgs.msg import *
-TARGET_RANGES = [10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 1.02020120621, 1.02020120621, 0.994996726513, 0.978999376297, 0.966377794743, 0.954521596432,
- 0.946537315845, 0.938699901104, 0.931005299091, 0.923867344856, 0.918545365334, 0.913301467896, 0.908134281635,
- 0.903042435646, 0.898042142391, 0.894432485104, 0.890870153904, 0.887354433537, 0.883884489536, 0.880459964275,
- 0.877079963684, 0.874371290207, 0.87203514576, 0.869730234146, 0.867456197739, 0.865212798119, 0.862999677658,
- 0.860816538334, 0.858880698681, 0.857526659966, 0.856195926666, 0.854888141155, 0.853603363037, 0.852341353893,
- 0.851101875305, 0.849884927273, 0.848810076714, 0.848314881325, 0.847839236259, 0.847383201122, 0.846946537495,
- 0.846529304981, 0.846131563187, 0.845753133297, 0.845394074917, 0.845493674278, 0.845822274685, 0.846170067787,
- 0.846537172794, 0.846923649311, 0.847329437733, 0.847754657269, 0.848199427128, 0.848777770996, 0.849939465523,
- 0.851123332977, 0.852329492569, 0.853558063507, 0.854809224606, 0.856083095074, 0.85737991333, 0.858728706837,
- 0.860843420029, 0.862987458706, 0.865161120892, 0.867364525795, 0.869598209858, 0.871862351894, 0.874157428741,
- 0.877089142799, 0.880418121815, 0.883790969849, 0.887208282948, 0.890670895576, 0.894179165363, 0.898019433022,
- 0.902963221073, 0.907979309559, 0.913068950176, 0.918233573437, 0.92347484827, 0.930853664875, 0.938418328762,
- 0.946122050285, 0.953988730907, 0.966012120247, 0.978349208832, 0.994455933571, 0.70413172245, 0.70413172245,
- 0.699802815914, 0.69553899765, 0.691339015961, 0.687201619148, 0.683125734329, 0.679109990597, 0.681101262569,
- 0.683556973934, 0.686044812202, 0.688565373421, 0.691119015217, 0.693706274033, 0.696327507496, 0.698884189129,
- 0.702267229557, 0.706037044525, 0.709827125072, 0.71367174387, 0.717571854591, 0.721528351307, 0.725542485714,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 1.84625160694, 1.84625160694,
- 1.84267711639, 1.83915615082, 1.83568811417, 1.83227264881, 1.82890927792, 1.82559776306, 1.82233738899,
- 1.8191280365, 1.81596922874, 1.81286048889, 1.80980145931, 1.80679190159, 1.80383121967, 1.80091929436,
- 1.79805552959, 1.79523980618, 1.79247164726, 1.78975069523, 1.78707683086, 1.78444945812, 1.78186845779,
- 1.77933347225, 1.77684426308, 1.77440047264, 1.77200174332, 1.76964783669, 1.76733863354, 1.76507377625,
- 1.76285290718, 1.76067578793, 1.75854229927, 1.75645208359, 1.75440490246, 1.75240063667, 1.7504389286,
- 1.74851965904, 1.74664247036, 1.74480736256, 1.743013978, 1.74126207829, 1.73955154419, 1.73788225651,
- 1.73625385761, 1.73466622829, 1.73311936855, 1.73161280155, 1.7301466465, 1.72872054577, 1.72733438015,
- 1.72598814964, 1.72468149662, 1.72341430187, 1.7221865654, 1.72099816799, 1.71984875202, 1.7187384367,
- 1.7176669836, 1.71663427353, 1.71564018726, 1.7146846056, 1.71376752853, 1.71288883686, 1.71204829216,
- 1.71124601364, 1.71048164368, 1.70975542068, 1.70906698704, 1.70841646194, 1.7078037262, 1.70722866058,
- 1.7066911459, 1.70619130135, 1.70572900772, 1.70530414581, 1.70491671562, 1.70456671715, 1.70425403118,
- 1.70397877693, 1.70374071598, 1.70353996754, 1.70337641239, 1.70325005054, 1.70316100121, 1.70310914516,
- 1.70309448242, 1.70311701298, 1.70317673683, 1.70327365398, 1.70340788364, 1.70357918739, 1.70378780365,
- 1.70403373241, 1.70431697369, 1.70463752747, 1.70499539375, 1.70539069176, 1.70582354069, 1.70629370213,
- 1.7068015337, 1.7073469162, 1.70792996883, 1.7085506916, 1.70920920372, 1.70990550518, 1.7106398344,
- 1.71141219139, 1.71222257614, 1.71307110786, 1.71395790577, 1.71488320827, 1.71584677696, 1.71684896946,
- 1.71788990498, 1.71896958351, 1.72008812428, 1.72124576569, 1.72244250774, 1.72367858887, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 1.05949211121,
- 1.05949211121, 1.05673527718, 1.05401551723, 1.05133235455, 1.04868555069, 1.04607462883, 1.04349911213,
- 1.04095888138, 1.03845345974, 1.03993999958, 1.05028426647, 1.06085050106, 1.07164573669, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
- 10.0, 10.0, 10.0, 10.0]
+TARGET_RANGES = [
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 2.05170464516, 2.04536008835, 2.03909778595, 2.03291654587, 2.02681565285,
+2.02079415321, 2.01485085487, 2.00898480415, 2.0031952858, 1.99748134613, 1.99184203148, 1.98627638817,
+1.98078382015, 1.97536325455, 1.9700139761, 1.96473526955, 1.95952606201, 1.95438587666, 1.94931387901,
+1.94430923462, 1.93937122822, 1.93449926376, 1.92969250679, 1.92495036125, 1.92027211189, 1.91565704346,
+1.91110467911, 1.90661418438, 1.90218496323, 1.91215276718, 1.93008923531, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 2.64686512947, 2.6173157692, 2.59563803673, 2.57963132858, 2.5657658577,
+2.55445694923, 2.54415798187, 2.53618431091, 2.52831435204, 2.5224199295, 2.51713490486, 2.51194572449,
+2.50885725021, 2.50583004951, 2.50296163559, 2.50192046165, 2.50093340874, 2.5, 2.50093340874,
+2.50192022324, 2.50296139717, 2.50582957268, 2.50885748863, 2.51194500923, 2.51713514328, 2.52241945267,
+2.52831435204, 2.53618454933, 2.54415798187, 2.55445718765, 2.5657658577, 2.57963109016, 2.59563827515,
+2.6173157692, 2.64686512947, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 2.74098372459, 2.72118186951, 2.72313261032, 2.72514390945, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 1.85238564014, 1.80339097977, 1.77707922459, 1.75727534294, 1.74103367329,
+1.72714829445, 1.71498286724, 1.70415234566, 1.69440209866, 1.68555378914, 1.67747652531, 1.67007064819,
+1.66325867176, 1.6569788456, 1.65118086338, 1.64582335949, 1.64087188244, 1.63629746437, 1.63207530975,
+1.62818443775, 1.62460672855, 1.62132656574, 1.61833024025, 1.61560595036, 1.61314368248, 1.61093437672,
+1.60897052288, 1.60724556446, 1.6057536602, 1.60449028015, 1.60345125198, 1.60263371468, 1.60203504562,
+1.60165333748, 1.60148763657, 1.60153746605, 1.60180282593, 1.60228455067, 1.60298418999, 1.60390377045,
+1.60504591465, 1.60641443729, 1.60801339149, 1.60984802246, 1.61192440987, 1.61424958706, 1.61683177948,
+1.61968040466, 1.62280631065, 1.62622225285, 1.62994265556, 1.6339840889, 1.63836622238, 1.64311158657,
+1.64824676514, 1.65380322933, 1.65981829166, 1.66633713245, 1.6734149456, 1.68112039566, 1.68954002857,
+1.69878637791, 1.709010005, 1.72041964531, 1.73332083225, 1.74819290638, 1.76587283611, 1.7881039381,
+1.82019233704, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907,
+10.0500001907, 10.0500001907, 10.0500001907, 10.0500001907, ]
@@ -166,25 +174,22 @@
def pointInput(self, cloud):
i = 0
- print "Input"
+ print "Input laser scan received"
self.printPointCloud(cloud)
while (i < len(cloud.ranges) and i < len(TARGET_RANGES)):
d = cloud.ranges[i] - TARGET_RANGES[i]
if ((d < -0.001) or (d > 0.001)):
return
i = i + 1
-
- os.system("killall gazebo")
self.success = True
def test_pointcloud(self):
print "LNK\n"
rospy.TopicSub("base_scan", LaserScan, self.pointInput)
rospy.ready(NAME, anonymous=True)
- timeout_t = time.time() + 30.0 #30 seconds
+ timeout_t = time.time() + 5.0
while not rospy.is_shutdown() and not self.success and time.time() < timeout_t:
time.sleep(0.1)
- os.system("killall gazebo")
self.assert_(self.success)
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.xml
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.xml 2008-09-25 21:34:42 UTC (rev 4685)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/testscan.xml 2008-09-25 22:23:20 UTC (rev 4686)
@@ -7,6 +7,8 @@
<env name="OGRE_RESOURCE_PATH" value="$(find ogre)/ogre/lib/OGRE" />
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
+ <node pkg="mechanism_control" type="mech.py" args="sp $(find wg_robot_description)/pr2/controllers.xml" respawn="false" output="screen" />
+ <node pkg="robot_mechanism_controllers" type="control.py" args="set tilt_laser_controller 46" respawn="false" output="screen" />
<!--<node pkg="gazebo_plugin" type="groundtruthtransform" args="" respawn="true" />-->
<test test-name="gazebo_plugin_testpointclouds" pkg="gazebo_plugin" type="testscan.py" />
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot.world 2008-09-25 21:34:42 UTC (rev 4685)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot.world 2008-09-25 22:23:20 UTC (rev 4686)
@@ -323,7 +323,7 @@
<interface:audio name="dummy_ros_time_iface_should_not_be_here"/>
</controller:ros_time>
- <xyz>0.0 0.0 0.02</xyz> <!-- bottom of base off the ground by this much, basically wheel height below skirt -->
+ <xyz>0.0 0.0 0.0408</xyz> <!-- bottom of base off the ground by this much, basically wheel height below skirt -->
<rpy>0.0 0.0 0.0 </rpy>
<!-- base, torso and arms -->
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_arm_test.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_arm_test.world 2008-09-25 21:34:42 UTC (rev 4685)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_arm_test.world 2008-09-25 22:23:20 UTC (rev 4686)
@@ -163,7 +163,7 @@
</controller:ros_time>
<!-- location of robot in the world -->
- <xyz>0.0 0.0 0.0</xyz>
+ <xyz>0.0 0.0 0.0408</xyz>
<rpy>0.0 0.0 0.0</rpy>
<!-- base and arm -->
Mo...
[truncated message content] |
|
From: <hsu...@us...> - 2008-09-25 22:48:38
|
Revision: 4688
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4688&view=rev
Author: hsujohnhsu
Date: 2008-09-25 22:48:32 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
more updates to tests.
Modified Paths:
--------------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
pkg/trunk/demos/2dnav-gazebo/manifest.xml
pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -6,7 +6,7 @@
<node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
<node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
- <node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" />
+ <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
</group>
</launch>
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -12,7 +12,7 @@
<!-- for manual control -->
<!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
- <node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" />
+ <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
</group>
</launch>
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -12,7 +12,7 @@
<!-- for manual control -->
<!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
- <node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" />
+ <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
</group>
</launch>
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-fake_localization.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -12,7 +12,7 @@
<!-- for manual control -->
<!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
- <node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" />
+ <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
</group>
</launch>
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless-fake_localization.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -12,7 +12,7 @@
<!-- for manual control -->
<!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
- <node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" />
+ <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
</group>
</launch>
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -6,7 +6,7 @@
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" />
<node pkg="nav_view" type="nav_view" respawn="true" />
- <node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" />
+ <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" /-->
</group>
</launch>
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -6,7 +6,7 @@
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
<node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
<node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
- <node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" />
+ <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
</group>
</launch>
Modified: pkg/trunk/demos/2dnav-gazebo/manifest.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/manifest.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/demos/2dnav-gazebo/manifest.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -14,4 +14,5 @@
<depend package="teleop_arm_keyboard"/>
<depend package="laser_view"/>
<depend package="pr2_gui"/>
+ <depend package="executive_trex_pr2"/>
</package>
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.xml
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.xml 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/test/testslide.xml 2008-09-25 22:48:32 UTC (rev 4688)
@@ -8,5 +8,41 @@
<env name="MC_RESOURCE_PATH" value="$(find gazebo_robot_description)/world" />
</node>
<!--<node pkg="gazebo_plugin" type="groundtruthtransform" args="" respawn="true" />-->
- <test test-name="gazebo_plugin_testslide" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide0" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide1" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide2" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide3" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide4" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide5" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide6" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide7" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide8" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide9" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide10" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide11" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide12" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide13" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide14" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide15" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide16" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide17" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide18" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide19" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide20" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide21" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide22" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide23" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide24" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide25" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide26" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide27" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide28" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide29" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide30" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide31" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide32" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide33" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide34" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide35" pkg="gazebo_plugin" type="testslide.py" />
+ <test test-name="gazebo_plugin_testslide36" pkg="gazebo_plugin" type="testslide.py" />
</launch>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/testcameras.world 2008-09-25 22:48:32 UTC (rev 4688)
@@ -36,9 +36,9 @@
<frames>
<row height="100%">
<camera width="100%">
- <xyz>-1 0 3</xyz>
- <rpy>0 45 0</rpy>
- <saveFrames>true</saveFrames>
+ <xyz>-8 0 3</xyz>
+ <rpy>0 25 0</rpy>
+ <saveFrames>false</saveFrames>
<startSaveFrames>true</startSaveFrames>
<saveFramePath>testguicameraframes</saveFramePath>
</camera>
@@ -58,7 +58,7 @@
<nearClip>0.1</nearClip>
<farClip>100</farClip>
<updateRate>15.0</updateRate>
- <saveFrames>true</saveFrames>
+ <saveFrames>false</saveFrames>
<saveFramePath>testcameraframes</saveFramePath>
<controller:ros_camera name="test_camera_controller" plugin="libRos_Camera.so">
<alwaysOn>true</alwaysOn>
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world 2008-09-25 22:23:51 UTC (rev 4687)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world 2008-09-25 22:48:32 UTC (rev 4688)
@@ -334,7 +334,7 @@
<interface:audio name="dummy_ros_time_iface_should_not_be_here"/>
</controller:ros_time>
- <xyz>0.0 8.0 0.0408</xyz>
+ <xyz>0.0 8.0 50.0 </xyz>
<rpy>0.0 0.0 90.0 </rpy>
<!-- base, torso and arms -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-09-27 00:57:26
|
Revision: 4740
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4740&view=rev
Author: hsujohnhsu
Date: 2008-09-27 00:57:16 +0000 (Sat, 27 Sep 2008)
Log Message:
-----------
fixing proper shutdown behavior. unsubscribe, unadvertise.
Modified Paths:
--------------
pkg/trunk/controllers/pr2_mechanism_controllers/include/pr2_mechanism_controllers/arm_position_controller.h
pkg/trunk/controllers/pr2_mechanism_controllers/include/pr2_mechanism_controllers/laser_scanner_controller.h
pkg/trunk/controllers/pr2_mechanism_controllers/src/arm_position_controller.cpp
pkg/trunk/controllers/pr2_mechanism_controllers/src/laser_scanner_controller.cpp
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_position_controller.cpp
pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
Modified: pkg/trunk/controllers/pr2_mechanism_controllers/include/pr2_mechanism_controllers/arm_position_controller.h
===================================================================
--- pkg/trunk/controllers/pr2_mechanism_controllers/include/pr2_mechanism_controllers/arm_position_controller.h 2008-09-27 00:55:04 UTC (rev 4739)
+++ pkg/trunk/controllers/pr2_mechanism_controllers/include/pr2_mechanism_controllers/arm_position_controller.h 2008-09-27 00:57:16 UTC (rev 4740)
@@ -280,11 +280,22 @@
private:
pr2_mechanism_controllers::JointPosCmd msg_; //The message used by the ROS callback
ArmPositionController *c_;
+
+ /*!
+ * \brief service prefix
+ */
+ std::string service_prefix_;
+
/*
* \brief save topic name for unsubscribe later
*/
const char * topic_name_;
+ /*!
+ * \brief xml pointer to ros topic name
+ */
+ TiXmlElement * ros_cb_;
+
/*
* \brief pointer to ros node
*/
Modified: pkg/trunk/controllers/pr2_mechanism_controllers/include/pr2_mechanism_controllers/laser_scanner_controller.h
===================================================================
--- pkg/trunk/controllers/pr2_mechanism_controllers/include/pr2_mechanism_controllers/laser_scanner_controller.h 2008-09-27 00:55:04 UTC (rev 4739)
+++ pkg/trunk/controllers/pr2_mechanism_controllers/include/pr2_mechanism_controllers/laser_scanner_controller.h 2008-09-27 00:57:16 UTC (rev 4740)
@@ -234,6 +234,16 @@
private:
LaserScannerController *c_;
+ /*!
+ * \brief service prefix
+ */
+ std::string service_prefix_;
+
+ /*!
+ * \brief A pointer to ros node
+ */
+ ros::node *node_;
+
};
}
Modified: pkg/trunk/controllers/pr2_mechanism_controllers/src/arm_position_controller.cpp
===================================================================
--- pkg/trunk/controllers/pr2_mechanism_controllers/src/arm_position_controller.cpp 2008-09-27 00:55:04 UTC (rev 4739)
+++ pkg/trunk/controllers/pr2_mechanism_controllers/src/arm_position_controller.cpp 2008-09-27 00:57:16 UTC (rev 4740)
@@ -230,7 +230,15 @@
ArmPositionControllerNode::~ArmPositionControllerNode()
{
- node_->unsubscribe(topic_name_);
+ node_->unadvertise_service(service_prefix_ + "/set_command");
+ node_->unadvertise_service(service_prefix_ + "/set_command_array");
+ node_->unadvertise_service(service_prefix_ + "/get_command");
+ node_->unadvertise_service(service_prefix_ + "/set_target");
+
+ std::cout << "unsub arm controller" << ros_cb_ << " " << topic_name_ << std::endl;
+ if(ros_cb_ && topic_name_)
+ node_->unsubscribe(topic_name_);
+
delete c_;
}
@@ -242,20 +250,20 @@
bool ArmPositionControllerNode::initXml(mechanism::RobotState * robot, TiXmlElement * config)
{
std::cout<<"LOADING ARMCONTROLLERNODE"<<std::endl;
- string prefix = config->Attribute("name");
- std::cout<<"the prefix is "<<prefix<<std::endl;
+ service_prefix_ = config->Attribute("name");
+ std::cout<<"the service_prefix_ is "<<service_prefix_<<std::endl;
// Parses subcontroller configuration
if(c_->initXml(robot, config))
{
- node_->advertise_service(prefix + "/set_command", &ArmPositionControllerNode::setJointPosHeadless, this);
- node_->advertise_service(prefix + "/set_command_array", &ArmPositionControllerNode::setJointPosSrv, this);
- node_->advertise_service(prefix + "/get_command", &ArmPositionControllerNode::getJointPosCmd, this);
- node_->advertise_service(prefix + "/set_target", &ArmPositionControllerNode::setJointPosTarget, this);
+ node_->advertise_service(service_prefix_ + "/set_command", &ArmPositionControllerNode::setJointPosHeadless, this);
+ node_->advertise_service(service_prefix_ + "/set_command_array", &ArmPositionControllerNode::setJointPosSrv, this);
+ node_->advertise_service(service_prefix_ + "/get_command", &ArmPositionControllerNode::getJointPosCmd, this);
+ node_->advertise_service(service_prefix_ + "/set_target", &ArmPositionControllerNode::setJointPosTarget, this);
- TiXmlElement * ros_cb = config->FirstChildElement("listen_topic");
- if(ros_cb)
+ ros_cb_ = config->FirstChildElement("listen_topic");
+ if(ros_cb_)
{
- topic_name_=ros_cb->Attribute("name");
+ topic_name_=ros_cb_->Attribute("name");
if(!topic_name_)
{
std::cout<<" A listen _topic is present in the xml file but no name is specified\n";
Modified: pkg/trunk/controllers/pr2_mechanism_controllers/src/laser_scanner_controller.cpp
===================================================================
--- pkg/trunk/controllers/pr2_mechanism_controllers/src/laser_scanner_controller.cpp 2008-09-27 00:55:04 UTC (rev 4739)
+++ pkg/trunk/controllers/pr2_mechanism_controllers/src/laser_scanner_controller.cpp 2008-09-27 00:57:16 UTC (rev 4740)
@@ -392,7 +392,7 @@
}
ROS_REGISTER_CONTROLLER(LaserScannerControllerNode)
-LaserScannerControllerNode::LaserScannerControllerNode()
+LaserScannerControllerNode::LaserScannerControllerNode(): node_(ros::node::instance())
{
c_ = new LaserScannerController();
}
@@ -400,6 +400,9 @@
LaserScannerControllerNode::~LaserScannerControllerNode()
{
+ node_->unadvertise_service(service_prefix_ + "/set_command");
+ node_->unadvertise_service(service_prefix_ + "/get_command");
+ node_->unadvertise_service(service_prefix_ + "/set_profile");
delete c_;
}
@@ -458,14 +461,13 @@
bool LaserScannerControllerNode::initXml(mechanism::RobotState *robot, TiXmlElement *config)
{
- ros::node *node = ros::node::instance();
- string prefix = config->Attribute("name");
+ service_prefix_ = config->Attribute("name");
if (!c_->initXml(robot, config))
return false;
- node->advertise_service(prefix + "/set_command", &LaserScannerControllerNode::setCommand, this);
- node->advertise_service(prefix + "/get_command", &LaserScannerControllerNode::getCommand, this);
- node->advertise_service(prefix + "/set_profile", &LaserScannerControllerNode::setProfileCall, this);
+ node_->advertise_service(service_prefix_ + "/set_command", &LaserScannerControllerNode::setCommand, this);
+ node_->advertise_service(service_prefix_ + "/get_command", &LaserScannerControllerNode::getCommand, this);
+ node_->advertise_service(service_prefix_ + "/set_profile", &LaserScannerControllerNode::setProfileCall, this);
return true;
}
bool LaserScannerControllerNode::getActual(
Modified: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h 2008-09-27 00:55:04 UTC (rev 4739)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_position_controller.h 2008-09-27 00:57:16 UTC (rev 4740)
@@ -201,6 +201,11 @@
const char * topic_name_;
/*!
+ * \brief xml pointer to ros topic name
+ */
+ TiXmlElement * ros_cb;
+
+ /*!
* \brief A pointer to ros node
*/
ros::node *node_;
Modified: pkg/trunk/controllers/robot_mechanism_controllers/src/joint_position_controller.cpp
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/src/joint_position_controller.cpp 2008-09-27 00:55:04 UTC (rev 4739)
+++ pkg/trunk/controllers/robot_mechanism_controllers/src/joint_position_controller.cpp 2008-09-27 00:57:16 UTC (rev 4740)
@@ -167,7 +167,8 @@
{
node_->unadvertise_service(service_prefix_ + "/set_command");
node_->unadvertise_service(service_prefix_ + "/get_actual");
- node_->unsubscribe(topic_name_);
+ if(ros_cb && topic_name_)
+ node_->unsubscribe(topic_name_);
delete c_;
}
@@ -233,7 +234,7 @@
node_->advertise_service(service_prefix_ + "/get_actual", &JointPositionControllerNode::getActual, this);
guard_get_actual_.set(service_prefix_ + "/get_actual");
- TiXmlElement * ros_cb = config->FirstChildElement("listen_topic");
+ ros_cb = config->FirstChildElement("listen_topic");
if(ros_cb)
{
topic_name_=ros_cb->Attribute("name");
Modified: pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2008-09-27 00:55:04 UTC (rev 4739)
+++ pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2008-09-27 00:57:16 UTC (rev 4740)
@@ -44,11 +44,11 @@
MechanismControl::~MechanismControl()
{
// Destroy all controllers
- // for (int i = 0; i < MAX_NUM_CONTROLLERS; ++i)
- // {
- // if (controllers_[i] != NULL)
- // delete controllers_[i];
- // }
+ for (int i = 0; i < MAX_NUM_CONTROLLERS; ++i)
+ {
+ if (controllers_[i] != NULL)
+ delete controllers_[i];
+ }
if (state_)
delete state_;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-09-29 15:57:52
|
Revision: 4762
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4762&view=rev
Author: hsujohnhsu
Date: 2008-09-29 15:57:25 +0000 (Mon, 29 Sep 2008)
Log Message:
-----------
more udpates on documentation for plugins.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/P3D.hh
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Block_Laser.hh
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Camera.hh
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Laser.hh
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Time.hh
pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/P3D.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/P3D.hh 2008-09-29 07:39:29 UTC (rev 4761)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/P3D.hh 2008-09-29 15:57:25 UTC (rev 4762)
@@ -44,7 +44,7 @@
\brief P3D controller.
- This controller requires to a model as its parent. The plugin broadcasts a specific body's pose and rates through a ROS TransformWithRateSTamped message as well as filling out a PositionIface.
+ This controller requires to a model as its parent. The plugin broadcasts a body's pose and rates through ROS std_msgs::TransformWithRateStamped message as well as filling out a Gazebo::PositionIface. In the example below, the plubin broadcasts pose and rate of a body named \b body_name over ROS topic name \b body_pose_groud_truth.
\verbatim
<model:physical name="some_fancy_model">
@@ -65,7 +65,8 @@
*/
/// \brief P3D controller
- /// This is a controller that simulates a 6 dof position sensor
+ /// \li Starts a ROS node if none exists.
+ /// \li This controller simulates a 6 dof position and rate sensor.
class P3D : public Controller
{
/// \brief Constructor
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Block_Laser.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Block_Laser.hh 2008-09-29 07:39:29 UTC (rev 4761)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Block_Laser.hh 2008-09-29 15:57:25 UTC (rev 4762)
@@ -87,8 +87,9 @@
\{
*/
-/// \brief ros laser controller.
-/// This is a controller that simulates a ros laser
+/// \brief ROS laser block simulation.
+/// \li Starts a ROS node if none exists.
+/// \li This controller simulates a block of laser range detections.
class Ros_Block_Laser : public Controller
{
/// \brief Constructor
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Camera.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Camera.hh 2008-09-29 07:39:29 UTC (rev 4761)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Camera.hh 2008-09-29 15:57:25 UTC (rev 4762)
@@ -42,7 +42,7 @@
\brief Ros Camera Plugin Controller.
- This is a controller that collects data from a Camera Sensor and populates a libgazebo camera interfaace as well as publish a ROS std_msgs::Image (under topicName). This controller should only be used as a child of a camera sensor
+ This is a controller that collects data from a Camera Sensor and populates a libgazebo camera interface as well as publish a ROS std_msgs::Image (under the field \b \<topicName\>). This controller should only be used as a child of a camera sensor (see example below.
\verbatim
<model:physical name="camera_model">
@@ -63,8 +63,9 @@
\{
*/
-/// \brief Ros_Camera Plugin Controller
-/// This is a controller that simulates a generic camera
+/// \brief Ros_Camera Controller.
+/// \li Starts a ros node if none exists. \n
+/// \li Simulates a generic camera and broadcast std_msgs::Image topic over ROS. \n
class Ros_Camera : public Controller
{
/// \brief Constructor
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Laser.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Laser.hh 2008-09-29 07:39:29 UTC (rev 4761)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Laser.hh 2008-09-29 15:57:25 UTC (rev 4762)
@@ -45,7 +45,8 @@
\brief ROS Laser Scanner Controller Plugin
- This is a controller that gathers range data from a ray sensor, and returns results via publishing ROS topic and Iface.
+ This controller gathers range data from a simulated ray sensor, publishes range data through
+ std_msgs::LaserScan ROS topic and Gazebo Iface.
\verbatim
<model:physical name="ray_model">
@@ -77,8 +78,9 @@
\{
*/
-/// \brief ros laser controller.
-/// This is a controller that simulates a ros laser
+/// \brief ROS laser scan controller.
+/// \li Starts a ROS node if none exists.
+/// \li Simulates a laser range sensor.
class Ros_Laser : public Controller
{
/// \brief Constructor
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Time.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Time.hh 2008-09-29 07:39:29 UTC (rev 4761)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Time.hh 2008-09-29 15:57:25 UTC (rev 4762)
@@ -69,8 +69,8 @@
\{
*/
-/// \brief starts a ROS time node and broadcast simulator time
-/// This is a controller that starts a ros time
+/// \brief Starts a ROS node if none exists and broadcast simulator time
+/// over rostools::Time.
class Ros_Time : public Controller
{
/// \brief Constructor
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world 2008-09-29 07:39:29 UTC (rev 4761)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/testslide.world 2008-09-29 15:57:25 UTC (rev 4762)
@@ -54,7 +54,7 @@
<material>Gazebo/CloudySky</material>
</sky>
<gazeboPath>media</gazeboPath>
- <grid>off</grid>
+ <grid>false</grid>
<maxUpdateRate>100</maxUpdateRate>
</rendering:ogre>
@@ -145,10 +145,10 @@
<rpy> 0.0 0.0 0.00</rpy>
<body:box name="slide1_legs_body">
<geom:box name="slide_base_geom">
- <kp>1000000000000000</kp>
+ <kp>10000000000000000</kp>
<kd>1</kd>
- <mu1>0.0</mu1>
- <mu2>0.0</mu2>
+ <mu1>10000.0</mu1>
+ <mu2>10000.0</mu2>
<xyz> 0.0 5.0 13</xyz>
<rpy> 45.0 0.0 0.00</rpy>
@@ -156,7 +156,7 @@
<mass> 1000.0</mass>
<visual>
<size>2.0 14.14 1.0</size>
- <material>Gazebo/Rocky</material>
+ <material>Gazebo/Red</material>
<mesh>unit_box</mesh>
</visual>
</geom:box>
@@ -225,8 +225,8 @@
<geom:box name="support_1">
<kp>10000000.0</kp>
<kd>1</kd>
- <mu1>0.0</mu1>
- <mu2>0.0</mu2>
+ <mu1>1000.0</mu1>
+ <mu2>1000.0</mu2>
<xyz>1000.0 1000.0 1.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<mesh>default</mesh>
@@ -241,8 +241,8 @@
<geom:box name="support_2">
<kp>10000000.0</kp>
<kd>1</kd>
- <mu1>0.0</mu1>
- <mu2>0.0</mu2>
+ <mu1>1000.0</mu1>
+ <mu2>1000.0</mu2>
<xyz>1000.0 -1000.0 1.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<mesh>default</mesh>
@@ -257,8 +257,8 @@
<geom:box name="support_3">
<kp>10000000.0</kp>
<kd>1</kd>
- <mu1>0.0</mu1>
- <mu2>0.0</mu2>
+ <mu1>1000.0</mu1>
+ <mu2>1000.0</mu2>
<xyz>-1000.0 -1000.0 1.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<mesh>default</mesh>
@@ -273,8 +273,8 @@
<geom:box name="support_4">
<kp>10000000.0</kp>
<kd>1</kd>
- <mu1>0.0</mu1>
- <mu2>0.0</mu2>
+ <mu1>1000.0</mu1>
+ <mu2>1000.0</mu2>
<xyz>-1000.0 1000.0 1.00</xyz>
<rpy> 0.0 0.0 0.00</rpy>
<mesh>default</mesh>
@@ -334,7 +334,7 @@
<interface:audio name="dummy_ros_time_iface_should_not_be_here"/>
</controller:ros_time>
- <xyz>0.0 8.0 50.0 </xyz>
+ <xyz>0.0 8.0 110.0 </xyz>
<rpy>0.0 0.0 90.0 </rpy>
<!-- base, torso and arms -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-09-29 17:50:54
|
Revision: 4766
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=4766&view=rev
Author: hsujohnhsu
Date: 2008-09-29 17:50:28 +0000 (Mon, 29 Sep 2008)
Log Message:
-----------
* renamed 2dnav-gazebo demo to 2dnav-gazebo-simple.xml
* switched Willow office map to using Gazebo built-in extrusion.
Modified Paths:
--------------
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg_headless.world
Added Paths:
-----------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-headless.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless.xml
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/gazebo_battery.h
pkg/trunk/drivers/simulator/gazebo_plugin/src/gazebo_battery.cpp
Removed Paths:
-------------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
Deleted: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-29 17:48:22 UTC (rev 4765)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -1,12 +0,0 @@
-<launch>
- <master auto="start"/>
- <group name="wg">
- <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
- <node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
- <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
- <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
- <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
- </group>
-</launch>
-
Deleted: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-29 17:48:22 UTC (rev 4765)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -1,18 +0,0 @@
-<launch>
- <master auto="start"/>
- <group name="wg">
- <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
- <node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
- <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
- <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
-
- <!-- for visualization -->
- <node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
-
- <!-- for manual control -->
- <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
- <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
- </group>
-</launch>
-
Deleted: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-29 17:48:22 UTC (rev 4765)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -1,18 +0,0 @@
-<launch>
- <master auto="start"/>
- <group name="wg">
- <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
- <node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
- <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
- <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
-
- <!-- for visualization -->
- <node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
-
- <!-- for manual control -->
- <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
- <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
- </group>
-</launch>
-
Copied: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-fake_localization.xml (from rev 4763, pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-fake_localization.xml)
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-fake_localization.xml (rev 0)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-fake_localization.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -0,0 +1,12 @@
+<launch>
+ <master auto="start"/>
+ <group name="wg">
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
+ <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
+ <node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
+ <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
+ <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
+ <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
+ </group>
+</launch>
+
Copied: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-headless-fake_localization.xml (from rev 4763, pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless-fake_localization.xml)
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-headless-fake_localization.xml (rev 0)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-headless-fake_localization.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -0,0 +1,18 @@
+<launch>
+ <master auto="start"/>
+ <group name="wg">
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
+ <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
+ <node pkg="fake_localization" type="fake_localization" respawn="false" output="screen" />
+ <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
+ <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
+
+ <!-- for visualization -->
+ <node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
+
+ <!-- for manual control -->
+ <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
+ <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
+ </group>
+</launch>
+
Copied: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-headless.xml (from rev 4763, pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-headless.xml)
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-headless.xml (rev 0)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple-headless.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -0,0 +1,18 @@
+<launch>
+ <master auto="start"/>
+ <group name="wg">
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_headless.xml"/>
+ <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
+ <node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
+ <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
+ <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
+
+ <!-- for visualization -->
+ <node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
+
+ <!-- for manual control -->
+ <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
+ <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
+ </group>
+</launch>
+
Copied: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple.xml (from rev 4763, pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml)
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple.xml (rev 0)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-simple.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -0,0 +1,22 @@
+<launch>
+ <master auto="start"/>
+ <group name="wg">
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
+ <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
+ <node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
+ <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
+ <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
+ <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
+ </group>
+
+ <!-- Test for publication of 'tilt_scan' topic. -->
+ <test test-name="hztest_test_amcl1" pkg="rostest" type="hztest" name="amcl_test">
+ <param name="topic" value="localizedpose" />
+ <param name="hz" value="5.0" />
+ <param name="hzerror" value="3.0" />
+ <param name="test_duration" value="5.0" />
+ <param name="check_intervals" value="false" />
+ </test>
+
+</launch>
+
Added: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless.xml (rev 0)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg-headless.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -0,0 +1,18 @@
+<launch>
+ <master auto="start"/>
+ <group name="wg">
+ <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators_wg_headless.xml"/>
+ <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/willowMap.png 0.1" respawn="false" output="screen" />
+ <node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" />
+ <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
+ <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
+
+ <!-- for visualization -->
+ <node pkg="pr2_gui" type="pr2_gui" respawn="true" output="screen" />
+
+ <!-- for manual control -->
+ <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
+ <!--node pkg="teleop_arm_keyboard" type="teleop_arm_keyboard" respawn="false" output="screen" /-->
+ </group>
+</launch>
+
Deleted: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-09-29 17:48:22 UTC (rev 4765)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-09-29 17:50:28 UTC (rev 4766)
@@ -1,22 +0,0 @@
-<launch>
- <master auto="start"/>
- <group name="wg">
- <include file="$(find gazebo_robot_description)/pr2_gazebo_actuators.xml"/>
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
- <node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" output="screen" />
- <node pkg="wavefront_player" type="wavefront_player" args="scan:=base_scan" respawn="false" output="screen" />
- <node pkg="nav_view" type="nav_view" respawn="false" output="screen" />
- <!--node pkg="teleop_base_keyboard" type="teleop_base_keyboard" respawn="false" output="screen" /-->
- </group>
-
- <!-- Test for publication of 'tilt_scan' topic. -->
- <test test-name="hztest_test_amcl1" pkg="rostest" type="hztest" name="amcl_test">
- <param name="topic" value="localizedpose" />
- <param name="hz" value="5.0" />
- <param name="hzerror" value="3.0" />
- <param name="test_duration" value="5.0" />
- <param name="check_intervals" value="false" />
- </test>
-
-</launch>
-
Added: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/gazebo_battery.h
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/gazebo_battery.h (rev 0)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/gazebo_battery.h 2008-09-29 17:50:28 UTC (rev 4766)
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Willow Garage, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GAZEBO_BATTERY_H
+#define GAZEBO_BATTERY_H
+
+#include <vector>
+#include <map>
+#include <gazebo/Controller.hh>
+#include <gazebo/Entity.hh>
+#include <gazebo/Model.hh>
+#include "tinyxml/tinyxml.h"
+
+
+namespace gazebo
+{
+class XMLConfigNode;
+
+/// @addtogroup gazebo_dynamic_plugins Gazebo ROS Dynamic Plugins
+/// @{
+/** \defgroup gazebo_battery GazeboBattery class
+
+ \brief GazeboBattery Plugin
+
+ This plugin simulates battery usage.
+ GazeboBattery requires model as its parent.
+
+ \verbatim
+ <model:physical name="ray_model">
+ <!-- GazeboBattery -->
+ <controller:gazebo_battery name="gazebo_battery" plugin="libgazebo_battery.so">
+ <alwaysOn>true</alwaysOn>
+ <updateRate>1000.0</updateRate>
+ <interface:audio name="gazebo_battery_dummy_iface" />
+ </controller:gazebo_battery>
+ </model:phyiscal>
+ \endverbatim
+
+\{
+
+
+*/
+
+/**
+ * \brief Battery simulation
+ * \li starts a ROS node if none exists
+ * .
+ *
+**/
+
+
+class GazeboBattery : public gazebo::Controller
+{
+public:
+ GazeboBattery(Entity *parent);
+ virtual ~GazeboBattery();
+
+protected:
+ // Inherited from gazebo::Controller
+ virtual void LoadChild(XMLConfigNode *node);
+ virtual void InitChild();
+ virtual void UpdateChild();
+ virtual void FiniChild();
+
+private:
+
+ Model *parent_model_;
+
+ TiXmlDocument config_;
+
+};
+
+/** \} */
+/// @}
+
+}
+
+#endif
+
Added: pkg/trunk/drivers/simulator/gazebo_plugin/src/gazebo_battery.cpp
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/gazebo_battery.cpp (rev 0)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/gazebo_battery.cpp 2008-09-29 17:50:28 UTC (rev 4766)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Willow Garage, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gazebo_plugin/gazebo_battery.h>
+#include <fstream>
+#include <iostream>
+#include <math.h>
+#include <unistd.h>
+#include <set>
+#include <stl_utils/stl_utils.h>
+#include <gazebo/Global.hh>
+#include <gazebo/XMLConfig.hh>
+#include <gazebo/Model.hh>
+#include <gazebo/HingeJoint.hh>
+#include <gazebo/SliderJoint.hh>
+#include <gazebo/Simulator.hh>
+#include <gazebo/gazebo.h>
+#include <gazebo/GazeboError.hh>
+#include <gazebo/ControllerFactory.hh>
+#include <urdf/parser.h>
+#include <map>
+
+namespace gazebo {
+
+GZ_REGISTER_DYNAMIC_CONTROLLER("gazebo_battery", GazeboBattery);
+
+
+} // namespace gazebo
+
+
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg.world 2008-09-29 17:48:22 UTC (rev 4765)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg.world 2008-09-29 17:50:28 UTC (rev 4766)
@@ -68,15 +68,17 @@
</body:plane>
</model:physical>
+<!--
<model:physical name="walls">
- <include embedded="false">
- <xi:include href="tests/willow-walls.model" />
- </include>
+ <include embedded="false">
+ <xi:include href="tests/willow-walls.model" />
+ </include>
</model:physical>
-<!--
+-->
<model:physical name="willow_map">
<xyz>-25.65 25.65 1.0</xyz>
<rpy>180 0 0</rpy>
+ <static>true</static>
<body:map name="willow_map_body">
<geom:map name="willow_map_geom">
<image>willowMap.png</image>
@@ -89,7 +91,6 @@
</geom:map>
</body:map>
</model:physical>
--->
<model:physical name="robot_model1">
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg_headless.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg_headless.world 2008-09-29 17:48:22 UTC (rev 4765)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg_headless.world 2008-09-29 17:50:28 UTC (rev 4766)
@@ -68,28 +68,29 @@
</body:plane>
</model:physical>
+<!--
<model:physical name="walls">
- <include embedded="false">
- <xi:include href="tests/willow-walls.model" />
- </include>
+ <include embedded="false">
+ <xi:include href="tests/willow-walls.model" />
+ </include>
</model:physical>
-<!--
- <model:physical name="map">
- <xyz>-25.65 25.65 1.0</xyz>
- <rpy>180 0 0</rpy>
- <body:map name="map_body">
- <geom:map name="map_geom">
- <image>willowMap.png</image>
- <threshold>200</threshold>
- <granularity>2</granularity>
- <negative>false</negative>
- <scale>0.1</scale>
- <offset>0 0 0</offset>
- <material>Gazebo/Rocky</material>
- </geom:map>
- </body:map>
- </model:physical>
-->
+ <model:physical name="willow_map">
+ <xyz>-25.65 25.65 1.0</xyz>
+ <rpy>180 0 0</rpy>
+ <static>true</static>
+ <body:map name="willow_map_body">
+ <geom:map name="willow_map_geom">
+ <image>willowMap.png</image>
+ <threshold>200</threshold>
+ <granularity>2</granularity>
+ <negative>false</negative>
+ <scale>0.1</scale>
+ <offset>0 0 0</offset>
+ <material>Gazebo/Rocky</material>
+ </geom:map>
+ </body:map>
+ </model:physical>
<model:physical name="robot_model1">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|