Driver Vfh

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Driver Vfh

papozze
Hello everyone
I have a problem with the driver VFH gazebo. I'm trying to configure the driver to move a VFH pioneer2in a flat space with the only obstacle of walls. I'm using VFH with laser and I have no errors to runtime but only if I'm tryng to use the goTo . If the robot not encounters obstacles, it goes in the required position, but if between the required position and the ROBOT there is an obstacle (wall), the robot going to fight against them.
I am attaching the cfg file ...

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

driver
(
  name "vfh"
  provides ["position2d:1"]
  requires ["position2d:0" "laser:0"]
  cell_size 0.1
  window_diameter 61
  sector_angle 1
  safety_dist_0ms 0.2
  safety_dist_1ms 0.4
  max_speed 0.3
  max_turnrate_0ms 75
  max_turnrate_1ms 50
  weight_desired_dir 5.0
  weight_current_dir 3.0
)

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

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

driver
(
  name "gazebo"
  provides ["fiducial:0"]
  gz_id "fiducial_iface_0"
)

the code I'm using ... ...

int main(int argc, char *argv[]){
        using namespace PlayerCc;
        PlayerClient robot("localhost",6665);//connect to proxies
        Position2dProxy p2dProxy(&robot,0);
        Position2dProxy vfh(&robot, 1);
        SimulationProxy simProxy(&robot, 0);
        LaserProxy laserProxy(&robot,0);

    double forwardSpeed, turnSpeed;
       
        p2dProxy.SetMotorEnable(1); //enable motors
        vfh.SetMotorEnable(1); //enable motors
        p2dProxy.RequestGeom(); //request geometries
        laserProxy.RequestGeom();

        printf("PROVA\n");
        printf("nGoto 5.0, 0.0\n");
        //printf("Entro in GoTo\n");
        goTo(15.0,0.0,vfh,robot);
        while(true)
        {
                robot.Read();
                sleep(1);
        }
}

and the relative world ... ..

<model:physical name="pioneer2at_model1">
   
    <xyz>0.0 0.0 0.145</xyz>
    <rpy>0.0 0.0 0.0</rpy>
    <model:physical name="laser">
     
      <xyz>0 0 0.16</xyz>
      <rpy>0.0 0.0 0.0</rpy>
      <attach>
        <parentBody>chassis_body</parentBody>
        <myBody>laser_body</myBody>
      </attach>
      <include embedded="true">
        <xi:include href="models/sicklms200.model" />
      </include>
    </model:physical>
    <include embedded="true">
      <xi:include href="models/pioneer2at.model" />
    </include>
  </model:physical>
 
If the solution is not a configuration problem, can you give me any working code that use Vfh driver?

Thank you so much