|
From: Salvatore F. <ei...@gm...> - 2011-09-07 01:36:45
|
first, i apologize in advance for the length of my mail
I went to MapInterface.java, and made the following changes:
if (unzDataCount != cellsCount)
logger.log (Level.WARNING,
"Uncompressed data size doesn't match cells number: " + unzDataCount + " != " + cellsCount);
//logger.log (Level.WARNING,
// "Uncompressed data size doesn't match cells number");
}
else
{
// Read uncompressed data
if (dataCount != cellsCount)
logger.log (Level.WARNING,
"Data count doesn't match cells number: " + dataCount + " != " + cellsCount);
//logger.log (Level.WARNING,
// "Uncompressed data size doesn't match cells number");
is.readFully(outBuffer, 0, dataCount);
}
Basically, in the navigation part in my code, i have the robot just wander, until i give it a point, and then i expect it to go there.
For the moment, when it gets there, it has to stay a bit, and then start wandering again.
The most functional version of the code i use for this (position/localization interfaces are already available from the wandering phase, which is in the same class), was so far the following :
System.out.println("Robot " + myAgent.getName()
+ " New Goal : (" + point.getPx() + "," + point.getPy()
+ "," + point.getPa() + ")");
planner.getDeviceAccess();
planner.setGoal(point);
planner.getWaypoints();
map.getDeviceAccess();
map.requestMapInformation();
System.out.println("Robot " + myAgent.getName() + " map.isDataReady() "
+ map.isDataReady());
map.requestMapInformation();
map.readMapInfo();
while (map.isDataReady() == false) {
try {
map.requestMapInformation();
Thread.sleep(20);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
mapInfo = map.getData();
System.out.println("Robot " + myAgent.getName() + " MapInfo = " + mapInfo.toString());
System.out.println("Robot " + myAgent.getName() + " Map data ready!");
// Request map description and wait until it is ready
PlayerMapData pmd = new PlayerMapData();
pmd.setWidth(mapInfo.getWidth());
pmd.setHeight(mapInfo.getHeight());
pmd.setRow(0);
pmd.setCol(0);
System.out.println("Robot " + myAgent.getName() + " pmd.toString()" + pmd.toString());
map.requestMapData(pmd);
if ((loc != null) && (loc.isDataReady() == true)) {
pld = loc.getData();
hypoths = pld.getHypoths();
if ((pld.getHypoths_count() == 1)
&& (hypoths[0].getAlpha() > 0.98))
posi.setOdometry(hypoths[0].getMean());
}
if (planner.isReadyWaypointData()) {
PlayerPlannerWaypointsReq ppwd = planner.getWaypointData();
System.out.println("Robot " + myAgent.getName() + " PlayerPlannerWaypointsReq = " + ppwd.toString());
wPoints = ppwd.getWaypoints();
System.out.println("Robot " + myAgent.getName() + " wPoints = " + wPoints.toString());
}
// Verify recent planner data to decide the navigation status
if (planner.isDataReady()) {
PlayerPlannerData ppd = planner.getData();
System.out.println("Robot " + myAgent.getName() + " PlayerPlannerData = " + ppd.toString());
if (ppd.getValid() == 0) {
System.out.println("Robot " + myAgent.getName()
+ " Not a valid path");
System.out.println("Robot " + myAgent.getName()
+ " Current Position : ("
+ presentPose.getPx() + ","
+ presentPose.getPy() + ","
+ presentPose.getPa());
wPoints = null;
}
// Check if goal is achieved
else if (ppd.getDone() == 1) {
eventReceived = false;
posi.setSpeed(0, 0);
System.out.println("Robot " + myAgent.getName()
+ " Done!");
System.out.println("Robot " + myAgent.getName()
+ " Current Position : (" + presentPose.getPx()
+ "," + presentPose.getPy() + ","
+ presentPose.getPa() + ")");
point = null;
wPoints = null;
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
posi.setSpeed(DEF_X_SPEED, 0);
} else {
System.out.println("Robot " + myAgent.getName()
+ " Still on path");
planner.getWaypoints();
}
}
The best i got so far was the following:
Robot Navigation1@testPlatform MapInfo = javaclient3.structures.map.PlayerMapInfo@1122fc6
Robot Navigation1@testPlatform Map data ready!
Robot Navigation1@testPlatform pmd.toString()javaclient3.structures.map.PlayerMapData@ed088a
Robot Navigation1@testPlatform PlayerPlannerData = javaclient3.structures.planner.PlayerPlannerData@17380d3
Robot Navigation1@testPlatform Still on path
Sep 04, 2011 3:09:16 PM javaclient3.MapInterface handleResponse
WARNING: Data count doesn't match cells number: 2431 != 250000
Sep 04, 2011 3:09:16 PM javaclient3.MapInterface handleResponse
INFO: Map decompress: 250000 bytes
Robot Navigation1@testPlatform New Goal : (-2.34,-3.43,1.3)
Robot Navigation1@testPlatform map.isDataReady() true
Robot Navigation1@testPlatform MapInfo = javaclient3.structures.map.PlayerMapInfo@1baeeb0
Robot Navigation1@testPlatform Map data ready!
Robot Navigation1@testPlatform pmd.toString()javaclient3.structures.map.PlayerMapData@18c7d4b
Robot Navigation1@testPlatform PlayerPlannerWaypointsReq = javaclient3.structures.planner.PlayerPlannerWaypointsReq@13b0eef
Robot Navigation1@testPlatform wPoints = [Ljavaclient3.structures.PlayerPose2d;@517df4
Sep 04, 2011 3:09:18 PM javaclient3.MapInterface handleResponse
WARNING: Data count doesn't match cells number: 2431 != 250000
Robot Navigation1@testPlatform PlayerPlannerData = javaclient3.structures.planner.PlayerPlannerData@10d3719
Robot Navigation1@testPlatform Still on path
Sep 04, 2011 3:09:18 PM javaclient3.MapInterface handleResponse
INFO: Map decompress: 250000 bytes
Robot Navigation1@testPlatform New Goal : (-2.34,-3.43,1.3)
Robot Navigation1@testPlatform map.isDataReady() true
Robot Navigation1@testPlatform MapInfo = javaclient3.structures.map.PlayerMapInfo@15827c4
Robot Navigation1@testPlatform Map data ready!
Robot Navigation1@testPlatform pmd.toString()javaclient3.structures.map.PlayerMapData@9ad559
Sep 04, 2011 3:09:23 PM javaclient3.MapInterface handleResponse
WARNING: Data count doesn't match cells number: 2431 != 250000
Robot Navigation1@testPlatform PlayerPlannerData = javaclient3.structures.planner.PlayerPlannerData@f540da
Robot Navigation1@testPlatform Still on path
Sep 04, 2011 3:09:23 PM javaclient3.MapInterface handleResponse
INFO: Map decompress: 250000 bytes
Robot Navigation1@testPlatform New Goal : (-2.34,-3.43,1.3)
Robot Navigation1@testPlatform map.isDataReady() false
Robot Navigation1@testPlatform MapInfo = javaclient3.structures.map.PlayerMapInfo@1eb305e
Robot Navigation1@testPlatform Map data ready!
Robot Navigation1@testPlatform pmd.toString()javaclient3.structures.map.PlayerMapData@1b48906
Robot Navigation1@testPlatform PlayerPlannerData = javaclient3.structures.planner.PlayerPlannerData@1d0a86a
Robot Navigation1@testPlatform Done!
Robot Navigation1@testPlatform Current Position : (-2.53,-3.41,1.22)
Sep 04, 2011 3:09:28 PM javaclient3.MapInterface handleResponse
WARNING: Data count doesn't match cells number: 2431 != 250000
Sep 04, 2011 3:09:28 PM javaclient3.MapInterface handleResponse
INFO: Map decompress: 250000 bytes
at some point i also got something like :
pmd.toString()javaclient3.structures.map.PlayerMapData@1ec2b37
Robot Navigation1@testPlatform PlayerPlannerData = javaclient3.structures.planner.PlayerPlannerData@2c637d
Robot Navigation1@testPlatform Not a valid path
Sep 04, 2011 2:52:10 PM javaclient3.MapInterface handleResponse
WARNING: Data count doesn't match cells number: 2431 != 250000
Sep 04, 2011 2:52:10 PM javaclient3.MapInterface handleResponse
INFO: Map decompress: 250000 bytes
Robot Navigation1@testPlatform New Goal : (0.17,-6.64,0.75)
Robot Navigation1@testPlatform map.isDataReady() true
Robot Navigation1@testPlatform MapInfo = javaclient3.structures.map.PlayerMapInfo@ed088a
Robot Navigation1@testPlatform Map data ready!
However, goal point was easily readable by the robot (there was no obstacle), like all goal points given
Also, at one run i got in the terminal window where player .cfg is run, an output of the form :
warning : requested cell (6540,3) is offmap
warning : requested cell (6541,3) is offmap
………………………………………………….
warning : requested cell (6998,3) is offmap
warning : requested cell (6999,3) is offmap
new goal: -2.250000, -3.600000, 1.010000
warning : Wavefront missed deadline and not sleeping; check machine load
new goal: -2.250000, -3.600000, 1.010000
i hope the above helps.
In all of the runs, whether the output was "Done", or "No valid path", etc, the robot moved to a point with slightly
different coordinates than the goal.
For the moment, as far as i am concerned, i don't mind if the robot visits a point "nearby".
It allows me to move on to my main work, and if necessary get back to improve this afterwards.
But if there's anything else you'd like me to try, i'd be glad to
On Sep 6, 2011, at 2:16 PM, Jorge Santos Simón wrote:
> You are welcome!
>
> mmm.... I'm curious about the warning
>
> Can you replace the log call by:
>
> logger.log (Level.WARNING,
> "Uncompressed data size doesn't
> match cells number: " + unzDataCount + " != " + cellsCount);
>
> to see how different both values are?
>
>
> Please report any other ploblems you find
>
> Jorge
>
|