From: Jorge S. S. <jsa...@gm...> - 2011-09-05 08:45:08
|
Hello Salvatore, I think the problem is that your player server is sending uncompressed maps to javaclient, but javaclient expects compressed ones by default. Just try to set the first constant on javaclient/structures/PlayerConstants.java as false /** * Informs Javaclient interfaces whether to expect compressed or * uncompressed data from Player server. * This is Java counterpart to the HAVE_Z playerc configuration flag. */ public static final boolean PLAYER_USE_COMPRESED_DATA = false; // true; Please check also if you have configured player with the CMake variable HAVE_Z unset or set as false. Hope this helps! Jorge 2011/9/5 Salvatore Famoso <ei...@gm...> > Hello everyone, > > i am trying to write an application using player/stage/javaclient, where > amongst other stuff, i want a robot to be able to go to a specific given > position in the map. > For this part, i tried following the navigator example, changing a few > things, so as not to get the goal point from mouse input, > but given otherwise (through a jade datastore). > I also use the same configuration (only adjusted appropriately for a > greater number of robots), and the same cave.png as map file (although other > didn't make any difference). > i have no problem with passing the goal-point, however, i have a problem > with the map interface > i keep getting a DataFormatException. > I have tried commenting out various pieces of the code, sa as to find some > version that doesn't give me that exception, but all i got in the end was, > practically almost all the code out, and still the exception. > i tried the debugging mode, and all i found was that it's in the same > thread every time, but couldn't find where in the code i use the exception > is fired, only that it happens in the map interface. > The same DataFormatException is thrown when trying the javaclient example > itself. > below, is the part of the code i use (with some system.out's to see if the > execution reaches specific points of the code), as well as > the associated output, and the stack trace i get for the thread that gives > the exception when i try the debug mode. > i use player 3.0.2, stage 4.0.0, the latest javaclient libraries from svn, > and java 1.7.0 (although the same was happening when using java 1.6.0), and > fedora 15. > > If anyone has any idea what could be the cause, or how i could find it, i > would be obliged, as i've spent several days (and nights) over this and feel > like i've reached a dead end... > > > code: > > planner = navigationAgent.getPlanner(); > map = navigationAgent.getMap(); > System.out.println("Robot " + myAgent.getName() + " my map = > " + map.toString()); > loc = navigationAgent.getLocalization(); > > mapInfo = new PlayerMapInfo(); > > > > } > > public void action() { > > //code to get the goal-point > ...... > System.out.println("Robot " + myAgent.getLocalName() > + " my event transporter received Pose = " + > point); > > //setting the position interface > ..... > > System.out.println("Robot " + myAgent.getName() + " New Goal > : (" > + point.getPx() + "," + point.getPy() + "," > + point.getPa() + ")"); > planner.setGoal(point); > > map.getDeviceAccess(); > > map.requestMapInformation(); > System.out.println("Robot " + myAgent.getName() + " " + > map.isDataReady()); > map.getDeviceAccess(); > > map.getDeviceDriverName(); > map.getTimestamp(); > map.requestMapInformation(); > map.readMapInfo(); > System.out.println("Robot " + myAgent.getName() + " > map.getDeviceDriverName() " + map.getDeviceDriverName()); > System.out.println("Robot " + myAgent.getName() + " > map.getTimestamp() " + map.getTimestamp()); > while (map.isDataReady() == false) { > try { > map.requestMapInformation(); > System.out.println("Robot " + > myAgent.getName() + " map.isDataReady() " + map.isDataReady()); > 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 > int w = mapInfo.getWidth(); > System.out.println("Robot " + myAgent.getName() + " new > PlayerMapData()"); > 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); > System.out.println("Robot " + myAgent.getName() + " > map.isGridDataReady()" + map.isGridDataReady()); > > while (map.isGridDataReady() == false) { > try { > Thread.sleep(20); > } catch (InterruptedException e) { > e.printStackTrace(); > } > } > map.requestMapDataVector(); > > PlayerMapData mapData = map.getGridData(); > > int imgWidth = mapInfo.getWidth(); > int imgHeight = mapInfo.getHeight(); > > if (imgWidth * imgHeight != mapData.getData_count()) { > System.err > .println("NavigatorExample: map grid > size and given data not matching"); > System.exit(1); > } > > currStatus = NavStatus.NEW_GOAL; > System.out.println("Robot " + myAgent.getName() + " Current > Status : " > + currStatus); > > > //and code continues similar to the navigator example as far > as the navigation is concerned > ..... > > > > the corresponding output is : > > > Robot Navigation1@testPlatform my map = javaclient3.MapInterface@be4ae > Robot Navigation1 my event transporter received Pose = PlayerPose2d { > -2.12, -2.81, 2.06} > Robot Navigation1@testPlatform New Goal : (-2.12,-2.81,2.06) > Robot Navigation1@testPlatform false > Robot Navigation1@testPlatform map.getDeviceDriverName() mapfile > Robot Navigation1@testPlatform map.getTimestamp() 0.0 > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform map.isDataReady() false > Robot Navigation1@testPlatform MapInfo = > javaclient3.structures.map.PlayerMapInfo@19776d7 > Robot Navigation1@testPlatform Map data ready! > Robot Navigation1@testPlatform new PlayerMapData() > Robot Nav...@te...String()javaclient3.structures.map.PlayerMapData@17f1661 > Robot Navigation1@testPlatform map.isGridDataReady()false > Sep 04, 2011 4:40:25 AM javaclient3.PlayerException <init> > SEVERE: [Map] : Error uncompressing payload: > java.util.zip.DataFormatException: incorrect header check > Exception in thread "Thread-27" javaclient3.PlayerException: [Map] : Error > uncompressing payload: java.util.zip.DataFormatException: incorrect header > check > at javaclient3.MapInterface.handleResponse(MapInterface.java:334) > at > javaclient3.PlayerClient.handleRequestsDevice(PlayerClient.java:1197) > at javaclient3.PlayerClient.read(PlayerClient.java:891) > at javaclient3.PlayerClient.read(PlayerClient.java:827) > at javaclient3.PlayerClient.run(PlayerClient.java:268) > Caused by: java.util.zip.DataFormatException: incorrect header check > at java.util.zip.Inflater.inflateBytes(Native Method) > at java.util.zip.Inflater.inflate(Inflater.java:256) > at java.util.zip.Inflater.inflate(Inflater.java:274) > at javaclient3.MapInterface.handleResponse(MapInterface.java:253) > ... 4 more > > > > thread 27 stack trace: > > Thread [Thread-27] (Suspended (exception DataFormatException)) > Inflater.inflateBytes(long, byte[], int, int) line: not available > [native method] > Inflater.inflate(byte[], int, int) line: 256 > Inflater.inflate(byte[]) line: 274 > MapInterface.handleResponse(PlayerMsgHdr) line: 253 > PlayerClient.handleRequestsDevice(PlayerMsgHdr) line: 1197 > PlayerClient.read(int, int) line: 891 > PlayerClient.read() line: 827 > PlayerClient.run() line: 268 > > > > ------------------------------------------------------------------------------ > Special Offer -- Download ArcSight Logger for FREE! > Finally, a world-class log management solution at an even better > price-free! And you'll get a free "Love Thy Logs" t-shirt when you > download Logger. Secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsisghtdev2dev > _______________________________________________ > Java-player-users mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-player-users > |