Quantcast

VFH Not Working

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

VFH Not Working

Victor
I'm having problems with the vfh driver. I have a simple config file like this:


# load the Stage plugin simulation driver
driver
(
  name "stage"
  provides ["simulation:0"]
  plugin "stageplugin"

  # load the named file into the simulator
  worldfile "simple.world"
)

driver
(
  name "stage"
  provides ["6665:position2d:0" "6665:laser:0"]
  model "robot1"

  #alwayson 1
)

driver
(
  name "vfh"
  provides ["position2d:1"]
  requires ["position2d:0" "laser:0"]
  safety_dist 0.10
  distance_epsilon 0.3
  angle_epsilon 5
  max_speed 0.3
  max_turnrate_0ms 90
  max_turnrate_1ms 35
)

and I have the following C++ code for moving the robot:

#include <libplayerc++/playerc++.h>
#include <iostream>

int main(int argc, char *argv[]){
    using namespace PlayerCc;
    PlayerClient robot("localhost",6665);
    Position2dProxy vfh(&robot, 1);
    vfh.GoTo(5,3,30);

    for(;;);
    return 0;
}

However, the robot doesn't reach the position (5,3) and it also collides with obstacles (walls). How can I move a robot to a particular position while avoiding obstacles? Please help!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VFH Not Working

Victor
never mind, it's a stupid mistake. The laser attached to the robot is higher than the obstacles. Another question though, when I use the goto command, what exactly are the parameters?

What should vfh.GoTo(5,3,30) do exactly?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VFH Not Working

Victor
ok solved my own question again...

For some reason the localization was way off. I had to add this:

    localization "gps"
    localization_origin [0 0 0]

to the pioneer.inc's "define pioneer2dx position" function
Loading...