Revision: 8421
http://playerstage.svn.sourceforge.net/playerstage/?rev=8421&view=rev
Author: natepak
Date: 2009-11-19 00:39:20 +0000 (Thu, 19 Nov 2009)
Log Message:
-----------
Added include files to install
Modified Paths:
--------------
code/gazebo/trunk/examples/libgazebo/graphics3d/graphics3d.cc
code/gazebo/trunk/server/Simulator.cc
code/gazebo/trunk/server/Simulator.hh
code/gazebo/trunk/server/physics/CMakeLists.txt
code/gazebo/trunk/server/physics/ode/CMakeLists.txt
code/gazebo/trunk/server/rendering/CMakeLists.txt
Modified: code/gazebo/trunk/examples/libgazebo/graphics3d/graphics3d.cc
===================================================================
--- code/gazebo/trunk/examples/libgazebo/graphics3d/graphics3d.cc
2009-11-18 21:52:40 UTC (rev 8420)
+++ code/gazebo/trunk/examples/libgazebo/graphics3d/graphics3d.cc
2009-11-19 00:39:20 UTC (rev 8421)
@@ -10,9 +10,7 @@
// All the interfaces
gazebo::Client *client;
gazebo::SimulationIface *simIface;
-gazebo::PositionIface *posIface;
gazebo::Graphics3dIface *g3dIface;
-gazebo::Graphics3dIface *pioneerG3DIface;
// Stuff to draw the square
std::string squareName = "square";
@@ -32,66 +30,6 @@
// Stuff to draw the text
std::string textName = "velocities";
-void UpdateSquare()
-{
- gazebo::Color clr;
- gazebo::Vec3 vec[5];
-
- vec[0].x = squareSize.x;
- vec[0].y = squareSize.y;
- vec[0].z = squareSize.z;
-
- vec[1].x = -squareSize.x;
- vec[1].y = squareSize.y;
- vec[1].z = squareSize.z;
-
- vec[2].x = -squareSize.x;
- vec[2].y = -squareSize.y;
- vec[2].z = squareSize.z;
-
- vec[3].x = squareSize.x;
- vec[3].y = -squareSize.y;
- vec[3].z = squareSize.z;
-
- vec[4].x = squareSize.x;
- vec[4].y = squareSize.y;
- vec[4].z = squareSize.z;
-
- squareSize.z += dir*0.01;
- if (squareSize.z >= 0.2 || squareSize.z < 0)
- dir *= -1;
-
- clr.r = 1.0;
- clr.g = 0.0;
- clr.b = 0.0;
- clr.a = 1.0;
-
- // Draw the bouncing square
- pioneerG3DIface->DrawSimple(sphereName.c_str(),
- gazebo::Graphics3dDrawData::LINE_STRIP, vec, 5, clr);
-
-}
-
-void UpdateSphere()
-{
- gazebo::Color clr;
-
- clr.r = 1.0;
- clr.g = 0.0;
- clr.b = 0.0;
- clr.a = 1.0;
-
- spherePos.x = radius * cos(theta);
- spherePos.y = radius * sin(theta);
- spherePos.z = 0.8;
-
- pioneerG3DIface->DrawShape("mysphere",
- gazebo::Graphics3dDrawData::SPHERE, spherePos, sphereSize, clr);
-
- theta += 0.1;
-
-}
-
void UpdatePath()
{
gazebo::Pose rPos;
@@ -107,7 +45,7 @@
simIface->Lock(1);
simIface->data->requestCount = 0;
simIface->Unlock();
- simIface->GetPose2d("pioneer2dx_model1", rPos);
+ simIface->GetPose2d("pr2", rPos);
rPos.pos.z = 0.15;
@@ -150,31 +88,12 @@
}
}
-void UpdateText()
-{
- gazebo::Vec3 pos;
- char vel[50];
- float fontSize = 0.1;
- pos.x = 0;
- pos.y = 0;
- pos.z = 0.2;
-
- sprintf(vel,"Linear %4.2f Angular %4.2f",
- posIface->data->velocity.pos.x,
- posIface->data->velocity.yaw);
-
- // Draw some text on the robot
- pioneerG3DIface->DrawText(textName.c_str(), vel, pos, fontSize);
-}
-
int main()
{
client = new gazebo::Client();
simIface = new gazebo::SimulationIface();
- posIface = new gazebo::PositionIface();
g3dIface = new gazebo::Graphics3dIface();
- pioneerG3DIface = new gazebo::Graphics3dIface();
int serverId = 0;
@@ -195,8 +114,6 @@
simIface->Open(client, "default");
g3dIface->Open(client, "default");
- posIface->Open(client, "pioneer2dx_model1::position_iface_0");
- pioneerG3DIface->Open(client,"pioneer2dx_model1");
}
catch (std::string e)
{
@@ -215,13 +132,6 @@
sphereSize.y = 0.1;
sphereSize.z = 0.1;
- // Draw a billboard
- // The material used can be any of the predefined materials:
- // Gazebo/SmileyHappy, Gazebo/SmileySad, Gazebo/SmileyPlain,
- // Gazebo/SmileyDead, Gazebo/ExclamationPoint, Gazebo/QuestionMark
- pioneerG3DIface->DrawBillboard("mybillboard", "Gazebo/SmileySad",
- gazebo::Vec3(0.4,0.0,0.4), gazebo::Vec2(0.2, 0.2) );
-
gazebo::Color barClr;
barClr.r = 1.0;
barClr.g = 1.0;
@@ -234,29 +144,15 @@
// Update all the drawables
while (true)
{
- UpdateSquare();
- UpdateSphere();
UpdatePath();
- UpdateText();
- pioneerG3DIface->DrawMeterBar("mymeterbar", gazebo::Vec3(0.0, 0.0, 0.8),
- gazebo::Vec2(0.5, 0.1),barClr, percent );
-
- percent += dir * 0.01;
- if (percent >= 1.0 || percent <= 0.0)
- dir *= -1;
-
usleep(20000);
}
simIface->Close();
- posIface->Close();
- pioneerG3DIface->Close();
g3dIface->Close();
delete simIface;
- delete posIface;
- delete pioneerG3DIface;
delete g3dIface;
delete client;
return 0;
Modified: code/gazebo/trunk/server/Simulator.cc
===================================================================
--- code/gazebo/trunk/server/Simulator.cc 2009-11-18 21:52:40 UTC (rev
8420)
+++ code/gazebo/trunk/server/Simulator.cc 2009-11-19 00:39:20 UTC (rev
8421)
@@ -432,6 +432,13 @@
}
////////////////////////////////////////////////////////////////////////////////
+/// Set the sim time
+void Simulator::SetSimTime(double t)
+{
+ this->simTime = t;
+}
+
+////////////////////////////////////////////////////////////////////////////////
// Get the pause time
double Simulator::GetPauseTime() const
{
Modified: code/gazebo/trunk/server/Simulator.hh
===================================================================
--- code/gazebo/trunk/server/Simulator.hh 2009-11-18 21:52:40 UTC (rev
8420)
+++ code/gazebo/trunk/server/Simulator.hh 2009-11-19 00:39:20 UTC (rev
8421)
@@ -104,6 +104,9 @@
/// \return The simulation time
public: double GetSimTime() const;
+ /// \brief Set the sim time
+ public: void SetSimTime(double t);
+
/// Get the pause time
/// \return The pause time
public: double GetPauseTime() const;
Modified: code/gazebo/trunk/server/physics/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/physics/CMakeLists.txt 2009-11-18 21:52:40 UTC
(rev 8420)
+++ code/gazebo/trunk/server/physics/CMakeLists.txt 2009-11-19 00:39:20 UTC
(rev 8421)
@@ -53,4 +53,4 @@
add_library(gazebo_physics SHARED ${sources})
install ( TARGETS gazebo_physics DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
#APPEND_TO_SERVER_SOURCES(${sources})
-#APPEND_TO_SERVER_HEADERS(${headers})
+APPEND_TO_SERVER_HEADERS(${headers})
Modified: code/gazebo/trunk/server/physics/ode/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/physics/ode/CMakeLists.txt 2009-11-18 21:52:40 UTC
(rev 8420)
+++ code/gazebo/trunk/server/physics/ode/CMakeLists.txt 2009-11-19 00:39:20 UTC
(rev 8421)
@@ -15,6 +15,21 @@
ODEHeightmapShape.cc
)
+SET (headers ODEPhysics.hh
+ ODEGeom.hh
+ ODEBody.hh
+ ODEJoint.hh
+ ODESliderJoint.hh
+ ODEHingeJoint.hh
+ ODEHinge2Joint.hh
+ ODEUniversalJoint.hh
+ ODEBallJoint.hh
+ ODETrimeshShape.hh
+ ODERayShape.hh
+ ODEMultiRayShape.hh
+ ODEHeightmapShape.hh
+)
+
add_library(gazebo_physics_ode SHARED ${sources})
target_link_libraries( gazebo_physics_ode ${ODE_LIBRARIES})
install ( TARGETS gazebo_physics_ode DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
Modified: code/gazebo/trunk/server/rendering/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/rendering/CMakeLists.txt 2009-11-18 21:52:40 UTC
(rev 8420)
+++ code/gazebo/trunk/server/rendering/CMakeLists.txt 2009-11-19 00:39:20 UTC
(rev 8421)
@@ -44,3 +44,4 @@
add_library(gazebo_rendering SHARED ${sources})
target_link_libraries( gazebo_rendering ${OGRE_LIBRARIES})
install ( TARGETS gazebo_rendering DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
+APPEND_TO_SERVER_HEADERS(${headers})
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit