Revision: 6970
http://playerstage.svn.sourceforge.net/playerstage/?rev=6970&view=rev
Author: natepak
Date: 2008-08-20 23:19:02 +0000 (Wed, 20 Aug 2008)
Log Message:
-----------
Added Angle, Param, Vector4 classes
Modified Paths:
--------------
code/gazebo/trunk/worlds/bandit.world
code/gazebo/trunk/worlds/models/bandit.model
Added Paths:
-----------
code/gazebo/trunk/server/Angle.cc
code/gazebo/trunk/server/Angle.hh
code/gazebo/trunk/server/Param.hh
code/gazebo/trunk/server/Vector4.cc
code/gazebo/trunk/server/Vector4.hh
Added: code/gazebo/trunk/server/Angle.cc
===================================================================
--- code/gazebo/trunk/server/Angle.cc (rev 0)
+++ code/gazebo/trunk/server/Angle.cc 2008-08-20 23:19:02 UTC (rev 6970)
@@ -0,0 +1,194 @@
+/*
+ * 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: Angle class
+ * Author: Nate Koenig
+ * Date: 18 Aug 2008
+ * SVN: $Id:$
+ */
+
+#include <math.h>
+#include "Angle.hh"
+
+using namespace gazebo;
+
+////////////////////////////////////////////////////////////////////////////////
+/// Constructor
+Angle::Angle()
+{
+ this->value = 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Constructor
+Angle::Angle(double radian)
+{
+ this->value = radian;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Copy constructor
+Angle::Angle(const Angle &angle)
+{
+ this->value = angle.value;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Destructor
+Angle::~Angle()
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Set the value from an angle in radians
+void Angle::SetFromRadian( double radian )
+{
+ this->value = radian;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Set the value from an angle in degrees
+void Angle::SetFromDegree( double degree )
+{
+ this->value = degree * M_PI / 180.0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Get the angle in radians
+double Angle::GetAsRadian() const
+{
+ return this->value;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Get the angle in degrees
+double Angle::GetAsDegree() const
+{
+ return this->value * 180.0 / M_PI;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Normalize the angle
+void Angle::Normalize()
+{
+ this->value = atan2(sin(this->value), cos(this->value));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Substraction
+Angle Angle::operator-(const Angle &angle) const
+{
+ return Angle(this->value - angle.value);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Addition
+Angle Angle::operator+(const Angle &angle) const
+{
+ return Angle(this->value + angle.value);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Multiplication
+Angle Angle::operator*(const Angle &angle) const
+{
+ return Angle(this->value * angle.value);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Division
+Angle Angle::operator/(const Angle &angle) const
+{
+ return Angle(this->value / angle.value);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Add set
+Angle Angle::operator-=(const Angle &angle)
+{
+ this->value -= angle.value;
+ return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Sub set
+Angle Angle::operator+=(const Angle &angle)
+{
+ this->value += angle.value;
+ return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Mul set
+Angle Angle::operator*=(const Angle &angle)
+{
+ this->value *= angle.value;
+ return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Div set
+Angle Angle::operator/=(const Angle &angle)
+{
+ this->value /= angle.value;
+ return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Equality
+bool Angle::operator==(const Angle &angle) const
+{
+ return this->value == angle.value;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Inequality
+bool Angle::operator!=(const Angle &angle) const
+{
+ return !(*this == angle);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Less
+bool Angle::operator<(const Angle &angle) const
+{
+ return this->value < angle.value;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Less equal
+bool Angle::operator<=(const Angle &angle) const
+{
+ return this->value <= angle.value;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Greater
+bool Angle::operator>(const Angle &angle) const
+{
+ return this->value > angle.value;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Greater equal
+bool Angle::operator>=(const Angle &angle) const
+{
+ return this->value >= angle.value;
+}
Added: code/gazebo/trunk/server/Angle.hh
===================================================================
--- code/gazebo/trunk/server/Angle.hh (rev 0)
+++ code/gazebo/trunk/server/Angle.hh 2008-08-20 23:19:02 UTC (rev 6970)
@@ -0,0 +1,136 @@
+/*
+ * 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: Angle class
+ * Author: Nate Koenig
+ * Date: 18 Aug 2008
+ * SVN: $Id:$
+ */
+
+#ifndef ANGLE_HH
+#define ANGLE_HH
+
+#include <iostream>
+
+namespace gazebo
+{
+
+/// \addtogroup gazebo_server
+/// \brief Angle class
+/// \{
+
+/// \brief Angle class
+ class Angle
+ {
+ /// \brief Constructor
+ public: Angle();
+
+ /// \brief Constructor
+ public: Angle(double radian);
+
+ /// \brief Copy constructor
+ public: Angle(const Angle &angle);
+
+ /// \brief Destructor
+ public: virtual ~Angle();
+
+ /// \brief Set the value from an angle in radians
+ public: void SetFromRadian( double radian );
+
+ /// \brief Set the value from an angle in degrees
+ public: void SetFromDegree( double degree );
+
+ /// \brief Get the angle in radians
+ public: double GetAsRadian() const;
+
+ /// \brief Get the angle in degrees
+ public: double GetAsDegree() const;
+
+ /// \brief Normalize the angle
+ public: void Normalize();
+
+ /// \brief Dereference operator
+ public: inline double operator*() { return value; }
+
+ /// \brief Substraction
+ public: Angle operator-(const Angle &angle) const;
+ /// \brief Addition
+ public: Angle operator+(const Angle &angle) const;
+ /// \brief Multiplication
+ public: Angle operator*(const Angle &angle) const;
+ /// \brief Division
+ public: Angle operator/(const Angle &angle) const;
+
+ /// \brief Add set
+ public: Angle operator-=(const Angle &angle);
+ /// \brief Sub set
+ public: Angle operator+=(const Angle &angle);
+ /// \brief Mul set
+ public: Angle operator*=(const Angle &angle);
+ /// \brief Div set
+ public: Angle operator/=(const Angle &angle);
+
+ /// \brief Equality
+ public: bool operator==(const Angle &angle) const;
+
+ /// \brief Inequality
+ public: bool operator!=(const Angle &angle) const;
+
+ /// \brief Less
+ public: bool operator<(const Angle &angle) const;
+ /// \brief Less equal
+ public: bool operator<=(const Angle &angle) const;
+
+ /// \brief Greater
+ public: bool operator>(const Angle &angle) const;
+ /// \brief Greater equal
+ public: bool operator>=(const Angle &angle) const;
+
+ /// \brief Ostream operator. Outputs in degrees
+ /// \param out Ostream
+ /// \param pt Angle to output
+ /// \return The Ostream
+ public: friend std::ostream &operator<<( std::ostream &out, const
gazebo::Angle &a )
+ {
+ out << a.GetAsDegree();
+ return out;
+ }
+
+ /// \brief Istream operator. Assumes input is in degrees
+ /// \param in Ostream
+ /// \param pt Angle to read value into
+ /// \return The istream
+ public: friend std::istream &operator>>( std::istream &in, gazebo::Angle
&a )
+ {
+ // Skip white spaces
+ in.setf( std::ios_base::skipws );
+ in >> a.value;
+ a.value = a.value * M_PI / 180.0;
+ return in;
+ }
+
+ /// The angle in radians
+ private: double value;
+ };
+
+/// \}
+}
+
+#endif
Added: code/gazebo/trunk/server/Param.hh
===================================================================
--- code/gazebo/trunk/server/Param.hh (rev 0)
+++ code/gazebo/trunk/server/Param.hh 2008-08-20 23:19:02 UTC (rev 6970)
@@ -0,0 +1,136 @@
+/*
+ * 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: A parameter
+ * Author: Nate Koenig
+ * Date: 14 Aug 2008
+ * SVN: $Id:$
+ */
+
+#ifndef PARAM_HH
+#define PARAM_HH
+
+#include <iostream>
+#include <boost/lexical_cast.hpp>
+#include <string>
+
+#include "XMLConfig.hh"
+
+namespace gazebo
+{
+ template< typename T >
+ class Param
+ {
+ /// \brief Constructor
+ public: Param(std::string key, T defValue, int required);
+
+ /// \brief Destructor
+ public: virtual ~Param();
+
+ /// \brief Load the param from an XML config file
+ public: void Load(XMLConfigNode *node);
+
+ /// \brief Get the value
+ public: T GetValue() const;
+
+ /// \brief Set the value of the parameter
+ public: void SetValue(const T &value);
+
+ public: inline T operator*() const {return value;}
+
+ public: friend std::ostream &operator<<( std::ostream &out, const Param<T>
&p)
+ {
+ out << "<" << p.key << ">" << p.value << "</" << p.key << ">";
+
+ return out;
+ }
+
+ private: T value;
+
+ private: std::string key;
+ private: T defaultValue;
+ private: int required;
+
+ };
+
+
+
//////////////////////////////////////////////////////////////////////////////
+ // Constructor
+ template< typename T>
+ Param<T>::Param(std::string key, T defValue, int required)
+ {
+ this->key = key;
+ this->defaultValue = defValue;
+ this->required = required;
+ this->value = this->defaultValue;
+ }
+
+
//////////////////////////////////////////////////////////////////////////////
+ // Destructor
+ template<typename T>
+ Param<T>::~Param()
+ {
+ }
+
+
//////////////////////////////////////////////////////////////////////////////
+ /// Load the param from an XML config file
+ template<typename T>
+ void Param<T>::Load(XMLConfigNode *node)
+ {
+ std::ostringstream stream;
+ stream << this->defaultValue;
+
+ std::string input = node->GetString(this->key, stream.str(),
+ this->required);
+
+ // "true" and "false" doesn't work properly
+ if (input == "true")
+ input = "1";
+ else if (input == "false")
+ input = "0";
+
+ try
+ {
+ this->value = boost::lexical_cast<T>(input);
+ }
+ catch (boost::bad_lexical_cast &e)
+ {
+ std::cerr << "Unable to read value with key[" << this->key << "]\n";
+ }
+ }
+
+
//////////////////////////////////////////////////////////////////////////////
+ ///Get the value
+ template<typename T>
+ T Param<T>::GetValue() const
+ {
+ return this->value;
+ }
+
+
//////////////////////////////////////////////////////////////////////////////
+ /// Set the value of the parameter
+ template<typename T>
+ void Param<T>::SetValue(const T &v)
+ {
+ this->value = v;
+ }
+
+}
+#endif
Added: code/gazebo/trunk/server/Vector4.cc
===================================================================
--- code/gazebo/trunk/server/Vector4.cc (rev 0)
+++ code/gazebo/trunk/server/Vector4.cc 2008-08-20 23:19:02 UTC (rev 6970)
@@ -0,0 +1,273 @@
+/*
+ * 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: Vector 4
+ * Author: Andrew Howard and Nate Koenig
+ * Date: 4 Apr 2007
+ * SVN: $Id:$
+ */
+
+#include <math.h>
+
+#include "Vector4.hh"
+
+using namespace gazebo;
+
+////////////////////////////////////////////////////////////////////////////////
+// Constructor
+Vector4::Vector4()
+ : x(0), y(0), z(0), w(0)
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Constructor
+Vector4::Vector4( const double &x, const double &y, const double &z,const
double &w )
+ : x(x), y(y), z(z), w(w)
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Copy Constructor
+Vector4::Vector4( const Vector4 &pt )
+ : x(pt.x), y(pt.y), z(pt.z), w(pt.w)
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Destructor
+Vector4::~Vector4()
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Calc distance to the given point
+double Vector4::Distance(const Vector4 &pt ) const
+{
+ return sqrt((this->x-pt.x)*(this->x-pt.x) +
+ (this->y-pt.y)*(this->y-pt.y) +
+ (this->z-pt.z)*(this->z-pt.z) +
+ (this->w-pt.w)*(this->w-pt.w));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Returns the length (magnitude) of the vector
+double Vector4::GetLength() const
+{
+ return sqrt(this->x * this->x + this->y * this->y + this->z * this->z +
this->w * this->w);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Return the square of the length (magnitude) of the vector
+double Vector4::GetSquaredLength() const
+{
+ return this->x * this->x + this->y * this->y + this->z * this->z + this->w *
this->w;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Normalize the vector length
+void Vector4::Normalize()
+{
+ double d = this->GetLength();
+
+ this->x /= d;
+ this->y /= d;
+ this->z /= d;
+ this->w /= d;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Set the contents of the vector
+void Vector4::Set(double x, double y, double z, double w)
+{
+ this->x = x;
+ this->y = y;
+ this->z = z;
+ this->w = w;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Equals operator
+const Vector4 &Vector4::operator=( const Vector4 &pt )
+{
+ this->x = pt.x;
+ this->y = pt.y;
+ this->z = pt.z;
+ this->w = pt.w;
+
+ return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Equal operator
+const Vector4 &Vector4::operator=( double value )
+{
+ this->x = value;
+ this->y = value;
+ this->z = value;
+ this->w = value;
+
+ return *this;
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Addition operator
+Vector4 Vector4::operator+( const Vector4 &pt ) const
+{
+ return Vector4(this->x + pt.x, this->y + pt.y, this->z + pt.z, this->w+pt.w);
+}
+
+const Vector4 &Vector4::operator+=( const Vector4 &pt )
+{
+ this->x += pt.x;
+ this->y += pt.y;
+ this->z += pt.z;
+ this->w += pt.w;
+
+ return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Subtraction operators
+Vector4 Vector4::operator-( const Vector4 &pt ) const
+{
+ return Vector4(this->x - pt.x, this->y - pt.y, this->z - pt.z, this->w-pt.w);
+}
+
+const Vector4 &Vector4::operator-=( const Vector4 &pt )
+{
+ this->x -= pt.x;
+ this->y -= pt.y;
+ this->z -= pt.z;
+ this->w -= pt.w;
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Division operators
+
+const Vector4 Vector4::operator/( const Vector4 &pt ) const
+{
+ return Vector4(this->x / pt.x, this->y / pt.y, this->z / pt.z, this->w/pt.w);
+}
+
+const Vector4 &Vector4::operator/=( const Vector4 &pt )
+{
+ this->x /= pt.x;
+ this->y /= pt.y;
+ this->z /= pt.z;
+ this->w /= pt.w;
+
+ return *this;
+}
+
+const Vector4 Vector4::operator/( double v ) const
+{
+ return Vector4(this->x / v, this->y / v, this->z / v, this->w / v);
+}
+
+const Vector4 &Vector4::operator/=( double v )
+{
+ this->x /= v;
+ this->y /= v;
+ this->z /= v;
+ this->w /= v;
+
+ return *this;
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Mulitplication operators
+const Vector4 Vector4::operator*( const Vector4 &pt ) const
+{
+ return Vector4(this->x * pt.x, this->y * pt.y, this->z * pt.z, this->w*pt.w);
+}
+
+const Vector4 &Vector4::operator*=( const Vector4 &pt )
+{
+ this->x *= pt.x;
+ this->y *= pt.y;
+ this->z *= pt.z;
+ this->w *= pt.w;
+
+ return *this;
+}
+
+const Vector4 Vector4::operator*( double v ) const
+{
+ return Vector4(this->x * v, this->y * v, this->z * v, this->w*v);
+}
+
+const Vector4 &Vector4::operator*=( double v)
+{
+ this->x *= v;
+ this->y *= v;
+ this->z *= v;
+ this->w *= v;
+
+ return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Equality operator
+bool Vector4::operator==( const Vector4 &pt ) const
+{
+ return this->x == pt.x && this->y == pt.y && this->z == pt.z &&
this->w==pt.w;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Inequality operator
+bool Vector4::operator!=( const Vector4 &pt ) const
+{
+ return !(*this == pt);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// See if a point is finite (e.g., not nan)
+bool Vector4::IsFinite() const
+{
+ return finite(this->x) && finite(this->y) && finite(this->z) &&
finite(this->w);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// [] operator
+double Vector4::operator[](unsigned int index) const
+{
+ switch (index)
+ {
+ case 0:
+ return this->x;
+ case 1:
+ return this->y;
+ case 2:
+ return this->z;
+ case 3:
+ return this->w;
+ default:
+ return 0;
+ }
+}
Added: code/gazebo/trunk/server/Vector4.hh
===================================================================
--- code/gazebo/trunk/server/Vector4.hh (rev 0)
+++ code/gazebo/trunk/server/Vector4.hh 2008-08-20 23:19:02 UTC (rev 6970)
@@ -0,0 +1,163 @@
+/*
+ * 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: 4 tuple
+ * Author: Nate Koenig
+ * Date: 19 Aug 2008
+ * SVN: $Id:$
+ */
+
+#ifndef VECTOR4_HH
+#define VECTOR4_HH
+
+#include <iostream>
+#include <fstream>
+
+namespace gazebo
+{
+/// \addtogroup gazebo_server
+/// \brief Generic x,y,z,w vector
+/// \{
+
+/// \brief Generic x,y,z,w vector
+class Vector4
+{
+ /// \brief Constructor
+ public: Vector4();
+
+ /// \brief Constructor
+ public: Vector4( const double &x, const double &y, const double &z, const
double &w );
+
+ /// \brief Constructor
+ public: Vector4( const Vector4 &pt );
+
+ /// \brief Destructor
+ public: virtual ~Vector4();
+
+ /// \brief Calc distance to the given point
+ public: double Distance( const Vector4 &pt ) const;
+
+ /// \brief Returns the length (magnitude) of the vector
+ public: double GetLength() const;
+
+ /// \brief Return the square of the length (magnitude) of the vector
+ public: double GetSquaredLength() const;
+
+ /// \brief Normalize the vector length
+ public: void Normalize();
+
+ /// \brief Set the contents of the vector
+ public: void Set(double x = 0, double y =0 , double z = 0, double w=0);
+
+ /// \brief Equal operator
+ public: const Vector4 &operator=( const Vector4 &pt );
+
+ /// \brief Equal operator
+ public: const Vector4 &operator=( double value );
+
+ /// \brief Addition operator
+ public: Vector4 operator+( const Vector4 &pt ) const;
+
+ /// \brief Addition operator
+ public: const Vector4 &operator+=( const Vector4 &pt );
+
+ /// \brief Subtraction operators
+ public: Vector4 operator-( const Vector4 &pt ) const;
+
+ /// \brief Subtraction operators
+ public: const Vector4 &operator-=( const Vector4 &pt );
+
+ /// \brief Division operators
+ public: const Vector4 operator/( const Vector4 &pt ) const;
+
+ /// \brief Division operators
+ public: const Vector4 &operator/=( const Vector4 &pt );
+
+ /// \brief Division operators
+ public: const Vector4 operator/( double v ) const;
+
+ /// \brief Division operators
+ public: const Vector4 &operator/=( double v );
+
+ /// \brief Multiplication operators
+ public: const Vector4 operator*( const Vector4 &pt ) const;
+
+ /// \brief Multiplication operators
+ public: const Vector4 &operator*=( const Vector4 &pt );
+
+ /// \brief Multiplication operators
+ public: const Vector4 operator*( double v ) const;
+
+ /// \brief Multiplication operators
+ public: const Vector4 &operator*=( double v );
+
+ /// \brief Equality operators
+ public: bool operator==( const Vector4 &pt ) const;
+
+ /// \brief Equality operators
+ public: bool operator!=( const Vector4 &pt ) const;
+
+ /// \brief See if a point is finite (e.g., not nan)
+ public: bool IsFinite() const;
+
+ /// \brief [] operator
+ public: double operator[](unsigned int index) const;
+
+ /// X value
+ public: double x;
+
+ /// Y value
+ public: double y;
+
+ /// Z value
+ public: double z;
+
+ /// W value
+ public: double w;
+
+ /// \brief Ostream operator
+ /// \param out Ostream
+ /// \param pt Vector4 to output
+ /// \return The Ostream
+ public: friend std::ostream &operator<<( std::ostream &out, const
gazebo::Vector4 &pt )
+ {
+ out << pt.x << " " << pt.y << " " << pt.z << " " << pt.w;
+
+ return out;
+ }
+
+ /// \brief Istream operator
+ /// \param in Ostream
+ /// \param pt Vector4 to read values into
+ /// \return The istream
+ public: friend std::istream &operator>>( std::istream &in, gazebo::Vector4
&pt )
+ {
+ // Skip white spaces
+ in.setf( std::ios_base::skipws );
+ in >> pt.x >> pt.y >> pt.z >> pt.w;
+ return in;
+ }
+
+};
+
+/// \}
+}
+
+#endif
Modified: code/gazebo/trunk/worlds/bandit.world
===================================================================
--- code/gazebo/trunk/worlds/bandit.world 2008-08-20 22:36:51 UTC (rev
6969)
+++ code/gazebo/trunk/worlds/bandit.world 2008-08-20 23:19:02 UTC (rev
6970)
@@ -16,7 +16,7 @@
<verbosity>5</verbosity>
<physics:ode>
- <stepTime>0.03</stepTime>
+ <stepTime>0.3</stepTime>
<gravity>0 0 -9.8</gravity>
<cfm>10e-5</cfm>
<erp>0.3</erp>
Modified: code/gazebo/trunk/worlds/models/bandit.model
===================================================================
--- code/gazebo/trunk/worlds/models/bandit.model 2008-08-20 22:36:51 UTC
(rev 6969)
+++ code/gazebo/trunk/worlds/models/bandit.model 2008-08-20 23:19:02 UTC
(rev 6970)
@@ -100,7 +100,6 @@
<lowStop>-15</lowStop>
<highStop>15</highStop>
<erp>0.1</erp>
- <cfm>10e-5</cfm>
</joint:hinge>
<body:box name="torso_body">
@@ -127,7 +126,6 @@
<lowStop>-90</lowStop>
<highStop>90</highStop>
<erp>0.1</erp>
- <cfm>10e-5</cfm>
</joint:hinge>
<body:box name="right_shoulder_mounting_body">
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit