I tried the program both with the negate 1 line and without, checking the
results by printing out the values stored in map->cells. It was actually
with negate 1 that the map appeared correct, and wavefront failed to find a
path in both cases.
Peter Alley
Sebastian Rockel wrote:
>
> Hi,
>
> Am 05.05.2011 um 22:36 schrieb Peter Alley:
>
>> Greetings,
>> I am attempting to use the wavefront driver to generate a path. Whenever
>> I try, however, I receive the following message:
>>
>> new goal: 1.000000, 3.000000, 0.000000
>> Wavefront: global plan failed
>> Wavefront (port 6666):
>> No path from (0.000,3.000,0.000) to (1.000,3.000,0.000)
>>
>> However there very much is a path (drive straight forward for 1 meter).
>> I have no idea why it cannot find this path, so I'm including all the
>> files involved for perusal.
>>
>> Primary config file that I run
>> #smod.cfg
>> #based off simple.cfg
>>
>> # load the Stage plugin simulation driver
>> driver
>> (
>> name "stage"
>> provides [ "simulation:0" ]
>> plugin "stageplugin"
>>
>> # load the named file into the simulator
>> worldfile "smod.world"
>> )
>>
>> # Create a Stage driver and attach position2d and laser interfaces
>> # to the model "r0"
>> driver
>> (
>> name "stage"
>> provides [ "position2d:0" "ranger:0" "ranger:1" ]
>> model "r0"
>> )
>>
>>
>> driver
>> (
>> name "stage"
>> # provides [ "position2d:1" "ranger:2" ]
>> provides [ "position2d:1" "ranger:2" "ranger:3"]
>> model "myrobot"
>> )
>>
>> driver
>> (
>> name "mapfile"
>> provides ["map:0"]
>> filename "bitmaps/cave.png"
>> resolution 0.05
>> negate 1
>
> I guess you should not use this here. The cave.png has thin walls in black
> that will be recognized by wavefront as occupied (in contrast to not
> occupied) space. When you negate the map it will turn free to occupied
> space (then almost the whole map) and therefore the wavefront planner
> cannot find a valid path.
>
> Regards,
> Sebastian
>
>> )
>>
>> config file for running wavefront in another instance of player (causes
>> segfaults if run in the first instance)
>>
>> #wavefront.cfg
>> driver
>> (
>> name "wavefront"
>> provides ["6666:planner:0"]
>> requires ["output:::position2d:1" "input:::position2d:1" "map:0"]
>> safety_dist 0.1
>> distance_epsilon 0.1
>> )
>>
>> my world file is a renamed version of simple.world with the following
>> appended to the end
>> pioneer2dx
>> (
>> name "myrobot"
>> color "green"
>> pose [ 0 3 0 0 ]
>> sicklaser()
>> )
>>
>> And my code. This is the entire program that I'm running. It creates
>> and subscribes to all the various things, loads the map, and attempts to
>> run wavefront. No path can be found by wavefront, though the path
>> exists.
>>
>> /*
>> * wavefronttest.c
>> *
>> * Created on: May 5, 2011
>> * Author: alleypj
>> */
>>
>>
>> #include <stdio.h>
>> #include <libplayerc/playerc.h>
>>
>> int main(void) {
>>
>> playerc_client_t *robot;
>> playerc_client_t *plannerclient;
>> playerc_position2d_t *pos;
>> playerc_ranger_t *ranger;
>> playerc_map_t *map;
>> playerc_planner_t *planner;
>>
>> //create and connect to robot
>> robot = playerc_client_create(NULL, "localhost", 6665);
>> if(0 != playerc_client_connect(robot)) return -1;
>> printf("Connected");
>> //create and subscribe to position
>> pos = playerc_position2d_create(robot, 1);
>> if (playerc_position2d_subscribe(pos, PLAYERC_OPEN_MODE)) return -1;
>> printf("position subscribed\r\n");
>> //create and subscribe to laser
>> ranger = playerc_ranger_create(robot, 3);
>> if (playerc_ranger_subscribe(ranger, PLAYER_OPEN_MODE)) return -1;
>> printf("ranger subscribed\r\n");
>> //create and subscribe to map
>> map = playerc_map_create(robot, 0);
>> if(playerc_map_subscribe(map, PLAYER_OPEN_MODE)) return -1;
>> printf("map subscribed\r\n");
>> //create and subscribe to planner
>>
>> plannerclient = playerc_client_create(NULL, "localhost", 6666);
>> if(0 != playerc_client_connect(plannerclient)) return -1;
>> planner = playerc_planner_create(plannerclient, 0);
>> if(playerc_planner_subscribe(planner, PLAYER_OPEN_MODE)) return -1;
>> printf("planner subscribed\r\n");
>>
>> //load map from file
>> playerc_map_get_map(map);
>> printf("%f %d %d\r\n",map->resolution,map->width,map->height);
>>
>> sleep(5);
>> //run wavefront
>> playerc_planner_set_cmd_pose(planner, 1.0, 3.0, 0.0);
>> playerc_planner_get_waypoints(planner);
>> //print waypoints
>> int i;
>> for(i=0; i<planner->waypoint_count; i++) {
>> printf("%f %f
>> %f",planner->waypoints[i][0],planner->waypoints[i][1],planner->waypoints[i][2]);
>> }
>> sleep(5);
>>
>> playerc_planner_unsubscribe(planner);
>> playerc_planner_destroy(planner);
>> playerc_map_unsubscribe(map);
>> playerc_map_destroy(map);
>> playerc_ranger_unsubscribe(ranger);
>> playerc_ranger_destroy(ranger);
>> playerc_position2d_unsubscribe(pos);
>> playerc_position2d_destroy(pos);
>> playerc_client_disconnect(robot);
>> playerc_client_destroy(robot);
>> return 0;
>> }
>>
>> As a final thought, I'm still fairly new to player/stage, so if you see
>> something odd don't assume I knew what I was doing when I did it. All
>> help is much appreciated.
>>
>> Peter Alley
>> ------------------------------------------------------------------------------
>> WhatsUp Gold - Download Free Network Management Software
>> The most intuitive, comprehensive, and cost-effective network
>> management toolset available today. Delivers lowest initial
>> acquisition cost and overall TCO of any competing solution.
>> http://p.sf.net/sfu/whatsupgold-sd_______________________________________________
>> Playerstage-users mailing list
>> Playerstage-users@...
>> https://lists.sourceforge.net/lists/listinfo/playerstage-users
>
>
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today. Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Playerstage-users mailing list
> Playerstage-users@...
> https://lists.sourceforge.net/lists/listinfo/playerstage-users
>
>
--
View this message in context: http://old.nabble.com/Wavefront%3A-global-plan-failed-issue-tp31553992p31559149.html
Sent from the playerstage-users mailing list archive at Nabble.com.
|