Revision: 8752
http://playerstage.svn.sourceforge.net/playerstage/?rev=8752&view=rev
Author: natepak
Date: 2010-06-07 18:08:53 +0000 (Mon, 07 Jun 2010)
Log Message:
-----------
Fixed a problem with the bullet compilation
Modified Paths:
--------------
code/gazebo/branches/simpar/plugins/pioneer_circle.cc
code/gazebo/branches/simpar/plugins/pioneer_line.cc
code/gazebo/branches/simpar/server/physics/bullet/BulletMotionState.cc
code/gazebo/branches/simpar/server/physics/bullet/BulletMotionState.hh
code/gazebo/branches/simpar/worlds/pioneer2dx.world
Modified: code/gazebo/branches/simpar/plugins/pioneer_circle.cc
===================================================================
--- code/gazebo/branches/simpar/plugins/pioneer_circle.cc 2010-06-06
12:49:34 UTC (rev 8751)
+++ code/gazebo/branches/simpar/plugins/pioneer_circle.cc 2010-06-07
18:08:53 UTC (rev 8752)
@@ -2,6 +2,8 @@
#include <gazebo/gazeboserver.hh>
+#define LOG false
+
namespace gazebo
{
@@ -15,9 +17,9 @@
for (unsigned int i=10; i<=100; i+=10)
this->stepIters.push_back(i);
+ this->stepTypes.push_back("robust");
this->stepTypes.push_back("world");
this->stepTypes.push_back("quick");
- //this->stepTypes.push_back("robust");
this->stepTypesIter = this->stepTypes.begin();
this->stepTimesIter = this->stepTimes.begin();
@@ -28,13 +30,17 @@
this->circleCount = 4;
- this->indexFile = fopen(std::string(this->path + "index.txt").c_str(),
"w");
- fprintf(this->indexFile, "# index step_type step_time
step_iterations\n");
+ if (LOG)
+ {
+ this->indexFile = fopen(std::string(this->path + "index.txt").c_str(),
"w");
+ fprintf(this->indexFile, "# index step_type step_time
step_iterations\n");
+ }
}
public: ~PioneerCircle()
{
- fclose(this->indexFile);
+ if (LOG)
+ fclose(this->indexFile);
World::Instance()->DisconnectWorldUpdateStartSignal(
boost::bind(&PioneerCircle::UpdateCB, this));
@@ -70,7 +76,8 @@
this->count = 0;
this->circleCount = 0;
- Logger::Instance()->AddLog("pioneer","/tmp/pioneer.log");
+ if (LOG)
+ Logger::Instance()->AddLog("pioneer","/tmp/pioneer.log");
World::Instance()->ConnectWorldUpdateStartSignal(
boost::bind(&PioneerCircle::UpdateCB, this));
@@ -108,17 +115,20 @@
public: void UpdateJob()
{
- Logger::Instance()->RemoveLog("pioneer");
+ if (LOG)
+ {
+ Logger::Instance()->RemoveLog("pioneer");
- std::string mv_cmd = std::string("mv /tmp/pioneer.log ") + this->path +
- "pioneer_circle_" + boost::lexical_cast<std::string>(this->count) +
- ".data";
+ std::string mv_cmd = std::string("mv /tmp/pioneer.log ") + this->path
+
+ "pioneer_circle_" + boost::lexical_cast<std::string>(this->count) +
+ ".data";
- fprintf(this->indexFile,"%d %s %f %d\n",this->count,
- (*this->stepTypesIter).c_str(), *this->stepTimesIter,
- *this->stepItersIter);
+ fprintf(this->indexFile,"%d %s %f %d\n",this->count,
+ (*this->stepTypesIter).c_str(), *this->stepTimesIter,
+ *this->stepItersIter);
- system(mv_cmd.c_str());
+ system(mv_cmd.c_str());
+ }
this->stepItersIter++;
if (this->stepItersIter == this->stepIters.end())
@@ -150,7 +160,9 @@
this->robot->Reset();
this->prevTime = Simulator::Instance()->GetRealTime();
- Logger::Instance()->AddLog("pioneer","/tmp/pioneer.log");
+
+ if (LOG)
+ Logger::Instance()->AddLog("pioneer","/tmp/pioneer.log");
}
private: std::vector<unsigned int> stepIters;
private: std::vector<unsigned int>::iterator stepItersIter;
Modified: code/gazebo/branches/simpar/plugins/pioneer_line.cc
===================================================================
--- code/gazebo/branches/simpar/plugins/pioneer_line.cc 2010-06-06 12:49:34 UTC
(rev 8751)
+++ code/gazebo/branches/simpar/plugins/pioneer_line.cc 2010-06-07 18:08:53 UTC
(rev 8752)
@@ -2,6 +2,8 @@
#include <boost/bind.hpp>
#include <gazebo/gazeboserver.hh>
+#define LOG false
+
namespace gazebo
{
@@ -15,9 +17,9 @@
for (unsigned int i=10; i<=100; i+=10)
this->stepIters.push_back(i);
+ this->stepTypes.push_back("robust");
this->stepTypes.push_back("world");
this->stepTypes.push_back("quick");
- //this->stepTypes.push_back("robust");
this->stepTypesIter = this->stepTypes.begin();
this->stepTimesIter = this->stepTimes.begin();
@@ -28,13 +30,17 @@
this->count = 0;
- this->indexFile = fopen(std::string(this->path + "index.txt").c_str(),
"w");
- fprintf(this->indexFile, "# index step_type step_time
step_iterations\n");
+ if (LOG)
+ {
+ this->indexFile = fopen(std::string(this->path + "index.txt").c_str(),
"w");
+ fprintf(this->indexFile, "# index step_type step_time
step_iterations\n");
+ }
}
public: ~PioneerLine()
{
- fclose(this->indexFile);
+ if (LOG)
+ fclose(this->indexFile);
World::Instance()->DisconnectWorldUpdateStartSignal(
boost::bind(&PioneerLine::UpdateCB, this));
@@ -73,7 +79,8 @@
this->physics = World::Instance()->GetPhysicsEngine();
- Logger::Instance()->AddLog("pioneer","/tmp/pioneer.log");
+ if (LOG)
+ Logger::Instance()->AddLog("pioneer","/tmp/pioneer.log");
this->physics->SetStepTime( *this->stepTimesIter );
this->physics->SetStepType( *this->stepTypesIter );
@@ -102,17 +109,20 @@
public: void UpdateJob()
{
- Logger::Instance()->RemoveLog("pioneer");
+ if (LOG)
+ {
+ Logger::Instance()->RemoveLog("pioneer");
- std::string mv_cmd = std::string("mv /tmp/pioneer.log ") + this->path +
- "pioneer_line_" + boost::lexical_cast<std::string>(this->count) +
- ".data";
+ std::string mv_cmd = std::string("mv /tmp/pioneer.log ") + this->path
+
+ "pioneer_line_" + boost::lexical_cast<std::string>(this->count) +
+ ".data";
- fprintf(this->indexFile,"%d %s %f %d\n",this->count,
- (*this->stepTypesIter).c_str(), *this->stepTimesIter,
- *this->stepItersIter);
+ fprintf(this->indexFile,"%d %s %f %d\n",this->count,
+ (*this->stepTypesIter).c_str(), *this->stepTimesIter,
+ *this->stepItersIter);
- system(mv_cmd.c_str());
+ system(mv_cmd.c_str());
+ }
this->stepItersIter++;
if (this->stepItersIter == this->stepIters.end())
@@ -143,7 +153,9 @@
this->robot->Reset();
this->prevTime = Simulator::Instance()->GetRealTime();
- Logger::Instance()->AddLog("pioneer","/tmp/pioneer.log");
+
+ if (LOG)
+ Logger::Instance()->AddLog("pioneer","/tmp/pioneer.log");
}
private: std::vector<unsigned int> stepIters;
Modified: code/gazebo/branches/simpar/server/physics/bullet/BulletMotionState.cc
===================================================================
--- code/gazebo/branches/simpar/server/physics/bullet/BulletMotionState.cc
2010-06-06 12:49:34 UTC (rev 8751)
+++ code/gazebo/branches/simpar/server/physics/bullet/BulletMotionState.cc
2010-06-07 18:08:53 UTC (rev 8752)
@@ -57,29 +57,28 @@
/// Get the pose
Pose3d BulletMotionState::GetWorldPose() const
{
- std::cout << "MotionState: Get Abs Pose[" << this->absPose << "]\n";
- return this->absPose;
+ return this->worldPose;
}
////////////////////////////////////////////////////////////////////////////////
/// Set the position of the body
-void BulletMotionState::SetAbsPosition(const Vector3 &pos)
+void BulletMotionState::SetWorldPosition(const Vector3 &pos)
{
- this->absPose.pos = pos;
+ this->worldPose.pos = pos;
}
////////////////////////////////////////////////////////////////////////////////
/// Set the rotation of the body
-void BulletMotionState::SetAbsRotation(const Quatern &rot)
+void BulletMotionState::SetWorldRotation(const Quatern &rot)
{
- this->absPose.rot = rot;
+ this->worldPose.rot = rot;
}
////////////////////////////////////////////////////////////////////////////////
/// Set the pose
void BulletMotionState::SetWorldPose(const Pose3d &pose)
{
- this->absPose = pose;
+ this->worldPose = pose;
}
////////////////////////////////////////////////////////////////////////////////
@@ -93,7 +92,7 @@
// Get the world transform
void BulletMotionState::getWorldTransform(btTransform &worldTrans) const
{
- Pose3d result = this->absPose;
+ Pose3d result = this->worldPose;
result.pos += this->comOffset.pos;
worldTrans = BulletPhysics::ConvertPose(result);
@@ -106,10 +105,10 @@
if (this->visual == NULL)
return;
- this->absPose = BulletPhysics::ConvertPose( worldTrans );
+ this->worldPose = BulletPhysics::ConvertPose( worldTrans );
//std::cout << "New Pose[" << this->pose << "]\n";
- this->body->SetWorldPose(this->absPose, false);
- //this->visual->SetDirty(true, this->absPose - this->body->GetWorldPose());
+ this->body->SetWorldPose(this->worldPose, false);
+ //this->visual->SetDirty(true, this->worldPose - this->body->GetWorldPose());
}
Modified: code/gazebo/branches/simpar/server/physics/bullet/BulletMotionState.hh
===================================================================
--- code/gazebo/branches/simpar/server/physics/bullet/BulletMotionState.hh
2010-06-06 12:49:34 UTC (rev 8751)
+++ code/gazebo/branches/simpar/server/physics/bullet/BulletMotionState.hh
2010-06-07 18:08:53 UTC (rev 8752)
@@ -50,18 +50,18 @@
public: void SetVisual(OgreVisual *vis);
/// \brief Get the pose
- public: Pose3d GetAbsPose() const;
+ public: Pose3d GetWorldPose() const;
/// \brief Set the position of the body
/// \param pos Vector position
- public: virtual void SetAbsPosition(const Vector3 &pos);
+ public: virtual void SetWorldPosition(const Vector3 &pos);
/// \brief Set the rotation of the body
/// \param rot Quaternion rotation
- public: virtual void SetAbsRotation(const Quatern &rot);
+ public: virtual void SetWorldRotation(const Quatern &rot);
/// \brief Set the pose
- public: void SetAbsPose(const Pose3d &pose);
+ public: void SetWorldPose(const Pose3d &pose);
/// \brief Set the center of mass offset
public: void SetCoMOffset( const Pose3d &com );
@@ -73,7 +73,7 @@
public: virtual void setWorldTransform(const btTransform &worldTrans);
private: OgreVisual *visual;
- private: Pose3d absPose;
+ private: Pose3d worldPose;
private: Pose3d comOffset;
private: Body *body;
};
Modified: code/gazebo/branches/simpar/worlds/pioneer2dx.world
===================================================================
--- code/gazebo/branches/simpar/worlds/pioneer2dx.world 2010-06-06 12:49:34 UTC
(rev 8751)
+++ code/gazebo/branches/simpar/worlds/pioneer2dx.world 2010-06-07 18:08:53 UTC
(rev 8752)
@@ -24,7 +24,7 @@
<cfm>0.0000000001</cfm>
<erp>0.2</erp>
- <stepType>world</stepType>
+ <stepType>robust</stepType>
<stepIters>100</stepIters>
<stepW>1.3</stepW>
<contactMaxCorrectingVel>100.0</contactMaxCorrectingVel>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit