Commits

robotos  committed 8700a9c

Simple car is working now

  • Participants
  • Parent commits ead8999
  • Branches gazebo

Comments (0)

Files changed (4)

 Open:
 - Use the Contact information in the Collision Callback. See CVS version of Gazebo.
-- Add uninstall
 - Apply Linear and Angular Damping, see OGREODE sources.
 - Add check for boost
 - A static geom which is offset does not actually move the geom, so collision
 - Python scripts to models, allow dynamic (movable) meshes
 - Force sensors
 - Slider has to be the first in the XML file, when loading a bunch of joints in a model.
+- Why order on hinge and hinge2 joints matters? Should we avoid this?
 - Add note in Controller tutorial about the Controller Factory
 - Overlays in Gazebo with Mac doesn't work
 - Implement Speech interface
 - look into using FL::RUN. Using threads now
 - Add in Pioneer blender models
 - Add check for libxml2
-- Add uninstall (scons automatically handles this!)
+- Add uninstall (scons -c automatically handles this!)

File examples/libgazebo/position/SConstruct

 
 # 3rd party packages
-parseConfigs=['pkg-config --cflags --libs OGRE',
-              'xml2-config --cflags --libs', 
-      	      'ode-config --cflags --libs',
-	            'pkg-config --cflags --libs OIS',
-              'fltk-config --cflags --libs --use-gl --use-images',
-              'xft-config --cflags --libs',
-              'pkg-config --cflags --libs libgazebo',
+parseConfigs=['pkg-config --cflags --libs libgazebo',
               'pkg-config --cflags --libs libgazeboServer']
 
 
 env = Environment (
   CC = 'g++',
-
   CCFLAGS = Split ('-pthread -pipe  -W -Wall -O2'),
-
-  #LIBPATH=Split('#libgazebo'),
-    
-  #LIBS=Split('gazebo boost_python')
 )
 
-
-# Parse all the pacakge configurations
+# Parse all the package configurations
 for cfg in parseConfigs:
   env.ParseConfig(cfg)
 

File worlds/models/simplecar.model

 <?xml version="1.0"?>
 
-<!-- Generic Car Model Very experimental, not supposed to work-->
+<!-- Generic Car Model, not pretty, just an example -->
 <model:physical name="default_car_model"
   xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model" 
   xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor" 
     <mass>20</mass>
 
     <visual>
-      <xyz>-1.15 0 0.25</xyz>
-      <rpy>180 -90 90</rpy>
+      <xyz>0.1 0 0.2</xyz>
+      <rpy>180 0 0</rpy>
       <mesh>Pioneer2at/chassis.mesh</mesh>
       <material>Gazebo/Pioneer2Body</material>
 <!--  
     <mesh>RZR-002/RZR-002.mesh</mesh>
       <material>Gazebo/RZR-002/RZR-002Texture</material>
-    -->  <scale>1 1.25 1</scale>
+    -->  <scale>5 3 1</scale>
     </visual>
 
    </geom:box>
     <mass>20</mass>
     <visual>
       <mesh>Pioneer2at/tire.mesh</mesh>
+      <rpy>-90 0 0</rpy>
+      <size>0.8 0.2 0.8</size>
       <material>Gazebo/Black</material>
     </visual>
-
     <visual>
-      <xyz>0 0 0.015</xyz>
-      <size>0.048 0.048 0.09</size>
+      <mesh>Pioneer2at/wheel.mesh</mesh>
+      <rpy>-90 0 0</rpy>
+      <size>0.4 0.2 0.4</size>
+      <material>Gazebo/Gold</material>
+     </visual>
+     <visual>
+      <xyz>0 0 -0.015</xyz>
+      <size>0.8 0.8 0.1</size>
       <mesh>unit_cylinder</mesh>
       <material>Gazebo/Black</material>
-    </visual>
-  </geom:cylinder>
+     </visual>
+   </geom:cylinder>
 
 </body:cylinder>
 
   <rpy>0 90 90</rpy>
 
   <geom:cylinder name="right_rear_wheel_geom">
-   <size>0.4 0.1</size>
-   <mass>20</mass>
+    <size>0.4 0.1</size>
+    <mass>20</mass>
     <visual>
       <mesh>Pioneer2at/tire.mesh</mesh>
+      <rpy>-90 0 0</rpy>
+      <size>0.8 0.2 0.8</size>
       <material>Gazebo/Black</material>
     </visual>
     <visual>
-      <xyz>0 0 0.015</xyz>
-      <size>0.048 0.048 0.09</size>
+      <mesh>Pioneer2at/wheel.mesh</mesh>
+      <rpy>-90 0 0</rpy>
+      <size>0.4 0.2 0.4</size>
+      <material>Gazebo/Gold</material>
+     </visual>
+     <visual>
+      <xyz>0 0 -0.015</xyz>
+      <size>0.8 0.8 0.1</size>
       <mesh>unit_cylinder</mesh>
       <material>Gazebo/Black</material>
-    </visual>
+     </visual>
   </geom:cylinder>
 
 </body:cylinder>
   <xyz>1.15 0.45 0.1</xyz>
   <rpy>0 90 90</rpy>
   <geom:cylinder name="left_front_wheel_geom">
-   <size>0.4 0.1</size>
-   <mass>20</mass>
+    <size>0.4 0.1</size>
+    <mass>20</mass>
     <visual>
       <mesh>Pioneer2at/tire.mesh</mesh>
+      <rpy>-90 0 0</rpy>
+      <size>0.8 0.2 0.8</size>
       <material>Gazebo/Black</material>
     </visual>
-
     <visual>
       <mesh>Pioneer2at/wheel.mesh</mesh>
+      <rpy>-90 0 0</rpy>
+      <size>0.4 0.2 0.4</size>
       <material>Gazebo/Gold</material>
-    </visual>
-    <visual>
-      <mesh>Pioneer2at/hub.mesh</mesh>
-      <material>Gazebo/Black</material>
-    </visual>
-
-    <visual>
+     </visual>
+     <visual>
       <xyz>0 0 -0.015</xyz>
-      <size>0.048 0.048 0.09</size>
+      <size>0.8 0.8 0.1</size>
       <mesh>unit_cylinder</mesh>
       <material>Gazebo/Black</material>
-    </visual>
-  </geom:cylinder>
+     </visual>
+ </geom:cylinder>
 
 </body:cylinder>
 
       <size>0.8 0.2 0.8</size>
       <material>Gazebo/Black</material>
     </visual>
-<!--    <visual>
-      <mesh>Pioneer2at/hub.mesh</mesh>
-      <rpy>-90 0 0</rpy>
-      <size>0.8 0.2 0.8</size>
-      <material>Gazebo/Black</material>
-    </visual>
--->    <visual>
+    <visual>
       <mesh>Pioneer2at/wheel.mesh</mesh>
       <rpy>-90 0 0</rpy>
-      <size>0.4 0.12 0.4</size>
+      <size>0.4 0.2 0.4</size>
       <material>Gazebo/Gold</material>
-    </visual>
-    <visual>
+     </visual>
+     <visual>
       <xyz>0 0 -0.015</xyz>
       <size>0.8 0.8 0.1</size>
       <mesh>unit_cylinder</mesh>
       <material>Gazebo/Black</material>
-    </visual>
+     </visual>
   </geom:cylinder>
 
 </body:cylinder>
 
 <joint:hinge2 name="left_front_wheel_hinge">
-  <body1>left_front_wheel</body1>
-  <body2>chassis_body</body2>
+  <body1>chassis_body</body1>
+  <body2>left_front_wheel</body2>
   <anchor>left_front_wheel</anchor>
   <anchorOffset>0 0.05 0</anchorOffset>
   <axis1>0 0 1</axis1>
 </joint:hinge2>
 
 <joint:hinge name="left_rear_wheel_hinge">
+  <body2>chassis_body</body2>
   <body1>left_rear_wheel</body1>
-  <body2>chassis_body</body2>
   <anchor>left_rear_wheel</anchor>
   <anchorOffset>0 0.05 0</anchorOffset>
   <axis>0 1 0</axis>
 
 
 <joint:hinge2 name="right_front_wheel_hinge">
-  <body1>right_front_wheel</body1>
-  <body2>chassis_body</body2>
+  <body1>chassis_body</body1>
+  <body2>right_front_wheel</body2>
   <anchor>right_front_wheel</anchor>
   <anchorOffset>0 -0.05 0</anchorOffset>
   <axis1>0 0 1</axis1>
 </joint:hinge2>
 
 <joint:hinge name="right_rear_wheel_hinge">
+  <body2>chassis_body</body2>
   <body1>right_rear_wheel</body1>
-  <body2>chassis_body</body2>
   <anchor>right_rear_wheel</anchor>
   <anchorOffset>0 -0.05 0</anchorOffset>
   <axis>0 1 0</axis>

File worlds/simplecar.world

     <sky>
       <material>Gazebo/CloudySky</material>
     </sky>
-
-    <!--<fog>
-      <color>0.9 0.9 0.9</color>
-      <linearStart>50</linearStart>
-      <linearEnd>100</linearEnd>
-    </fog>
-    -->
-  </rendering:ogre>
+    </rendering:ogre>
 
    <!-- Ground Plane -->
   <model:physical name="plane1_model">
         <hfov>60</hfov>
         <nearClip>0.1</nearClip>
         <farClip>100</farClip>
-
-        <!--<saveFrames>true</saveFrames>
-        <saveFramePath>frames</saveFramePath>
-        -->
       </sensor:camera>
     </body:empty>
   </model:physical>
 
-  <!-- 
-  Include the complete model described in the .model file
-  This assumes the root node is a <model:...>
-  -->
-  <!--  <include embedded="false">
-    <xi:include href="pioneer2dx.model" />
-  </include>
-  -->
-
   <model:physical name="simpleCar_model">
     <xyz>0 0 0.145</xyz>
     <rpy>0.0 0.0 0.0</rpy>
     <interface:position name="position_iface_0"/>
   </controller:steering_position2d>
 
-<!--
-    <controller:steer2_position2d name="controller1">
-      <leftJoint>left_front_wheel_hinge</leftJoint>
-      <rightJoint>right_front_wheel_hinge</rightJoint>
-      <wheelSeparation>0.34</wheelSeparation>
-      <wheelDiameter>0.15</wheelDiameter>
-      <torque>100</torque>
-      <steerMaxAngle>50</steerMaxAngle>
-      <interface:position name="position_iface_0" share="master"/>
-    </controller:steer2_position2d>
- 
-    <controller:drive2_position2d name="controller2">
-      <leftJoint>left_rear_wheel_hinge</leftJoint>
-      <rightJoint>right_rear_wheel_hinge</rightJoint>
-      <torque>1000</torque>
-      <interface:position name="position_iface_0" share="slave"/>
-    </controller:drive2_position2d>
-    -->
-
-    <!--<model:physical name="laser">
-      <xyz>0 0 0.16</xyz>
-
-      <attach>
-        <parentBody>chassis_body</parentBody>
-        <myBody>laser_body</myBody>
-      </attach>
-
-      <include embedded="true">
-        <xi:include href="laser.model" />
-      </include>
-    </model:physical>
-    -->
-
-
     <!-- 
     The include should be last within a model. All previous statements
     will override those in the included file