From: jksrecko <jks...@gm...> - 2009-04-17 13:41:32
|
Hi, My name is Srećko and I work with Marija. It seems that the biggest part of the problem with velocity commands getting late is with the p2os driver's communication with the robots microcontroler in general (P2OS::SendReceive()). For starters, I made a p2osExerciser (that is position2d to be correct) driver for sending some referent velocities to the robot every time I get odometry reading. I've attached it to the message ( http://www.nabble.com/file/p23097767/p2osExerciser-0.1.tar.bz2 p2osExerciser-0.1.tar.bz2 ). You can build it using standard GNU build system (configure & make), you don't have to install it. Then, it is important that you start player from it's build directory. You can start the supplied config file: $ player examples/exerciser.cfg. Before doing this, you should get the latest Player release-2-1-patches branch: $ svn co https://playerstage.svn.sourceforge.net/svnroot/playerstage/code/player/branches/release-2-1-patches apply a patch I've also attached to the message ( http://www.nabble.com/file/p23097767/add_logging.diff add_logging.diff ) that adds some lines in p2os driver that log time of arrival of the odometry data and time of sending motor commands. After you make and install this patched version of player you can start it in the p2osExerciser directory as discussed before. After p2osExerciser gets trough all the references (approx. 1 minute and 17 seconds on 100ms cycle) it will print something like "...wref.dat: EOF reached" and then you can kill player (Ctrl + C). There is analyzeLogs.m Matlab script in the p2osExerciser examples subdirectory that will graphically show the aquired logs. You should see that every second command gets executed, and that it's delayed by several cycles. To solve the problem, I tried leaving O_NONBLOCK mode on the serial port file descriptor, so SendReceive would return immediately if there is nothing to receive. I also copied termios configuration of the serial line from ARIA 2.5.1. read() function still seems to block, but calling motorpacket.Send(this->psos_fd) in place of this->SendReceive(&motorpacket); seems to resolve the issue. I'd like some more testing from people with Pioneers before I make a proper patch. To test my modifications you should also apply this patch: http://www.nabble.com/file/p23097767/velocities_problem_solved.diff velocities_problem_solved.diff . Also, you should first apply the patch that adds some lines for logging and then this one. Thank you. Toby Collett-3 wrote: > > Did you have any more luck with the UDP transport layer? It is far less > popular than the TCP one and so it gets less testing/usage. > > Toby > -- View this message in context: http://www.nabble.com/problem-with-setting-velocity-commands-tp22164791p23097767.html Sent from the playerstage-developers mailing list archive at Nabble.com. |