Hello.

I am a student working with a Pioneer P3-DX.  I have a working simulation
using player and stage.  After moving the robot using the program below,
the robot gives a valid reading of GetXPos() in the same program.However,
when this program is exited and another program queries GetXPos(), the
result is always zero with P3-DX. However, the simulation with stage works
fine. Kindly Help.
--------------------------------------------------------------------------------------------------------------------------------
#include <iostream>
#include<stdio.h>
#include<stdlib.h>
#include <libplayerc++/playerc++.h>

int
main(int argc, char *argv[])
{
  using namespace PlayerCc;

  PlayerClient    robot("localhost");
  Position2dProxy pp(&robot,1/*PLAYER_OPEN_MODE*/);
  float x=atof(argv[1]),y=atof(argv[2]),a=atof(argv[3]);
  robot.StartThread();
robot.Read();
pp.RequestGeom();
std::cout<<"X y t"<<pp.GetXPos()<<" "<<pp.GetYPos()<<" "<<pp.GetYaw();
pp.SetOdometry(x,y,a);
robot.StopThread();

}
-----------------------------------------------------------------------------------------------------------------------------------

my config file:

driver
(
  name "p2os"
  provides ["odometry:::position2d:0" "sonar:0"]
  port "/dev/ttyUSB0"
)

driver
(
  name "sicklms200"
  provides ["laser:0" ]
  port "/dev/ttyUSB1"
  resolution 50
  serial_high_speed_mode 1
  serial_high_speed_baudremap 230400
  transfer_rate 38400
  connect_rate [9600 500000 38400]
  retry 2
  alwayson 1
)

driver
(
  name "vfh"
  provides ["6665:position2d:1"]
  requires ["odometry::6665:position2d:0" "6665:laser:0" ]
  safety_distance 0.1
)

-----------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo

Reply via email to