Revision: 8910
http://playerstage.svn.sourceforge.net/playerstage/?rev=8910&view=rev
Author: hsujohnhsu
Date: 2010-09-17 03:56:12 +0000 (Fri, 17 Sep 2010)
Log Message:
-----------
adjustable contact marker size, TODO: make accessors rather than public member
Modified Paths:
--------------
code/gazebo/branches/wg/server/World.cc
code/gazebo/branches/wg/server/World.hh
code/gazebo/branches/wg/server/gui/GLWindow.cc
code/gazebo/branches/wg/server/physics/PhysicsEngine.cc
code/gazebo/branches/wg/worlds/simpleshapes.world
Modified: code/gazebo/branches/wg/server/World.cc
===================================================================
--- code/gazebo/branches/wg/server/World.cc 2010-09-16 20:40:39 UTC (rev
8909)
+++ code/gazebo/branches/wg/server/World.cc 2010-09-17 03:56:12 UTC (rev
8910)
@@ -61,6 +61,7 @@
this->showBoundingBoxes = false;
this->showJoints = false;
this->showContacts = false;
+ this->contactMarkerSize = 0.003;
this->showLights = false;
this->showCameras = false;
this->wireframe = false;
Modified: code/gazebo/branches/wg/server/World.hh
===================================================================
--- code/gazebo/branches/wg/server/World.hh 2010-09-16 20:40:39 UTC (rev
8909)
+++ code/gazebo/branches/wg/server/World.hh 2010-09-17 03:56:12 UTC (rev
8910)
@@ -419,6 +419,7 @@
/// The entity currently selected by the user
private: Entity *selectedEntity;
+ public: double contactMarkerSize;
private: boost::signal<void (Entity*)> addEntitySignal;
private: boost::signal<void (std::string)> deleteEntitySignal;
Modified: code/gazebo/branches/wg/server/gui/GLWindow.cc
===================================================================
--- code/gazebo/branches/wg/server/gui/GLWindow.cc 2010-09-16 20:40:39 UTC
(rev 8909)
+++ code/gazebo/branches/wg/server/gui/GLWindow.cc 2010-09-17 03:56:12 UTC
(rev 8910)
@@ -381,6 +381,15 @@
case '_':
this->mouseEvent.moveScale *= 0.5;
break;
+
+ case 'n':
+ World::Instance()->contactMarkerSize*=1.1;
+ break;
+
+ case 'm':
+ World::Instance()->contactMarkerSize*=0.9;
+ break;
+
default:
break;
}
Modified: code/gazebo/branches/wg/server/physics/PhysicsEngine.cc
===================================================================
--- code/gazebo/branches/wg/server/physics/PhysicsEngine.cc 2010-09-16
20:40:39 UTC (rev 8909)
+++ code/gazebo/branches/wg/server/physics/PhysicsEngine.cc 2010-09-17
03:56:12 UTC (rev 8910)
@@ -196,29 +196,31 @@
if (!World::Instance()->GetShowContacts())
return;
+ double cm_size = World::Instance()->contactMarkerSize;
+
Vector3 e1 = norm.GetPerpendicular(); e1.Normalize();
Vector3 e2 = norm.GetCrossProd(e1); e2.Normalize();
(*this->contactLinesIter)->SetPoint( 0, pos);
- (*this->contactLinesIter)->SetPoint( 1, pos+(norm*0.2)+(e1*0.05)+(e2*0.05));
+ (*this->contactLinesIter)->SetPoint( 1,
pos+(norm*cm_size)+(e1*cm_size*0.25)+(e2*cm_size*0.25));
(*this->contactLinesIter)->SetPoint( 2, pos);
- (*this->contactLinesIter)->SetPoint( 3, pos+(norm*0.2)+(e1*0.05)-(e2*0.05));
+ (*this->contactLinesIter)->SetPoint( 3,
pos+(norm*cm_size)+(e1*cm_size*0.25)-(e2*cm_size*0.25));
(*this->contactLinesIter)->SetPoint( 4, pos);
- (*this->contactLinesIter)->SetPoint( 5, pos+(norm*0.2)-(e1*0.05)+(e2*0.05));
+ (*this->contactLinesIter)->SetPoint( 5,
pos+(norm*cm_size)-(e1*cm_size*0.25)+(e2*cm_size*0.25));
(*this->contactLinesIter)->SetPoint( 6, pos);
- (*this->contactLinesIter)->SetPoint( 7, pos+(norm*0.2)-(e1*0.05)-(e2*0.05));
+ (*this->contactLinesIter)->SetPoint( 7,
pos+(norm*cm_size)-(e1*cm_size*0.25)-(e2*cm_size*0.25));
- (*this->contactLinesIter)->SetPoint( 8, pos+(norm*0.2)+(e1*0.05)+(e2*0.05));
- (*this->contactLinesIter)->SetPoint( 9, pos+(norm*0.2)-(e1*0.05)+(e2*0.05));
+ (*this->contactLinesIter)->SetPoint( 8,
pos+(norm*cm_size)+(e1*cm_size*0.25)+(e2*cm_size*0.25));
+ (*this->contactLinesIter)->SetPoint( 9,
pos+(norm*cm_size)-(e1*cm_size*0.25)+(e2*cm_size*0.25));
- (*this->contactLinesIter)->SetPoint(10, pos+(norm*0.2)-(e1*0.05)+(e2*0.05));
- (*this->contactLinesIter)->SetPoint(11, pos+(norm*0.2)-(e1*0.05)-(e2*0.05));
+ (*this->contactLinesIter)->SetPoint(10,
pos+(norm*cm_size)-(e1*cm_size*0.25)+(e2*cm_size*0.25));
+ (*this->contactLinesIter)->SetPoint(11,
pos+(norm*cm_size)-(e1*cm_size*0.25)-(e2*cm_size*0.25));
- (*this->contactLinesIter)->SetPoint(12, pos+(norm*0.2)-(e1*0.05)-(e2*0.05));
- (*this->contactLinesIter)->SetPoint(13, pos+(norm*0.2)+(e1*0.05)-(e2*0.05));
+ (*this->contactLinesIter)->SetPoint(12,
pos+(norm*cm_size)-(e1*cm_size*0.25)-(e2*cm_size*0.25));
+ (*this->contactLinesIter)->SetPoint(13,
pos+(norm*cm_size)+(e1*cm_size*0.25)-(e2*cm_size*0.25));
- (*this->contactLinesIter)->SetPoint(14, pos+(norm*0.2)+(e1*0.05)-(e2*0.05));
- (*this->contactLinesIter)->SetPoint(15, pos+(norm*0.2)+(e1*0.05)+(e2*0.05));
+ (*this->contactLinesIter)->SetPoint(14,
pos+(norm*cm_size)+(e1*cm_size*0.25)-(e2*cm_size*0.25));
+ (*this->contactLinesIter)->SetPoint(15,
pos+(norm*cm_size)+(e1*cm_size*0.25)+(e2*cm_size*0.25));
this->contactLinesIter++;
Modified: code/gazebo/branches/wg/worlds/simpleshapes.world
===================================================================
--- code/gazebo/branches/wg/worlds/simpleshapes.world 2010-09-16 20:40:39 UTC
(rev 8909)
+++ code/gazebo/branches/wg/worlds/simpleshapes.world 2010-09-17 03:56:12 UTC
(rev 8910)
@@ -14,12 +14,11 @@
<verbosity>5</verbosity>
- <physics:ode>
+ <physics:bullet>
<stepTime>0.001</stepTime>
<gravity>0 0 -9.8</gravity>
<cfm>10e-10</cfm>
<erp>0.2</erp>
- <stepType>quick</stepType>
<stepIters>50</stepIters>
<stepW>1.3</stepW>
<contactMaxCorrectingVel>100.0</contactMaxCorrectingVel>
@@ -29,7 +28,7 @@
0 == No throttling
>0 == Frequency at which to throttle the sim -->
<updateRate>0</updateRate>
- </physics:ode>
+ </physics:bullet>
<rendering:gui>
<type>fltk</type>
@@ -47,9 +46,9 @@
</rendering:ogre>
<model:physical name="sphere1_model">
- <xyz>0 0 0.2</xyz>
+ <xyz>0 0 1.2</xyz>
<rpy>0 0.0 0.0</rpy>
- <static>true</static>
+ <static>false</static>
<body:sphere name="sphere1_body">
<geom:sphere name="sphere1_geom">
@@ -60,7 +59,7 @@
<visual>
<size>0.4 0.4 0.4</size>
- <mesh>unit_box</mesh>
+ <mesh>unit_sphere</mesh>
<shader>pixel</shader>
<material>Gazebo/Rocky</material>
</visual>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit