From: Faruq <wri...@ya...> - 2007-04-21 07:18:32
|
Hi list, I am a newbie of java-player (due to some reasons I decided to use Java with my planner). I'm trying to localize a robot in Stage (now studying BlobfinderExample and other examples) . My target is to: 1) determine current pose of robot 2) drive the robot to a target pose (I found PlayerClient.setSpeed() can drive arbitarily, not like GoTo a pose) This might be too simple problem to many P/S/G experts. Unfortunately, I am lost trying with APIs. I am checking LocalizeInterface and trying to read hypotheses etc. I have no idea how to get current pose regularly. Anyone having some hints and/or code snippets for java-palyer localization, please reply. Thanks in advance, Faruq -- View this message in context: http://www.nabble.com/How-can-I-localize-using-LocalizeInterface-tf3622118.html#a10114543 Sent from the java-player-users mailing list archive at Nabble.com. |
From: John O. <joh...@gm...> - 2007-04-23 07:40:51
|
This depends upon exactly what you want to do. If you are wanting to simulate real life then you will need to use some sort of localization such as the localize interface that you mentioned or a simpler method is to use odometry off of the position driver, with some reasonable errors set ( http://playerstage.sourceforge.net/doc/Stage-2.0.1/group__model__position.html position model ). The odometry will however drift over time so the accuracy will get less and less. This is accessible from the getX, getY and getYaw functions in the position2d class. You could however use odometry with "gps" localization that will give you the absolute correct position of the robot however is not an accurate representation of real life. This is also accessible from the same functions as before. So a bit more detail could be required about exactly what you are looking to do and how accurately you want to model reality. The http://playerstage.sourceforge.net/doc/Player-2.0.0/player/group__driver__amcl.html LocalizeInterface requires a map and laser as well so if these are not available then you need to look at some other method. thanks John Faruq wrote: > > Hi list, > > I am a newbie of java-player (due to some reasons I decided to use Java > with my planner). I'm trying to localize a robot in Stage (now studying > BlobfinderExample and other examples) . > > My target is to: > 1) determine current pose of robot > 2) drive the robot to a target pose (I found PlayerClient.setSpeed() can > drive arbitarily, not like GoTo a pose) > > This might be too simple problem to many P/S/G experts. Unfortunately, I > am lost trying with APIs. > > I am checking LocalizeInterface and trying to read hypotheses etc. I have > no idea how to get current pose regularly. > > Anyone having some hints and/or code snippets for java-palyer > localization, please reply. > > Thanks in advance, > Faruq > > > > -- View this message in context: http://www.nabble.com/How-can-I-localize-using-LocalizeInterface-tf3622118.html#a10135231 Sent from the java-player-users mailing list archive at Nabble.com. |
From: Faruq <wri...@ya...> - 2007-04-24 13:02:37
|
Hi, Thanks John for you reply. Actually my purpose is to demonstrate some scenarios using an intelligent planner and simulating real-life is not necessary. I need to integrate many other components with player including a GUI. Let me share some of my codes as it can be helpful for others ( and also for myself if someone corrects me :)) I am trying to move a robot horizontally (X direction) about 1 meter using BlobfinderExample After connecting to robot I code it like this: while(!posi.isDataReady()); /* Determine current pose: default X = -1.0, Y = -3.0, Yaw = 0.0 */ currentPose = posi.getData().getPos(); // print initial pose System.out.println("Initial X:" + currentPose.getPx() + " Y: " + currentPose.getPy() + " Yaw: " + currentPose.getPa()); /* Go 1 m horizontally Target: X= 0.0 */ float target = 1.00f; desiredPose.setPx(currentPose.getPx() + target); // set desired pose while(currentPose.getPx() < desiredPose.getPx()) { posi.setSpeed(0.40f, 0.0f); // move ahead currentPose = posi.getData().getPos(); // take pose reading //System.out.println("current pose:" + currentPose.getPx()); } /* Stop */ posi.setSpeed(0.00f, 0.0f); //stop in this way? System.out.println("WJ-Pre X:" + currentPose.getPx() + " Y: " + currentPose.getPy() + " Yaw: " + currentPose.getPa()); So, I'm getting different results in different run. If you see the output for current pose, it is different in different run (floating point problem, I guess ). Anyway, I don't need heavy localization methods. But I'm expecting to move the robot a fixed distance always in the same manner. BTW, I'm thinking to make a GUI panel to control simulation. I wonder if anyone did this previously. In that case we may add another example in java-player website. I think it would be interesting to control using GUI panel. My thanks to all Java-player developers for making this nice client library. Best regards, Faruq -- View this message in context: http://www.nabble.com/How-can-I-localize-using-LocalizeInterface-tf3622118.html#a10160562 Sent from the java-player-users mailing list archive at Nabble.com. |
From: John O. <joh...@gm...> - 2007-04-24 14:14:28
|
Moving the robot precisely the same distance every time may be a bit difficult since the code is dependant upon the timing of responses. Possibly if you set the update of the simulation to have a very long step time then you can avoid any timing dependant issues. If you are not worried about localization then using the position2d interface with gps odometry is probably easiest. As for the GUI it could be nice to have some sort of swing display that shows data from the robot as an example. A Java version of playerv would be quite a nice example to show, although since playerv does already exist in C it may be a good idea to try something new. Thanks John Faruq wrote: > > Hi, > > Thanks John for you reply. > > Actually my purpose is to demonstrate some scenarios using an intelligent > planner and simulating real-life is not necessary. I need to integrate > many other components with player including a GUI. Let me share some of my > codes as it can be helpful for others ( and also for myself if someone > corrects me :)) > > I am trying to move a robot horizontally (X direction) about 1 meter using > BlobfinderExample > After connecting to robot I code it like this: > > while(!posi.isDataReady()); > /* Determine current pose: default X = -1.0, Y = -3.0, > Yaw = 0.0 */ > currentPose = posi.getData().getPos(); > // print initial pose > System.out.println("Initial X:" + currentPose.getPx() + " Y: " + > currentPose.getPy() > + " Yaw: " + currentPose.getPa()); > > /* Go 1 m horizontally Target: X= 0.0 */ > float target = 1.00f; > desiredPose.setPx(currentPose.getPx() + target); // set desired pose > > while(currentPose.getPx() < desiredPose.getPx()) > { > > posi.setSpeed(0.40f, 0.0f); // move ahead > currentPose = posi.getData().getPos(); // take pose reading > //System.out.println("current pose:" + currentPose.getPx()); > } > > /* Stop */ > posi.setSpeed(0.00f, 0.0f); //stop in this way? > > System.out.println("WJ-Pre X:" + > currentPose.getPx() + " Y: " + currentPose.getPy() > + " Yaw: " + currentPose.getPa()); > > So, I'm getting different results in different run. If you see the output > for current pose, it is different in different run (floating point > problem, I guess ). Anyway, I don't need heavy localization methods. But > I'm expecting to move the robot a fixed distance always in the same > manner. > > BTW, I'm thinking to make a GUI panel to control simulation. I wonder if > anyone did this previously. In that case we may add another example in > java-player website. I think it would be interesting to control using GUI > panel. > > My thanks to all Java-player developers for making this nice client > library. > > Best regards, > > Faruq > -- View this message in context: http://www.nabble.com/How-can-I-localize-using-LocalizeInterface-tf3622118.html#a10161808 Sent from the java-player-users mailing list archive at Nabble.com. |