Revision: 8679
http://playerstage.svn.sourceforge.net/playerstage/?rev=8679&view=rev
Author: natepak
Date: 2010-05-14 17:07:03 +0000 (Fri, 14 May 2010)
Log Message:
-----------
Fixed bugs in the UI
Modified Paths:
--------------
code/gazebo/trunk/Media/materials/scripts/Gazebo.material
code/gazebo/trunk/Media/materials/textures/CMakeLists.txt
code/gazebo/trunk/Media/materials/textures/cursor.png
code/gazebo/trunk/server/Entity.cc
code/gazebo/trunk/server/Model.cc
code/gazebo/trunk/server/World.cc
code/gazebo/trunk/server/World.hh
code/gazebo/trunk/server/gui/BoxMaker.cc
code/gazebo/trunk/server/gui/CylinderMaker.cc
code/gazebo/trunk/server/gui/Events.cc
code/gazebo/trunk/server/gui/Events.hh
code/gazebo/trunk/server/gui/GLFrame.cc
code/gazebo/trunk/server/gui/GLWindow.cc
code/gazebo/trunk/server/gui/GLWindow.hh
code/gazebo/trunk/server/gui/Gui.cc
code/gazebo/trunk/server/gui/Sidebar.cc
code/gazebo/trunk/server/gui/Sidebar.hh
code/gazebo/trunk/server/gui/SphereMaker.cc
code/gazebo/trunk/server/gui/Toolbar.cc
code/gazebo/trunk/server/gui/Toolbar.hh
code/gazebo/trunk/server/physics/Body.cc
code/gazebo/trunk/server/rendering/OgreAdaptor.cc
code/gazebo/trunk/server/sensors/ray/RaySensor.cc
code/gazebo/trunk/server/sensors/ray/RaySensor.hh
Added Paths:
-----------
code/gazebo/trunk/Media/materials/textures/hand_cursor.png
Modified: code/gazebo/trunk/Media/materials/scripts/Gazebo.material
===================================================================
--- code/gazebo/trunk/Media/materials/scripts/Gazebo.material 2010-05-13
23:07:53 UTC (rev 8678)
+++ code/gazebo/trunk/Media/materials/scripts/Gazebo.material 2010-05-14
17:07:03 UTC (rev 8679)
@@ -330,11 +330,17 @@
pass
{
scene_blend alpha_blend
- ambient 0.000000 0.000000 0.900000 0.2
- diffuse 0.000000 0.000000 0.900000 0.2
- specular 0.000000 0.000000 0.100000 0.1
- emissive 0.000000 0.000000 1.000000 0.2
- lighting on
+ depth_write off
+
+ ambient 0.0 0.0 1.0 1
+ diffuse 0.0 0.0 1.0 1
+
+ texture_unit
+ {
+ colour_op_ex source1 src_current src_current 0 1 0
+ alpha_op_ex source1 src_manual src_current 0.4
+ }
+
}
}
}
Modified: code/gazebo/trunk/Media/materials/textures/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/Media/materials/textures/CMakeLists.txt 2010-05-13
23:07:53 UTC (rev 8678)
+++ code/gazebo/trunk/Media/materials/textures/CMakeLists.txt 2010-05-14
17:07:03 UTC (rev 8679)
@@ -119,6 +119,7 @@
sphere_create_grey.png
cylinder_create_blue.png
cursor.png
+ hand_cursor.png
)
INSTALL(FILES ${files} DESTINATION
${CMAKE_INSTALL_PREFIX}/share/gazebo/Media/materials/textures/)
Modified: code/gazebo/trunk/Media/materials/textures/cursor.png
===================================================================
(Binary files differ)
Added: code/gazebo/trunk/Media/materials/textures/hand_cursor.png
===================================================================
(Binary files differ)
Property changes on: code/gazebo/trunk/Media/materials/textures/hand_cursor.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Modified: code/gazebo/trunk/server/Entity.cc
===================================================================
--- code/gazebo/trunk/server/Entity.cc 2010-05-13 23:07:53 UTC (rev 8678)
+++ code/gazebo/trunk/server/Entity.cc 2010-05-14 17:07:03 UTC (rev 8679)
@@ -81,15 +81,15 @@
// Destructor
Entity::~Entity()
{
-
// remove self as a child of the parent
- //if (this->parent)
- // this->parent->RemoveChild(this);
+ if (this->parent)
+ this->parent->RemoveChild(this);
// remove all connected joints for a Body before delteing it
- // gazebo::Model* parent_model = dynamic_cast<gazebo::Model*>(this->parent);
- // if (parent_model)
- // parent_model->DeleteConnectedJoints(this);
+ /*gazebo::Model* parent_model = dynamic_cast<gazebo::Model*>(this->parent);
+ if (parent_model)
+ parent_model->DeleteConnectedJoints(this);
+ */
this->SetParent(NULL);
@@ -113,7 +113,7 @@
m->Detach();
}
- //delete *iter;
+ delete *iter;
}
}
Modified: code/gazebo/trunk/server/Model.cc
===================================================================
--- code/gazebo/trunk/server/Model.cc 2010-05-13 23:07:53 UTC (rev 8678)
+++ code/gazebo/trunk/server/Model.cc 2010-05-14 17:07:03 UTC (rev 8679)
@@ -99,20 +99,17 @@
// Destructor
Model::~Model()
{
- std::vector<Entity*>::iterator eiter;
+ /*std::vector<Entity*>::iterator eiter;
for (eiter =this->children.begin(); eiter != this->children.end();)
if (*eiter && (*eiter)->GetType() == Entity::BODY)
{
- //printf("~Model:deleting %s\n", (*eiter)->GetName().c_str());
delete (*eiter);
*eiter = NULL;
this->children.erase(eiter); // effectively remove child
}
else
- {
- //printf("~Model:del not body %s\n", (*eiter)->GetName().c_str());
eiter++;
- }
+ */
JointContainer::iterator jiter;
std::map< std::string, Controller* >::iterator citer;
@@ -155,7 +152,6 @@
delete this->myBodyNameP;
this->myBodyNameP = NULL;
}
-
}
////////////////////////////////////////////////////////////////////////////////
@@ -516,9 +512,12 @@
if (!(*jiter))
continue;
- if ((*jiter)->GetJointBody(0)->GetName() == child->GetName() ||
- (*jiter)->GetJointBody(1)->GetName() == child->GetName() ||
- (*jiter)->GetJointBody(0)->GetName() ==
(*jiter)->GetJointBody(1)->GetName())
+ Body *jbody0 = (*jiter)->GetJointBody(0);
+ Body *jbody1 = (*jiter)->GetJointBody(1);
+
+ if (!jbody0 || !jbody1 || jbody0->GetName() == child->GetName() ||
+ jbody1->GetName() == child->GetName() ||
+ jbody0->GetName() == jbody1->GetName())
{
Joint *joint = *jiter;
this->joints.erase( jiter );
Modified: code/gazebo/trunk/server/World.cc
===================================================================
--- code/gazebo/trunk/server/World.cc 2010-05-13 23:07:53 UTC (rev 8678)
+++ code/gazebo/trunk/server/World.cc 2010-05-14 17:07:03 UTC (rev 8679)
@@ -523,26 +523,32 @@
// maybe try try_lock here instead
boost::recursive_mutex::scoped_lock
lock(*Simulator::Instance()->GetMDMutex());
-
// Remove and delete all models that are marked for deletion
std::vector< std::string>::iterator miter;
for (miter=this->toDeleteEntities.begin();
miter!=this->toDeleteEntities.end(); miter++)
{
Entity *entity = this->GetEntityByName(*miter);
+
if (entity)
{
if (entity->GetType() == Entity::MODEL)
{
Model *model = (Model*)entity;
+
model->Fini();
- this->models.erase( std::find(this->models.begin(),
- this->models.end(), model) );
+
+ std::vector<Model*>::iterator newiter;
+ newiter = std::find(this->models.begin(), this->models.end(), model);
+
+ if (newiter != this->models.end())
+ this->models.erase( newiter );
}
else if (entity->GetType() == Entity::BODY)
((Body*)entity)->Fini();
delete (entity);
+ this->deleteEntitySignal(*miter);
}
}
Modified: code/gazebo/trunk/server/World.hh
===================================================================
--- code/gazebo/trunk/server/World.hh 2010-05-13 23:07:53 UTC (rev 8678)
+++ code/gazebo/trunk/server/World.hh 2010-05-14 17:07:03 UTC (rev 8679)
@@ -269,11 +269,18 @@
public: template<typename T>
boost::signals::connection ConnectAddEntitySignal( T subscriber )
{ return addEntitySignal.connect(subscriber); }
-
public: template<typename T>
void DisconnectAddEntitySignal( T subscriber)
{ addEntitySignal.disconnect(subscriber); }
+ /// \brief Connect a boost::slot the delete entity signal
+ public: template<typename T>
+ boost::signals::connection ConnectDeleteEntitySignal( T subscriber )
+ { return deleteEntitySignal.connect(subscriber); }
+ public: template<typename T>
+ void DisconnectDeleteEntitySignal( T subscriber)
+ { deleteEntitySignal.disconnect(subscriber); }
+
/// \brief Connect a boost::slot the the show light source signal
public: template<typename T>
boost::signals::connection ConnectShowLightsSignal( T subscriber )
@@ -407,6 +414,7 @@
private: boost::signal<void (Entity*)> addEntitySignal;
+ private: boost::signal<void (std::string)> deleteEntitySignal;
private: boost::signal<void (bool)> showLightsSignal;
private: boost::signal<void (bool)> showCamerasSignal;
private: boost::signal<void (bool)> showContactsSignal;
Modified: code/gazebo/trunk/server/gui/BoxMaker.cc
===================================================================
--- code/gazebo/trunk/server/gui/BoxMaker.cc 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/BoxMaker.cc 2010-05-14 17:07:03 UTC (rev
8679)
@@ -42,6 +42,10 @@
void BoxMaker::Stop()
{
+ OgreVisual *vis = OgreCreator::Instance()->GetVisual(this->visualName);
+ if (vis)
+ OgreCreator::Instance()->DeleteVisual(this->visualName);
+
this->state = 0;
}
@@ -137,12 +141,9 @@
std::ostringstream newModelStr;
-
OgreVisual *vis = OgreCreator::Instance()->GetVisual(this->visualName);
- if (vis == NULL)
- {
+ if (!vis)
return;
- }
newModelStr << "<?xml version='1.0'?> <gazebo:world
xmlns:xi='http://www.w3.org/2001/XInclude'
xmlns:gazebo='http://playerstage.sourceforge.net/gazebo/xmlschema/#gz'
xmlns:model='http://playerstage.sourceforge.net/gazebo/xmlschema/#model'
xmlns:sensor='http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor'
xmlns:body='http://playerstage.sourceforge.net/gazebo/xmlschema/#body'
xmlns:geom='http://playerstage.sourceforge.net/gazebo/xmlschema/#geom'
xmlns:joint='http://playerstage.sourceforge.net/gazebo/xmlschema/#joint'
xmlns:interface='http://playerstage.sourceforge.net/gazebo/xmlschema/#interface'
xmlns:rendering='http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering'
xmlns:renderable='http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable'
xmlns:controller='http://playerstage.sourceforge.net/gazebo/xmlschema/#controller'
xmlns:physics='http://playerstage.sourceforge.net/gazebo/xmlschema/#physics'
>";
Modified: code/gazebo/trunk/server/gui/CylinderMaker.cc
===================================================================
--- code/gazebo/trunk/server/gui/CylinderMaker.cc 2010-05-13 23:07:53 UTC
(rev 8678)
+++ code/gazebo/trunk/server/gui/CylinderMaker.cc 2010-05-14 17:07:03 UTC
(rev 8679)
@@ -40,6 +40,10 @@
void CylinderMaker::Stop()
{
+ OgreVisual *vis = OgreCreator::Instance()->GetVisual(this->visualName);
+ if (vis)
+ OgreCreator::Instance()->DeleteVisual(this->visualName);
+
this->state = 0;
}
@@ -134,6 +138,8 @@
std::ostringstream newModelStr;
OgreVisual *vis = OgreCreator::Instance()->GetVisual(this->visualName);
+ if (!vis)
+ return;
newModelStr << "<?xml version='1.0'?> <gazebo:world
xmlns:xi='http://www.w3.org/2001/XInclude'
xmlns:gazebo='http://playerstage.sourceforge.net/gazebo/xmlschema/#gz'
xmlns:model='http://playerstage.sourceforge.net/gazebo/xmlschema/#model'
xmlns:sensor='http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor'
xmlns:body='http://playerstage.sourceforge.net/gazebo/xmlschema/#body'
xmlns:geom='http://playerstage.sourceforge.net/gazebo/xmlschema/#geom'
xmlns:joint='http://playerstage.sourceforge.net/gazebo/xmlschema/#joint'
xmlns:interface='http://playerstage.sourceforge.net/gazebo/xmlschema/#interface'
xmlns:rendering='http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering'
xmlns:renderable='http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable'
xmlns:controller='http://playerstage.sourceforge.net/gazebo/xmlschema/#controller'
xmlns:physics='http://playerstage.sourceforge.net/gazebo/xmlschema/#physics'
>";
Modified: code/gazebo/trunk/server/gui/Events.cc
===================================================================
--- code/gazebo/trunk/server/gui/Events.cc 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/Events.cc 2010-05-14 17:07:03 UTC (rev
8679)
@@ -3,3 +3,5 @@
using namespace gazebo;
boost::signal<void (std::string)> Events::createEntitySignal;
+boost::signal<void (bool)> Events::moveModeSignal;
+boost::signal<void (bool)> Events::manipModeSignal;
Modified: code/gazebo/trunk/server/gui/Events.hh
===================================================================
--- code/gazebo/trunk/server/gui/Events.hh 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/Events.hh 2010-05-14 17:07:03 UTC (rev
8679)
@@ -16,7 +16,29 @@
static void DisconnectCreateEntitySignal( T subscriber)
{ createEntitySignal.disconnect(subscriber); }
+ /// \brief Connect a boost::slot the the move mode signal
+ public: template<typename T>
+ static boost::signals::connection ConnectMoveModeSignal( T
subscriber )
+ { return moveModeSignal.connect(subscriber); }
+
+ public: template<typename T>
+ static void DisconnectMoveModeSignal( T subscriber)
+ { moveModeSignal.disconnect(subscriber); }
+
+ /// \brief Connect a boost::slot the the manip mode signal
+ public: template<typename T>
+ static boost::signals::connection ConnectManipModeSignal( T
subscriber )
+ { return manipModeSignal.connect(subscriber); }
+
+ public: template<typename T>
+ static void DisconnectManipModeSignal( T subscriber)
+ { manipModeSignal.disconnect(subscriber); }
+
+
+
public: static boost::signal<void (std::string)> createEntitySignal;
+ public: static boost::signal<void (bool)> moveModeSignal;
+ public: static boost::signal<void (bool)> manipModeSignal;
};
}
Modified: code/gazebo/trunk/server/gui/GLFrame.cc
===================================================================
--- code/gazebo/trunk/server/gui/GLFrame.cc 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/GLFrame.cc 2010-05-14 17:07:03 UTC (rev
8679)
@@ -62,6 +62,7 @@
this->viewChoice->add("User", "", &gazebo::GLFrame::ViewCB, this);
this->viewChoice->value(0);
this->viewChoice->color(BG_COLOR);
+ this->viewChoice->clear_visible_focus();
this->splitChoice = new Fl_Choice(
@@ -74,6 +75,7 @@
this->splitChoice->add("Vertical","", &gazebo::GLFrame::SplitCB, this);
this->splitChoice->value(0);
this->splitChoice->color(BG_COLOR);
+ this->splitChoice->clear_visible_focus();
this->trackChoice = new Fl_Choice(
this->splitChoice->x() + this->splitChoice->w()+2,
@@ -83,6 +85,7 @@
this->trackChoice->add("None","", &gazebo::GLFrame::TrackCB, this);
this->trackChoice->value(0);
this->trackChoice->color(BG_COLOR);
+ this->trackChoice->clear_visible_focus();
std::vector<Model*> models = World::Instance()->GetModels();
std::vector<Model*>::iterator iter;
@@ -268,6 +271,8 @@
}
choice->value(0);
+
+ frame->glWindow->take_focus();
}
////////////////////////////////////////////////////////////////////////////////
@@ -278,6 +283,7 @@
Fl_Choice *choice = dynamic_cast<Fl_Choice *>(widget);
frame->glWindow->SetViewStyle(choice->text());
+ frame->glWindow->take_focus();
}
////////////////////////////////////////////////////////////////////////////////
Modified: code/gazebo/trunk/server/gui/GLWindow.cc
===================================================================
--- code/gazebo/trunk/server/gui/GLWindow.cc 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/GLWindow.cc 2010-05-14 17:07:03 UTC (rev
8679)
@@ -88,6 +88,10 @@
activeWin = this;
Events::ConnectCreateEntitySignal( boost::bind(&GLWindow::CreateEntity,
this, _1) );
+ Events::ConnectMoveModeSignal( boost::bind(&GLWindow::MoveModeCB, this, _1)
);
+ Events::ConnectManipModeSignal( boost::bind(&GLWindow::ManipModeCB, this,
_1) );
+
+ this->cursorState = "default";
}
////////////////////////////////////////////////////////////////////////////////
@@ -169,20 +173,8 @@
this->directionVec.Set(0,0,0);
}
- this->lastUpdateTime = Simulator::Instance()->GetRealTime();
- // continuously apply force to selected body
- Entity *entity = World::Instance()->GetSelectedEntity();
-
- if (entity && entity->GetType() == Entity::BODY &&
- (this->keys[FL_Control_L] || this->keys[FL_Control_R]) )
- {
- Body *body = (Body*)(entity);
- if (this->rightMousePressed && body)
- {
- body->SetForce(this->forceVec);
- }
- }
+ this->lastUpdateTime = Simulator::Instance()->GetRealTime();
}
@@ -211,10 +203,6 @@
/// Handle a mouse button push
void GLWindow::HandleMousePush()
{
- // reset applied forces to 0
- this->forceVec = 0;
- this->torqueVec = 0;
-
this->mousePushPos = this->mousePos;
this->boxMaker.MousePushCB(this->mousePos);
@@ -237,12 +225,10 @@
{
case FL_LEFT_MOUSE:
this->leftMousePressed = true;
- //this->torqueVec = Vector3(0,0,0); // not necessary
break;
case FL_RIGHT_MOUSE:
this->rightMousePressed = true;
- //this->forceVec = Vector3(0,0,0); // not necessary
break;
case FL_MIDDLE_MOUSE:
@@ -255,6 +241,7 @@
/// Handle a mouse button release
void GLWindow::HandleMouseRelease()
{
+
OgreCreator::SetVisible("guiline", false);
this->boxMaker.MouseReleaseCB(this->mousePos);
@@ -282,8 +269,7 @@
break;
}
- if (!this->mouseDrag &&
- (this->keys[FL_Control_L] || this->keys[FL_Control_R]))
+ if (!this->mouseDrag && this->GetCursorState() == "manip")
{
Entity *entity = OgreAdaptor::Instance()->GetEntityAt(this->activeCamera,
this->mousePos, this->mouseModifier);
@@ -291,10 +277,6 @@
Model *model = Simulator::Instance()->GetParentModel(entity);
Body *body = Simulator::Instance()->GetParentBody(entity);
- // reset applied forces to 0
- this->forceVec = 0;
- this->torqueVec = 0;
-
switch (Fl::event_button())
{
case FL_LEFT_MOUSE:
@@ -323,6 +305,7 @@
{
// stop simulation when this is happening
boost::recursive_mutex::scoped_lock
lock(*Simulator::Instance()->GetMRMutex());
+
this->mouseDrag = true;
this->boxMaker.MouseDragCB(this->mousePos);
@@ -337,28 +320,20 @@
{
Vector2<int> drag = this->mousePos - this->prevMousePos;
- double vpw = this->activeCamera->GetViewportWidth();
- double vph = this->activeCamera->GetViewportHeight();
- Vector3 camUp = this->activeCamera->GetUp();
- Vector3 camRight = this->activeCamera->GetRight();
-
Entity *entity = World::Instance()->GetSelectedEntity();
if (this->leftMousePressed)
{
-
if ( entity && (entity->GetType() == Entity::MODEL ||
entity->GetType() == Entity::BODY) &&
- (this->keys[FL_Control_L] || this->keys[FL_Control_R]) )
+ this->GetCursorState() == "manip" )
{
- if ((entity->GetType() == Entity::MODEL ||
- entity->GetType() == Entity::BODY) &&
- this->mouseModifier.substr(0,3) == "rot")
+ if (this->mouseModifier.substr(0,3) == "rot")
this->EntityRotate(entity);
else if (this->mouseModifier.substr(0,5) == "trans")
this->EntityTranslate(entity);
}
- else
+ else if(this->GetCursorState() == "default")
{
//
// interactively rotate view
@@ -367,127 +342,22 @@
this->activeCamera->RotatePitch(DTOR(-drag.y * this->rotateAmount));
}
}
- else if (this->rightMousePressed)
+ else if (this->rightMousePressed && this->GetCursorState() == "default")
{
- if ( entity && (entity->GetType() == Entity::MODEL || entity->GetType()
== Entity::BODY) &&
- (this->keys[FL_Control_L] || this->keys[FL_Control_R]))
- {
- if (entity->GetType() == Entity::MODEL)
- {
- Model *model = (Model*)(entity);
- double distance, scaleX, scaleY;
- Pose3d modelPose;
- Vector3 moveVector;
-
- //
- // interactively set pose to selected model
- //
- modelPose = model->GetAbsPose();
- distance = (modelPose.pos -
- this->activeCamera->GetCameraPosition()).GetLength();
- scaleX = distance *
- tan (this->activeCamera->GetHFOV().GetAsRadian() / 2.0f ) * 2.0f;
- scaleY = distance *
- tan (this->activeCamera->GetVFOV().GetAsRadian() / 2.0f ) * 2.0f;
- moveVector = (camRight*drag.x/vpw*scaleX - camUp*drag.y/vph*scaleY);
- // std::cout << " vpw " << vpw
- // << " vph " << vph
- // << " distance " << distance
- // << " scaleX " << scaleX
- // << " scaleY " << scaleY
- // << std::endl;
-
- modelPose.pos += moveVector;
- model->SetAbsPose(modelPose);
- //std::cout << "set pose (" << modelPose << ") to model ("
- // << model->GetName() << ")" << std::endl;
- }
-
- if (entity->GetType() == Entity::BODY)
- {
- double distance, scaleX, scaleY, forceScale;
- Pose3d bodyPose;
- Vector3 moveVector;
- Body *body = (Body*)(entity);
-
- //
- // interactively set force to selected body
- //
- bodyPose = body->GetAbsPose();
- distance = (bodyPose.pos -
- this->activeCamera->GetCameraPosition()).GetLength();
- scaleX = distance *
- tan (this->activeCamera->GetHFOV().GetAsRadian() / 2.0f ) * 2.0f;
- scaleY = distance *
- tan (this->activeCamera->GetVFOV().GetAsRadian() / 2.0f ) * 2.0f;
- moveVector = (camRight*drag.x/vpw*scaleX - camUp*drag.y/vph*scaleY);
- // std::cout << " vpw " << vpw
- // << " vph " << vph
- // << " distance " << distance
- // << " scaleX " << scaleX
- // << " scaleY " << scaleY
- // << std::endl;
-
- forceScale = 10000.0;
- this->forceVec = moveVector*forceScale;
- //std::cout << "set body force to" << this->forceVec
- // << " to body " << body->GetName() << std::endl;
- }
- }
- else
- {
- //
- // interactively pan view
- //
- this->directionVec.x = 0;
- this->directionVec.y = drag.x * this->moveAmount;
- this->directionVec.z = drag.y * this->moveAmount;
- }
+ //
+ // interactively pan view
+ //
+ this->directionVec.x = 0;
+ this->directionVec.y = drag.x * this->moveAmount;
+ this->directionVec.z = drag.y * this->moveAmount;
}
- else if (this->middleMousePressed)
+ else if (this->middleMousePressed && this->GetCursorState() == "default")
{
- if (entity && entity->GetType() == Entity::BODY &&
- (this->keys[FL_Control_L] || this->keys[FL_Control_R]))
- {
- double distance, scaleX, scaleY;
- Vector3 moveVector;
- Pose3d bodyPose;
-
- Body *body = (Body*)(entity);
-
- //
- // interactively set pose to selected body
- //
- bodyPose = body->GetAbsPose();
-
- //Vector2<double> ddrag((double)drag.x,(double)drag.y);
- //if (drag.x*drag.x + drag.y*drag.y > 0)
- // ddrag.Normalize();
- //Vector3 dragVector = (camRight*ddrag.x - camUp*ddrag.y);
- //bodyPose.pos += dragVector*0.05;
-
- distance = (bodyPose.pos -
- this->activeCamera->GetCameraPosition()).GetLength();
- scaleX = distance *
- tan (this->activeCamera->GetHFOV().GetAsRadian() / 2.0f ) * 2.0f;
- scaleY = distance *
- tan (this->activeCamera->GetVFOV().GetAsRadian() / 2.0f ) * 2.0f;
- moveVector = (camRight*drag.x/vpw*scaleX - camUp*drag.y/vph*scaleY);
-
- bodyPose.pos += moveVector;
- body->SetAbsPose(bodyPose);
- //std::cout << "set pose (" << bodyPose << ") to Body ("
- // << body->GetName() << ")" << std::endl;
- }
- else
- {
- this->directionVec.x = drag.y * this->moveAmount;
- this->directionVec.y = 0;
- this->directionVec.z = 0;
- }
+ this->directionVec.x = drag.y * this->moveAmount;
+ this->directionVec.y = 0;
+ this->directionVec.z = 0;
}
}
-
}
////////////////////////////////////////////////////////////////////////////////
@@ -497,40 +367,13 @@
// stop simulation when this is happening
boost::recursive_mutex::scoped_lock
lock(*Simulator::Instance()->GetMRMutex());
- Entity *entity = World::Instance()->GetSelectedEntity();
-
- if ( entity && (entity->GetType() == Entity::MODEL || entity->GetType() ==
Entity::BODY) &&
- (this->keys[FL_Control_L] || this->keys[FL_Control_R]) )
+ if (this->activeCamera && this->activeCamera->GetUserMovable() &&
+ this->GetCursorState() == "default")
{
- // FIXME: old
- if (entity->GetType() == Entity::MODEL)
- {
- Model *model = (Model*)(entity);
-
- Pose3d pose = model->GetAbsPose();
- pose.pos.z += dy * 0.05;
- model->SetAbsPose(pose);
- //std::cout << "set pose z(" << pose.pos.z << ") to model ("
- // << model->GetName() << ")" << std::endl;
- }
- // FIXME: old
- if (entity->GetType() == Entity::BODY)
- {
- Body *body = (Body*)(entity);
- Pose3d pose = body->GetAbsPose();
- pose.pos.z += dy * 0.05;
- body->SetAbsPose(pose);
- //std::cout << "set pose z(" << pose.pos.z << ") to body ("
- // << body->GetName() << ")" << std::endl;
- }
- }
- else if (this->activeCamera && this->activeCamera->GetUserMovable())
- {
this->directionVec.x -= 50.0 * dy * this->moveAmount;
this->directionVec.y = 0;
this->directionVec.z = 0;
}
-
}
////////////////////////////////////////////////////////////////////////////////
@@ -546,6 +389,7 @@
// loop through the keys to find the modifiers -- swh
float moveAmount = this->moveAmount;
+
for (iter = this->keys.begin(); iter!= this->keys.end(); iter++)
{
if (iter->second == 1)
@@ -554,25 +398,13 @@
{
case FL_Control_L:
case FL_Control_R:
+ Events::manipModeSignal(true);
moveAmount = this->moveAmount * 10;
break;
case FL_CTRL+'q':
Simulator::Instance()->SetUserQuit();
break;
- }
- }
- }
- for (iter = this->keys.begin(); iter!= this->keys.end(); iter++)
- {
- if (iter->second == 1)
- {
- switch (iter->first)
- {
- case ' ':
- Simulator::Instance()->SetPaused(!Simulator::Instance()->IsPaused()
);
- break;
-
case '=':
case '+':
this->moveAmount *= 2;
@@ -583,25 +415,6 @@
this->moveAmount *= 0.5;
break;
- case XK_j:
- this->forceVec.z -= 100*this->moveAmount;
- break;
- case XK_k:
- this->forceVec.z += 100*this->moveAmount;
- break;
- case XK_h:
- this->forceVec.y -= 100*this->moveAmount;
- break;
- case XK_l:
- this->forceVec.y += 100*this->moveAmount;
- break;
- case XK_x:
- this->forceVec.x += 100*this->moveAmount;
- break;
- case XK_z:
- this->forceVec.x -= 100*this->moveAmount;
- break;
-
case XK_Up:
case XK_w:
this->directionVec.x += this->moveAmount;
@@ -638,6 +451,8 @@
}
}
+
+
////////////////////////////////////////////////////////////////////////////////
/// Handle a key release
void GLWindow::HandleKeyRelease(int keyNum)
@@ -647,6 +462,15 @@
// Handle all toggle keys
switch (keyNum)
{
+ case FL_Control_L:
+ case FL_Control_R:
+ Events::moveModeSignal(true);
+ break;
+
+ case ' ':
+ Simulator::Instance()->SetPaused(!Simulator::Instance()->IsPaused() );
+ break;
+
case FL_Escape:
Simulator::Instance()->SetUserQuit();
break;
@@ -658,6 +482,15 @@
case ']':
CameraManager::Instance()->DecActiveCamera();
break;
+
+ case FL_Delete:
+ Entity *entity = World::Instance()->GetSelectedEntity();
+ if (entity)
+ {
+ World::Instance()->SetSelectedEntity(NULL);
+ World::Instance()->DeleteEntity(entity->GetCompleteScopedName());
+ }
+ break;
}
}
@@ -700,7 +533,8 @@
break;
case FL_DRAG:
- this->HandleMouseDrag();
+ if (this->prevMousePos.Distance(this->mousePos) > 0)
+ this->HandleMouseDrag();
handled = true;
break;
@@ -708,7 +542,7 @@
case FL_KEYDOWN:
if (Fl::event_key() == FL_Escape)
World::Instance()->SetSelectedEntity(NULL);
- else if ((Fl::event_state() | FL_CTRL) && Fl::event_key() == 113)
+ else if ((Fl::event_state() & FL_CTRL) && Fl::event_key() == 113)
// Capture CTRL-q
Simulator::Instance()->SetUserQuit();
else if (activeWin != this)
@@ -948,14 +782,17 @@
void GLWindow::CreateEntity(std::string name)
{
- World::Instance()->SetSelectedEntity(NULL);
+
this->boxMaker.Stop();
this->sphereMaker.Stop();
this->cylinderMaker.Stop();
this->hingeJointMaker.Stop();
- this->cursor(FL_CURSOR_CROSS);
+ this->SetCursorState("create");
+ if (name.size() > 0)
+ World::Instance()->SetSelectedEntity(NULL);
+
if (name == "box")
this->boxMaker.Start();
else if (name == "cylinder")
@@ -965,6 +802,39 @@
else if (name == "hingejoint")
this->hingeJointMaker.Start();
else
+ this->SetCursorState("default");
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Get the cursor state
+std::string GLWindow::GetCursorState() const
+{
+ return this->cursorState;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Set the cursor state
+void GLWindow::SetCursorState(const std::string &state)
+{
+ this->cursorState = state;
+
+ if (state == "default")
this->cursor(FL_CURSOR_DEFAULT);
+ else if (state == "manip")
+ this->cursor(FL_CURSOR_HAND);
+ else if (state == "create")
+ this->cursor(FL_CURSOR_CROSS);
+}
+void GLWindow::MoveModeCB(bool mode)
+{
+ if (mode)
+ this->SetCursorState("default");
}
+
+void GLWindow::ManipModeCB(bool mode)
+{
+ if (mode)
+ this->SetCursorState("manip");
+}
+
Modified: code/gazebo/trunk/server/gui/GLWindow.hh
===================================================================
--- code/gazebo/trunk/server/gui/GLWindow.hh 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/GLWindow.hh 2010-05-14 17:07:03 UTC (rev
8679)
@@ -112,6 +112,12 @@
public: static Vector3 GetWorldPointOnPlane(int x, int y,
Vector3 planeNorm, double d);
+ /// \brief Get the cursor state
+ public: std::string GetCursorState() const;
+
+ /// \brief Set the state of the cursor
+ public: void SetCursorState(const std::string &state);
+
/// \brief Handle a mouse button push
private: void HandleMousePush();
@@ -130,6 +136,8 @@
/// \brief Handle mouse wheel movement
private: void HandleMouseWheel(int dx, int dy);
+ private: void ManipModeCB(bool mode);
+ private: void MoveModeCB(bool mode);
/// \brief Clear selections
private: void ClearSelections();
@@ -189,6 +197,8 @@
private: CylinderMaker cylinderMaker;
private: HingeJointMaker hingeJointMaker;
+ private: std::string cursorState;
+
/// gui interface, prerequisite to selecting Model / Body
/// press control+left click Model to toggle select. Left mouse button
drag updates model rotation about camera view axis, right mouse button drag
udpates model position in camera view plane.
/// press control+right click Body to toggle select body select. Left
mouse button drag applies torque, right mouse button drag applies linear force.
Modified: code/gazebo/trunk/server/gui/Gui.cc
===================================================================
--- code/gazebo/trunk/server/gui/Gui.cc 2010-05-13 23:07:53 UTC (rev 8678)
+++ code/gazebo/trunk/server/gui/Gui.cc 2010-05-14 17:07:03 UTC (rev 8679)
@@ -216,8 +216,18 @@
{
switch(event)
{
+ case FL_KEYUP:
+ {
+ if (Fl::event_key() == ' ')
+ {
+ printf("Gui Pause\n");
+ Simulator::Instance()->SetPaused(!Simulator::Instance()->IsPaused()
);
+ return 1;
+ }
+ }
+
case FL_SHORTCUT:
- if ( (Fl::event_state() | FL_CTRL) && Fl::event_key() == 113)
+ if ( (Fl::event_state() & FL_CTRL) && Fl::event_key() == 113)
Simulator::Instance()->SetUserQuit();
break;
case FL_FOCUS:
Modified: code/gazebo/trunk/server/gui/Sidebar.cc
===================================================================
--- code/gazebo/trunk/server/gui/Sidebar.cc 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/Sidebar.cc 2010-05-14 17:07:03 UTC (rev
8679)
@@ -28,6 +28,7 @@
#include <FL/Fl_Value_Output.H>
#include <FL/Fl_Output.H>
#include <FL/Fl_Input.H>
+#include <FL/Fl_Float_Input.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Value_Slider.H>
@@ -79,10 +80,10 @@
this->paramBrowser->color(FL_WHITE);
y = this->paramBrowser->y() + this->paramBrowser->h() + 20;
- this->paramInput = new Fl_Input(x+10, y, w-20, 20, "Param:");
+ this->paramInput = new Fl_Float_Input(x+10, y, w-20, 20, "Param:");
this->paramInput->align(FL_ALIGN_TOP);
this->paramInput->labelsize(12);
- this->paramInput->when( FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE );
+ this->paramInput->when(FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE |
FL_WHEN_CHANGED);
this->paramInput->callback(&Sidebar::ParamInputCB, this);
this->paramInput->color(FL_WHITE);
this->paramInput->value("1.0");
@@ -96,8 +97,12 @@
World::Instance()->ConnectAddEntitySignal(
boost::bind(&Sidebar::AddEntityToBrowser, this, _1) );
+
World::Instance()->ConnectEntitySelectedSignal(
boost::bind(&Sidebar::SetSelectedEntity, this, _1) );
+
+ World::Instance()->ConnectDeleteEntitySignal(
+ boost::bind(&Sidebar::DeleteEntityFromBrowser, this, _1) );
}
////////////////////////////////////////////////////////////////////////////////
@@ -122,16 +127,23 @@
{
this->paramCount = 0;
+ Model *model = NULL;
- if (entity && entity->GetType() == Entity::MODEL)
+ if (entity && entity->GetType() == Entity::BODY)
+ model = (Model*)(entity->GetParent());
+ else if (entity && entity->GetType() == Entity::MODEL)
{
this->paramBrowser->deselect();
- Model *model = (Model*)(entity);
+ model = (Model*)(entity);
+ }
+ if (model)
+ {
+ this->paramBrowser->clear();
for (int i=1; i <= this->entityBrowser->size(); i++)
{
std::string lineText = this->entityBrowser->text(i);
- if (lineText == entity->GetCompleteScopedName())
+ if (lineText == model->GetCompleteScopedName())
this->entityBrowser->value(i);
}
@@ -152,6 +164,10 @@
value = "@b...@b52@s-Body:~...@b@b...@s" + body->GetName();
this->AddToParamBrowser(value);
+
+ if (body->GetName() == entity->GetName())
+ this->paramBrowser->value(this->paramBrowser->size());
+
this->AddEntityToParamBrowser( body, " " );
geoms = body->GetGeoms();
@@ -182,13 +198,16 @@
this->paramInput->hide();
}
- else if (entity && entity->GetType() == Entity::BODY)
+
+ if (entity && entity->GetType() == Entity::BODY)
{
this->paramInput->show();
this->paramInput->value(boost::lexical_cast<std::string>(Gui::forceMultiplier).c_str());
this->paramInput->label("Force Multiplier:");
}
- else if (!entity)
+
+
+ if (!entity)
{
this->entityBrowser->deselect();
this->paramBrowser->deselect();
@@ -414,8 +433,19 @@
std::vector<Model*>::const_iterator iter;
const std::vector<Model*> models = World::Instance()->GetModels();
+ this->entityBrowser->clear();
for (iter = models.begin(); iter != models.end(); iter++)
+ {
+ std::vector<Entity*>::const_iterator eiter;
+ for (eiter = (*iter)->GetChildren().begin();
+ eiter != (*iter)->GetChildren().end(); eiter++)
+ {
+ if ((*eiter)->GetType() == Entity::MODEL)
+ this->AddEntityToBrowser((Model*)*eiter);
+ }
+
this->AddEntityToBrowser((*iter));
+ }
}
////////////////////////////////////////////////////////////////////////////////
@@ -426,6 +456,13 @@
}
////////////////////////////////////////////////////////////////////////////////
+// Delete entity from browser
+void Sidebar::DeleteEntityFromBrowser(const std::string &name)
+{
+ this->UpdateEntityBrowser();
+}
+
+////////////////////////////////////////////////////////////////////////////////
/// Joint choice callback
void Sidebar::JointChoiceCB( Fl_Widget *w, void *data )
{
Modified: code/gazebo/trunk/server/gui/Sidebar.hh
===================================================================
--- code/gazebo/trunk/server/gui/Sidebar.hh 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/Sidebar.hh 2010-05-14 17:07:03 UTC (rev
8679)
@@ -36,6 +36,7 @@
class Fl_Button;
class Fl_Choice;
class Fl_Value_Slider;
+class Fl_Float_Input;
namespace gazebo
{
@@ -59,6 +60,9 @@
/// \brief Add an entity to the browser
public: void AddEntityToBrowser(const Entity *model);
+ /// \brief Delete entity from browser
+ public: void DeleteEntityFromBrowser(const std::string &name);
+
/// \brief Callback for the parameter browser
public: static void ParamBrowserCB( Fl_Widget * w, void *data);
@@ -94,7 +98,7 @@
private: Fl_Value_Slider *jointVelocitySlider;
private: Fl_Hold_Browser *paramBrowser;
- private: Fl_Input *paramInput;
+ private: Fl_Float_Input *paramInput;
private: std::string paramInputLbl;
private: int paramColumnWidths[3];
Modified: code/gazebo/trunk/server/gui/SphereMaker.cc
===================================================================
--- code/gazebo/trunk/server/gui/SphereMaker.cc 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/SphereMaker.cc 2010-05-14 17:07:03 UTC (rev
8679)
@@ -40,6 +40,10 @@
void SphereMaker::Stop()
{
+ OgreVisual *vis = OgreCreator::Instance()->GetVisual(this->visualName);
+ if (vis)
+ OgreCreator::Instance()->DeleteVisual(this->visualName);
+
this->state = 0;
}
@@ -117,6 +121,8 @@
std::ostringstream newModelStr;
OgreVisual *vis = OgreCreator::Instance()->GetVisual(this->visualName);
+ if (!vis)
+ return;
newModelStr << "<?xml version='1.0'?> <gazebo:world
xmlns:xi='http://www.w3.org/2001/XInclude'
xmlns:gazebo='http://playerstage.sourceforge.net/gazebo/xmlschema/#gz'
xmlns:model='http://playerstage.sourceforge.net/gazebo/xmlschema/#model'
xmlns:sensor='http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor'
xmlns:body='http://playerstage.sourceforge.net/gazebo/xmlschema/#body'
xmlns:geom='http://playerstage.sourceforge.net/gazebo/xmlschema/#geom'
xmlns:joint='http://playerstage.sourceforge.net/gazebo/xmlschema/#joint'
xmlns:interface='http://playerstage.sourceforge.net/gazebo/xmlschema/#interface'
xmlns:rendering='http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering'
xmlns:renderable='http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable'
xmlns:controller='http://playerstage.sourceforge.net/gazebo/xmlschema/#controller'
xmlns:physics='http://playerstage.sourceforge.net/gazebo/xmlschema/#physics'
>";
Modified: code/gazebo/trunk/server/gui/Toolbar.cc
===================================================================
--- code/gazebo/trunk/server/gui/Toolbar.cc 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/Toolbar.cc 2010-05-14 17:07:03 UTC (rev
8679)
@@ -29,6 +29,7 @@
#include <FL/Fl_Box.H>
#include <FL/Fl_Bitmap.H>
#include <FL/Fl_Image.H>
+#include <FL/fl_draw.H>
#include "Events.hh"
#include "Image.hh"
@@ -123,7 +124,14 @@
this->cursorImage = new Fl_RGB_Image(data, image.GetWidth(),
image.GetHeight(), 4);
+ data = NULL;
+ image.Load("hand_cursor.png");
+ image.Rescale(22,22);
+ image.GetData(&data, dataCount);
+ this->handCursorImage = new Fl_RGB_Image(data, image.GetWidth(),
+ image.GetHeight(), 4);
+
y += 4;
x += 5;
y += 0;
@@ -152,16 +160,27 @@
this->stepButton->deactivate();
this->stepButton->clear_visible_focus();
-
y = this->y();
x = this->stepButton->x() + this->stepButton->w() + 10;
+ Fl_Box *box = new Fl_Box(x,y+4,3,22);
+ box->box(FL_DOWN_BOX);
+
+ x += 13;
this->cursorButton = new ToolbarButton(x, y, 30, 30);
this->cursorButton->callback( &gazebo::Toolbar::CursorButtonCB, this );
this->cursorButton->image(this->cursorImage);
this->cursorButton->set();
this->cursorButton->clear_visible_focus();
+
+ y = this->y();
x = this->cursorButton->x() + this->cursorButton->w() + 10;
+ this->handCursorButton = new ToolbarButton(x, y, 30, 30);
+ this->handCursorButton->callback(&gazebo::Toolbar::HandCursorButtonCB, this);
+ this->handCursorButton->image(this->handCursorImage);
+ this->handCursorButton->clear_visible_focus();
+
+ x = this->handCursorButton->x() + this->handCursorButton->w() + 10;
this->boxButton = new ToolbarButton(x, y, 30, 30);
this->boxButton->callback( &gazebo::Toolbar::BoxButtonCB, this );
this->boxButton->image(this->boxImage[0]);
@@ -181,6 +200,9 @@
this->end();
this->resizable(NULL);
+
+ Events::ConnectMoveModeSignal( boost::bind(&Toolbar::MoveModeCB, this, _1) );
+ Events::ConnectManipModeSignal( boost::bind(&Toolbar::ManipModeCB, this, _1)
);
}
////////////////////////////////////////////////////////////////////////////////
@@ -297,4 +319,26 @@
void Toolbar::CursorButtonCB( Fl_Widget *w, void * /*data*/ )
{
Events::createEntitySignal("");
+ Events::moveModeSignal(true);
}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Cursor button callback
+void Toolbar::HandCursorButtonCB( Fl_Widget *w, void * /*data*/ )
+{
+ Events::createEntitySignal("");
+ Events::manipModeSignal(true);
+}
+
+void Toolbar::MoveModeCB(bool mode)
+{
+ if (this->handCursorButton->value() == 1)
+ {
+ this->handCursorButton->value(0);
+ this->cursorButton->set();
+ }
+}
+
+void Toolbar::ManipModeCB(bool mode)
+{
+}
Modified: code/gazebo/trunk/server/gui/Toolbar.hh
===================================================================
--- code/gazebo/trunk/server/gui/Toolbar.hh 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/gui/Toolbar.hh 2010-05-14 17:07:03 UTC (rev
8679)
@@ -70,7 +70,14 @@
/// \brief Cursor button callback
public: static void CursorButtonCB( Fl_Widget *w, void * /*data*/ );
+ /// \brief Cursor button callback
+ public: static void HandCursorButtonCB( Fl_Widget *w, void * /*data*/ );
+ private: void ManipModeCB(bool mode);
+ private: void MoveModeCB(bool mode);
+
+
+
private: class ToolbarButton : public Fl_Button
{
public: ToolbarButton(int x, int y, int w, int h, const char *l=0)
@@ -109,6 +116,7 @@
private: ToolbarButton *sphereButton;
private: ToolbarButton *cylinderButton;
private: ToolbarButton *cursorButton;
+ private: ToolbarButton *handCursorButton;
private: Fl_RGB_Image *playImage[2];
private: Fl_RGB_Image *pauseImage[2];
@@ -116,7 +124,7 @@
private: Fl_RGB_Image *boxImage[2];
private: Fl_RGB_Image *sphereImage[2];
private: Fl_RGB_Image *cylinderImage[2];
- private: Fl_RGB_Image *cursorImage;
+ private: Fl_RGB_Image *cursorImage, *handCursorImage;
public: Gui *gui;
};
Modified: code/gazebo/trunk/server/physics/Body.cc
===================================================================
--- code/gazebo/trunk/server/physics/Body.cc 2010-05-13 23:07:53 UTC (rev
8678)
+++ code/gazebo/trunk/server/physics/Body.cc 2010-05-14 17:07:03 UTC (rev
8679)
@@ -142,7 +142,6 @@
delete this->ixyP;
delete this->ixzP;
delete this->iyzP;
-
}
////////////////////////////////////////////////////////////////////////////////
Modified: code/gazebo/trunk/server/rendering/OgreAdaptor.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreAdaptor.cc 2010-05-13 23:07:53 UTC
(rev 8678)
+++ code/gazebo/trunk/server/rendering/OgreAdaptor.cc 2010-05-14 17:07:03 UTC
(rev 8679)
@@ -710,6 +710,7 @@
}
}
+ mod = "";
if (closestEntity)
{
if (closestEntity->getUserAny().getType() == typeid(std::string))
Modified: code/gazebo/trunk/server/sensors/ray/RaySensor.cc
===================================================================
--- code/gazebo/trunk/server/sensors/ray/RaySensor.cc 2010-05-13 23:07:53 UTC
(rev 8678)
+++ code/gazebo/trunk/server/sensors/ray/RaySensor.cc 2010-05-14 17:07:03 UTC
(rev 8679)
@@ -54,6 +54,8 @@
// Destructor
RaySensor::~RaySensor()
{
+ if (this->laserGeom)
+ delete this->laserGeom;
}
//////////////////////////////////////////////////////////////////////////////
Modified: code/gazebo/trunk/server/sensors/ray/RaySensor.hh
===================================================================
--- code/gazebo/trunk/server/sensors/ray/RaySensor.hh 2010-05-13 23:07:53 UTC
(rev 8678)
+++ code/gazebo/trunk/server/sensors/ray/RaySensor.hh 2010-05-14 17:07:03 UTC
(rev 8679)
@@ -131,25 +131,7 @@
/// \brief Get detected fiducial value for a ray.
public: int GetFiducial(int index);
- /*private: ParamT<Angle> *minAngleP, *maxAngleP;
- private: ParamT<double> *minRangeP, *maxRangeP, *resRangeP;
- private: ParamT<Vector3> *originP;
- */
-
private: Pose3d prevPose;
- /*private: ParamT<int> *rayCountP;
- private: ParamT<int> *rangeCountP;
-
- /// Display rays when rendering images
- private: ParamT<std::string> *displayRaysP;
-
- // For ray blocks such as Velodyne
- private: ParamT<int> *verticalRayCountP;
- private: ParamT<int> *verticalRangeCountP;
- private: ParamT<Angle> *verticalMinAngleP;
- private: ParamT<Angle> *verticalMaxAngleP;
- */
-
private: Geom *laserGeom;
private: MultiRayShape *laserShape;
};
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit