Hi

        I am running gazebo and player with the attached files.
The display window shows that the robot moves certain distance and stops.But the robot's pose is getting updated (as i can understand from the values printed).

In fact I didn't understand the use of "set_cmd_vel" function properly.


Can anybody help me out of this please  ????

Waiting for your replies


--
*************************************************************
K.HEMANTH
COMPUTER SCIENCE AND ENGINEERING(DUAL DEGREE)
ROLL.NO# 200402017
ROOM.NO# 399(OBH)
CONTACT NO# 9849229262
IIIT--HYDERABAD.

EMAIL:
        [EMAIL PROTECTED]
        [EMAIL PROTECTED]
        [EMAIL PROTECTED]
**************************************************************
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

# Desc: Player sample configuration file for controlling Gazebo devices
# Date: 18 Apr 2003
# CVS: $Id: gazebo.cfg,v 1.10 2005/04/15 18:08:24 gerkey Exp $

driver
(
  name "gazebo"
  provides ["simulation:0"]
  plugin "libgazeboplugin"
  server_id "default"
  alwayson 1
)

driver
(
  name "gazebo"
  provides ["position2d:0"]
  gz_id "robot1"
)

driver
(
  name "gazebo"
  provides ["laser:0"]
  gz_id "laser1"
)

#driver
#(
#  name "gz_stereo"
#  provides ["left_disparity::camera:1"]
#  gz_id "stereo1"
#)
<?xml version="1.0"?>
<gz:world xmlns:gz="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"; 
xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"; 
xmlns:window="http://playerstage.sourceforge.net/gazebo/xmlschema/#window"; 
xmlns:param="http://playerstage.sourceforge.net/gazebo/xmlschema/#param";>

  <param:Global>
    <fogDensity>0.025</fogDensity>
  </param:Global>

  <model:LightSource>
    <id>light0</id>
    <xyz>-5.000 -5.000 10.000</xyz>
  </model:LightSource>

  <model:ObserverCam>
    <id>userCam0</id>
    <xyz>10 0 20</xyz>
    <rpy>0 90 0</rpy>
    <imageSize>1024 700</imageSize>
  </model:ObserverCam>

  <model:GroundPlane>
    <id>ground1</id>
    <color>0.5 0.5 0.5</color>
    <textureFile>grid.ppm</textureFile>
  </model:GroundPlane>

  <model:Pioneer2AT>
    <id>robot1</id>
    <xyz>-0.000 -0.000 -0.00</xyz>
    <model:SickLMS200>
      <id>laser1</id>
      <xyz>0 0 1.8</xyz>
      <rangeCount>181</rangeCount>
      <scanRate>10</scanRate>
    </model:SickLMS200>
  </model:Pioneer2AT>

</gz:world>
#!/usr/bin/env python

import math
from playerc import *

# Create a client object
c = playerc_client(None, 'localhost', 6665)
# Connect it
if c.connect() != 0:
  raise playerc_error_str()

# Create a proxy for position2d:0
p = playerc_position2d(c,0)
if p.subscribe(PLAYERC_OPEN_MODE) != 0:
  raise playerc_error_str()

# Retrieve the geometry
if p.get_geom() != 0:
  raise playerc_error_str()
print 'Robot size: (%.3f,%.3f)' % (p.size[0], p.size[1])

# Create a proxy for laser:0
l = playerc_laser(c,0)
if l.subscribe(PLAYERC_OPEN_MODE) != 0:
  raise playerc_error_str()

# Retrieve the geometry
if l.get_geom() != 0:
  raise playerc_error_str()
print 'Laser pose: (%.3f,%.3f,%.3f)' % (l.pose[0],l.pose[1],l.pose[2])

# Start the robot turning CCW at 20 deg / sec
p.enable(0)
p.set_cmd_vel(10.0, 5.0, 20.0 * math.pi / 180.0, 1)

for i in range(0,60):
  if c.read() == None:
    raise playerc_error_str()

  print 'Robot pose: (%.3f,%.3f,%.3f)' % (p.px,p.py,p.pa)
  laserscanstr = 'Partial laser scan: '
  for j in range(0,5):
    if j >= l.scan_count:
      break
    laserscanstr += '%.3f ' % l.ranges[j]
  print laserscanstr


# Now turn the other way
"""print "Now turn the other way"

p.set_cmd_vel(0.0, 0.0, -20.0 * math.pi / 180.0, 1)

for i in range(0,30):
  if c.read() == None:
    raise playerc_error_str()

  print 'Robot pose: (%.3f,%.3f,%.3f)' % (p.px,p.py,p.pa)
  laserscanstr = 'Partial laser scan: '
  for j in range(0,5):
    if j >= l.scan_count:
      break
    laserscanstr += '%.3f ' % l.ranges[j]
  print laserscanstr

# Now stop
p.set_cmd_vel(0.0, 0.0, 0.0, 1)"""

# Clean up
p.unsubscribe()
l.unsubscribe()
c.disconnect()
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo

Reply via email to