From en_nessereen at yahoo.com Thu Jul 1 20:55:54 2010 From: en_nessereen at yahoo.com (nessereen gaid) Date: Thu, 1 Jul 2010 17:55:54 -0700 (PDT) Subject: [Aria-users] (no subject) Message-ID: <934450.71893.qm@web33705.mail.mud.yahoo.com> please, does any one has Aria-matlab (m.files) for pioneer like P3dx-or P2AT thanks, maged -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100701/c0ae186e/attachment.html From en_nessereen at yahoo.com Thu Jul 1 20:59:26 2010 From: en_nessereen at yahoo.com (nessereen gaid) Date: Thu, 1 Jul 2010 17:59:26 -0700 (PDT) Subject: [Aria-users] (no subject) Message-ID: <336819.74379.qm@web33705.mail.mud.yahoo.com> please, does any one has Aria-matlab (m.files) for pioneer like P3dx-or P2AT thanks, maged -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100701/50924529/attachment.html From lavdrus.ibrani at ntu.ac.uk Fri Jul 2 08:07:54 2010 From: lavdrus.ibrani at ntu.ac.uk (Ibrani, Lavdrus) Date: Fri, 2 Jul 2010 13:07:54 +0100 Subject: [Aria-users] Displaying robot's view on iPhone In-Reply-To: <4BF2AB4A.9050606@mobilerobots.com> References: <867262280681BB458075CA7E5C8F9C0502726C08@beech.ads.ntu.ac.uk><4BF2A463.5030304@mobilerobots.com><867262280681BB458075CA7E5C8F9C0502726D0B@beech.ads.ntu.ac.uk> <4BF2AB4A.9050606@mobilerobots.com> Message-ID: <867262280681BB458075CA7E5C8F9C0502D1F94D@beech.ads.ntu.ac.uk> Hi, Has anyone done, or have example of openCV code on mobileRobots, which not only grabs image from camera, but convert/compress it to mpeg format, so I can easily display it on iPhone. I have an iPhone application, which displays the view from another camera on the iPhone, but that camera is already sending images/video in the right format for iPhone. However, the Video Server code (full code is further below in this e-mail), which I have on mobileRobot, with attached Logitech QuickCam Pro 5000, doesn't do that and I can't seem to find a way to do it. I tried to use openCV functions: CvVideoWriter *writer=cvCreateVideoWriter("out.mp4",CV_FOURCC('D','I','V','X'),fps,cvS ize(frameW,frameH)); and IplImage* img=cvQuaryFrame(capture); cvWriteFrame(writer,img); but nothing happens. I hope someone can give me some useful hints, or even a sample code, that I can try. Thanks Lavdrus -----Original Message----- From: aria-users-bounces at lists.mobilerobots.com [mailto:aria-users-bounces at lists.mobilerobots.com] On Behalf Of Reed Hedges Sent: 18 May 2010 15:59 To: Help,discussion and announcements for MobileRobots' Advanced Robot Interfacefor Applications (ARIA) Subject: Re: [Aria-users] Displaying robot's view on iPhone It looks like your server is sending the image data just as it captured by OpenCV. Check the OpenCV documentation (probably start looking at the cvCaptureFromCAM() function, CvCapture type, cvQueryFrame() function) to find out how this image data is encoded. OpenCV should also I think have some tools for converting/compressing it, e.g. to jpeg or even into a movie format like mpeg that could easily be displayed on the iPhone using the iPhone SDK. (Or you can use libjpeg on Linux to encode and compress it as a jpeg.) Reed Ibrani, Lavdrus wrote: > Here is the video server code I use: > > //Gazebot:: This is the server that forwards images from the camera to > the client. Running in startup of the system. > //This should be run prior to running the client on the remtoe pc. > > #include "headers.h" > > int main() > { > //Gazebot:: openCV initialization to enable grabbing and creating buffer > > IplImage* img=0; //the image grabbed from the camera > CvCapture * capture=cvCaptureFromCAM(CV_CAP_ANY);//the capture that uses the camera > > char *imgToSend; //the buffer to include the image data to write to the socket > > int bufferIndex=0; //the number of bytes of the buffer= size of the image data > > // The size of the string the client sent > size_t strSize; > > // The socket objects: one for accepting new client connections, > // and another for communicating with a client after it connects. > > ArSocket serverSock, clientSock; > > // Initialize Aria. This is especially essential on Windows, > // because it will initialize Windows's sockets sytem. > Aria::init(); > // The buffer in which to recieve the message from the client > char buff[5]; > //Open the server port > if (serverSock.open(8888, ArSocket::TCP)) > ArLog::log(ArLog::Normal, "videoService: Opened the server port."); > else > ArLog::log(ArLog::Normal, "videoService: Failed to open the server port: %s.",serverSock.getErrorStr().c_str()); > > //continue forever "listening to the client" > while(1) > { > // Wait for a client to connect to us. > ArLog::log(ArLog::Normal,"videoService: Waiting for client to connect....."); > > if (serverSock.accept(&clientSock)) > ArLog::log(ArLog::Normal, "videoService: Client has connected."); > else > ArLog::log(ArLog::Terse, "videoService: Error in accepting a connection from the client: %s.", > serverSock.getErrorStr().c_str()); > ArLog::log(ArLog::Normal,"videoService: Grabbing and sending images over to the client."); > > //Grabbing images, creating the buffer and writing to the socket > for(;;) > { > //grabbing images from the video capture and creating the buffer to send > > img=cvQueryFrame(capture); > imgToSend=img->imageData; > bufferIndex=img->imageSize; > > > // Send the image buffer to the client. write() should > // return the same number of bytes that we told it to write. Otherwise, > // its an error condition. > if (clientSock.write(imgToSend, bufferIndex) != bufferIndex) > ArLog::log(ArLog::Normal,"videoService:Error sending image over socket."); > > > // Read data from the client. read() will block until data is received. Therfore: > //Gazebot:: we don't send another image until the previos one has been received completely. > > strSize=clientSock.read(buff, sizeof(buff)); > > // If the amount read is 0 or less, its an error condition. client has disconnected. > > if(strSize ==-1 || strSize==0) > { > ArLog::log(ArLog::Normal, "videoService:Error in reading from the client."); > clientSock.close(); > break; > } > } > // Now lets close the connection to the client > clientSock.close(); > ArLog::log(ArLog::Normal, "videoService: Socket to client closed."); > > } //Going back to the continues loop to listen to new calls from clients > > > // And lets close the server port > serverSock.close(); > ArLog::log(ArLog::Normal, "videoService: Server socket closed."); > > // Uninitialize Aria > Aria::uninit(); > > // All done > return(0); > } > > -----Original Message----- > From: aria-users-bounces at lists.mobilerobots.com > [mailto:aria-users-bounces at lists.mobilerobots.com] On Behalf Of Reed > Hedges > Sent: 18 May 2010 15:30 > To: Help,discussion and announcements for MobileRobots' Advanced Robot > Interfacefor Applications (ARIA) > Subject: Re: [Aria-users] Displaying robot's view on iPhone > > > Hello, > > Ibrani, Lavdrus wrote: >> I'm successfully using iPhone to control aria mobile robot pioneer 3. > > Sounds like a fun project. Let us know if/when you put anything on > the web (paper, video, photos) about it! > >> The robot has a camera attached to it and a video server code on the >> onboard computer, that grabs and sends the images to the client > > What is this video server code? Is it SAVServer? ACTS? Something else? > > SAVServer and ACTS send JPEGs (Each packet contains the width and > height > (pixels) as 16-bit integers, followed by the JPEG image data, see > ArNetworking/examples/getVideoExample.cpp for an example.) > > Reed > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > This email is intended solely for the addressee. It may contain private and confidential information. If you are not the intended addressee, please take no action based on it nor show a copy to anyone. In this case, please reply to this email to highlight the error. Opinions and information in this email that do not relate to the official business of Nottingham Trent University shall be understood as neither given nor endorsed by the University. > Nottingham Trent University has taken steps to ensure that this email and any attachments are virus-free, but we do advise that the recipient should check that the email and its attachments are actually virus free. This is in keeping with good computing practice. > _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. This email is intended solely for the addressee. It may contain private and confidential information. If you are not the intended addressee, please take no action based on it nor show a copy to anyone. In this case, please reply to this email to highlight the error. Opinions and information in this email that do not relate to the official business of Nottingham Trent University shall be understood as neither given nor endorsed by the University. Nottingham Trent University has taken steps to ensure that this email and any attachments are virus-free, but we do advise that the recipient should check that the email and its attachments are actually virus free. This is in keeping with good computing practice. From reed at mobilerobots.com Fri Jul 2 09:50:10 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Fri, 02 Jul 2010 09:50:10 -0400 Subject: [Aria-users] Packages for Debian 5 Message-ID: <4C2DEE92.6030404@mobilerobots.com> In the near future, we will start supporting Debian GNU/Linux 5.0.4 (lenny) as we currently do our version of Debian 3, and using it for new robots with onboard computers running Linux. (We are upgrading the onboard computers as well, to Core 2 Duo based systems!) (A few packages had been released for Debian 4 (etch), these will be discontinued.) On new computer installations, it will probably be Debian's "Laptop" style package selection, with the addition of the following packages. Are there are any additional packages you would like to see? The goal is to have a broadly useful set of packages already available on new robots with onboard computers. You will always be able to install more Debian packages by connecting to the internet and using apt-get or other installation tool (or by manually downloading and installing packages using dpkg); you will be able to get any security or other critical updates from Debian this way too. Also, when Debian does a revision point release, the general plan is that we will do some testing of it with our software as well and move to that as the Debian 5 target for our releases. Proposed extra packages: a more minimal MTA than exim if it exists (e.g. local only delivery) alien alsa-utils atheros/madwifi drivers automake, autoconf binutils bison bzip2 coriander cvs ddd dhcp-client dnsutils emacs ffmpeg flex gcc, g++ 4.3.2 gcc-3.4, g++-3.4 as an optional compiler gdb genpowerd? git gnome-control-center gnome-netstatus-applet gnome-network-admin gnome-power-manager gnome-sound-recorder gnome-system-monitor gnome-system-tools gnome-terminal hdparm host imagemagick (graphics command line tools including file format converter) iproute less libavcodec-dev, libavformat-dev libbz2-dev libcurl3-dev libcv-dev, libcvaux-dev libhighgui-dev (this is OpenCV) libdc1394-dev, libraw1394-dev libjasper-dev libjpeg62-dev libpng-dev libstdc++5 libtool lm-sensors make manpages-dev memtest86+ minicom module-init-tools netcat network-manager-gnome perl-doc pkg-config python 2.5 python-numeric python2.4 as an optional alternative rsync screen setserial sox (includes play and rec) ssh (includes client and server for ssh and sftp) statserial strace subversion (svn) sudo swig swig-doc synaptic sysutils tcpdump tofrodos traceroute unzip, zip v4l-conf vim vim-gnome wget wireless-tools wpasupplicant x11-utils xawtv From zhossain.kuet at yahoo.com Mon Jul 5 05:04:50 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Mon, 5 Jul 2010 02:04:50 -0700 (PDT) Subject: [Aria-users] please help to store image and wander around Message-ID: <241608.58974.qm@web46411.mail.sp1.yahoo.com> Hello aria-users, I'm trying to make a project where my robot will wander avoiding obstacle using laser and at the same time it will store laser readings and images. I would like to use ArNetworking so, would you tell me how can I write client program for all actions? I can use getvideoexample and wander example individually, but don't know how can i integrate them together into Arclient program. my equipments: robot: p3-at camera: canon vc-50i laser: sick I will be grateful for any answer of yours. thanks in advance Hossain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100705/0a728517/attachment.html From zhossain.kuet at yahoo.com Tue Jul 6 03:43:55 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Tue, 6 Jul 2010 00:43:55 -0700 (PDT) Subject: [Aria-users] problem with arnlServer Message-ID: <873863.26468.qm@web46411.mail.sp1.yahoo.com> Hi all, please help to find out solutions for two problems mentioned below. 1. laser isn't getting power when i'm running arnlServer program from onboard computer... (but laser works with wander program) [robot at p3at examples]$ ./arnlServer Could not connect to simulator, connecting to robot through serial port /dev/ttyS0. Syncing 0 Syncing 1 Syncing 2 Connected to robot. Name: Auckland_3502 Type: Pioneer Subtype: p3at-sh Loaded robot parameters from p3at-sh.p ArLaserConnector: Using robot params for connecting to laser lms2xx_1: waiting for laser to power on. lms2xx_1: Failed to connect to laser, no poweron received. lms2xx_1: waiting for laser to power on. lms2xx_1: Failed to connect to laser, no poweron received. ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping Could not connect to all lasers... exiting Disconnecting from robot 2. How can i save laser reading and images at the same time. Any response from you will be appreciated. Best regards Hossain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100706/52ca04ff/attachment.html From rbedi100 at gmail.com Tue Jul 6 12:03:20 2010 From: rbedi100 at gmail.com (Rishi Bedi) Date: Tue, 6 Jul 2010 12:03:20 -0400 Subject: [Aria-users] Import error - AriaPy.so - undefined symbol (_ZN8ArLMS1XX3logEv) Message-ID: Hi, I'm running Aria-2.7.2 and the Aria Python wrapper on Ubuntu 10.04, and Python 2.4. I successfully compiled Aria from source, and installed AriaPy using the .deb package found on the MobileRobots wiki. When I try to run simple.py (which I moved from the /Aria/pythonExamples directory to /Aria/Python), I get the following error: rishi at rishi-portable:/usr/ local/Aria/python$ python ./simple.py Traceback (most recent call last): File "./simple.py", line 25, in ? from AriaPy import * File "/usr/local/Aria/python/AriaPy.py", line 56, in ? import _AriaPy *ImportError: /usr/local/Aria/python/_AriaPy.so: undefined symbol: _ZN8ArLMS1XX3logEv* The C++ examples work fine. Any ideas on where this error is coming from? -- is it possible to get a copy of the AriaPy source so we can compile it ourselves? Thanks, Rishi Rishi Bedi rbedi100 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100706/f066e5fd/attachment.html From reed at mobilerobots.com Tue Jul 6 12:18:28 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Tue, 06 Jul 2010 12:18:28 -0400 Subject: [Aria-users] Import error - AriaPy.so - undefined symbol (_ZN8ArLMS1XX3logEv) In-Reply-To: References: Message-ID: <4C335754.9050503@mobilerobots.com> What compiler version did you use? If you used the default in Ubuntu 10 it's probably gcc 4, which unfortunately produces binary code incompatible with gcc 3.4, which is how the AriaPy wrapper was built. Try using Aria 2.7.2 as installed by the .deb package without recompiling, or recompile with g++-3.4 (you can set the CXX environment variable to g++-3.4), or rebuild the Python wrapper (install swig and run "make python"). Reed Rishi Bedi wrote: > Hi, > I'm running Aria-2.7.2 and the Aria Python wrapper on Ubuntu 10.04, and > Python 2.4. I successfully compiled Aria from source, and installed > AriaPy using the .deb package found on the MobileRobots wiki. When I try > to run simple.py (which I moved from the /Aria/pythonExamples directory > to /Aria/Python), I get the following error: > > rishi at rishi-portable:/usr/ > local/Aria/python$ python ./simple.py > Traceback (most recent call last): > File "./simple.py", line 25, in ? > from AriaPy import * > File "/usr/local/Aria/python/AriaPy.py", line 56, in ? > import _AriaPy > *ImportError: /usr/local/Aria/python/_AriaPy.so: undefined symbol: > _ZN8ArLMS1XX3logEv* > > The C++ examples work fine. Any ideas on where this error is coming > from? -- is it possible to get a copy of the AriaPy source so we can > compile it ourselves? > Thanks, > Rishi > > Rishi Bedi > rbedi100 at gmail.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From rbedi100 at gmail.com Wed Jul 7 17:22:50 2010 From: rbedi100 at gmail.com (Rishi Bedi) Date: Wed, 7 Jul 2010 17:22:50 -0400 Subject: [Aria-users] Import error - AriaPy.so - undefined symbol (_ZN8ArLMS1XX3logEv) Message-ID: Thanks, Reed, that works perfectly. AriaPy is up and running. Rishi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100707/ebab8499/attachment.html From rbedi100 at gmail.com Thu Jul 8 01:07:12 2010 From: rbedi100 at gmail.com (Rishi Bedi) Date: Thu, 8 Jul 2010 01:07:12 -0400 Subject: [Aria-users] Using Bumpers (Pioneer 2) Message-ID: Hi, I'm trying to use Aria to display bumper readings when my robot collides into something. I have it moving in increments of 1000 using robot.move(1000), and after each movement, I want to print readings from the bumper. After initializing ArBumpers, how do it retrieve data from it? Thanks -- Rishi Rishi Bedi rbedi100 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100708/e795eae4/attachment.html From jmcuadra at dia.uned.es Thu Jul 8 07:23:14 2010 From: jmcuadra at dia.uned.es (Jose Manuel Cuadra Troncoso) Date: Thu, 08 Jul 2010 13:23:14 +0200 Subject: [Aria-users] Using Bumpers (Pioneer 2) In-Reply-To: References: Message-ID: <1278588194.2948.9.camel@portatil-jose> Hi, Rishi Maybe this will work for you, this code uses frontal and/or rear bumpers. //Class variables uint n_front_bumpers; uint n_rear_bumpers; bool* bumper_readings; ArRobot* myRobot; // Initialization code if(myRobot->hasFrontBumpers()) n_front_bumpers = myRobot->getNumFrontBumpers(); if(myRobot->hasRearBumpers()) n_rear_bumpers = myRobot->getNumRearBumpers(); bumper_readings = new bool[n_front_bumpers + n_rear_bumpers]; // Reading code int val, bit; uint i; myRobot->lock(); val = ((myRobot->getStallValue() & 0xff00) >> 8); for (i = 0, bit = 2; i < n_front_bumpers; i++, bit *= 2) bumper_readings[i] = val & bit ? true : false; val = ((myRobot->getStallValue() & 0xff)); for (i = n_front_bumpers, bit = 2; i < n_front_bumpers + n_rear_bumpers; i++, bit *= 2) bumper_readings[i] = val & bit ? true : false; myRobot->unlock(); > Hi, > I'm trying to use Aria to display bumper readings when my robot > collides into something. I have it moving in increments of 1000 using > robot.move(1000), and after each movement, I want to print readings > from the bumper. After initializing ArBumpers, how do it retrieve data > from it? > Thanks -- Rishi > > Rishi Bedi > rbedi100 at gmail.com > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -- ,.....................................,................................, : Jose Manuel Cuadra Troncoso : Email: jmcuadra at dia.uned.es : : Dpto. de Inteligencia Artificial : Tel: (+34) 91-398-7144 : : Univ. Nac. de Educacion a Distancia : Fax: (+34) 91-398-8895 : : Juan del Rosal, 16 - 3? : : : E-28040 Madrid SPAIN : http://www.ia.uned.es/~jmcuadra: '.....................................:................................' From reed at mobilerobots.com Thu Jul 8 09:04:07 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Thu, 08 Jul 2010 09:04:07 -0400 Subject: [Aria-users] Using Bumpers (Pioneer 2) In-Reply-To: References: Message-ID: <4C35CCC7.2000804@mobilerobots.com> Hi, since ArBumpers is a subclass of ArRangeDevice, you can use the range buffers from ArRangeDevice. This will give you locations in space where a bumper hit occured. If you just want to know which bumper was hit, look at ArRobot::getStallValue(). On 07/08/2010 01:07 AM, Rishi Bedi wrote: > Hi, > I'm trying to use Aria to display bumper readings when my robot collides > into something. I have it moving in increments of 1000 using > robot.move(1000), and after each movement, I want to print readings from > the bumper. After initializing ArBumpers, how do it retrieve data from it? > Thanks -- Rishi > > Rishi Bedi > rbedi100 at gmail.com > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From reed at mobilerobots.com Thu Jul 8 09:27:26 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Thu, 08 Jul 2010 09:27:26 -0400 Subject: [Aria-users] matlab In-Reply-To: <934450.71893.qm@web33705.mail.mud.yahoo.com> References: <934450.71893.qm@web33705.mail.mud.yahoo.com> Message-ID: <4C35D23E.5060602@mobilerobots.com> You could try searching the aria-users archive at http://robots.mobilerobots.com/wiki/Aria-users I have not done this, not user if something useful is there. On 07/01/2010 08:55 PM, nessereen gaid wrote: > > please, > does any one has Aria-matlab (m.files) for pioneer like P3dx-or P2AT > thanks, > maged > > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From reed at mobilerobots.com Thu Jul 8 09:33:38 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Thu, 08 Jul 2010 09:33:38 -0400 Subject: [Aria-users] problem with arnlServer In-Reply-To: <873863.26468.qm@web46411.mail.sp1.yahoo.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> Message-ID: <4C35D3B2.6040601@mobilerobots.com> Does this always happen, or only sometimes? When it happens, check the indicator lights on the top of the SICK laser, and note the sequence of lights and messages printed by arnlServer. Is the laser off (no indicator lights) before you start arnlServer? Reed On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > Hi all, > > please help to find out solutions for two problems mentioned below. > > > 1. laser isn't getting power when i'm running arnlServer program from > onboard computer... > (but laser works with wander program) > [robot at p3at examples]$ ./arnlServer > Could not connect to simulator, connecting to robot through serial port > /dev/ttyS0. > Syncing 0 > Syncing 1 > Syncing 2 > Connected to robot. > Name: Auckland_3502 > Type: Pioneer > Subtype: p3at-sh > Loaded robot parameters from p3at-sh.p > ArLaserConnector: Using robot params for connecting to laser > > lms2xx_1: waiting for laser to power on. > lms2xx_1: Failed to connect to laser, no poweron received. > lms2xx_1: waiting for laser to power on. > lms2xx_1: Failed to connect to laser, no poweron received. > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > Could not connect to all lasers... exiting > > Disconnecting from robot > > 2. How can i save laser reading and images at the same time. > > Any response from you will be appreciated. > > Best regards > Hossain > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From j.hdez.alvarez at gmail.com Thu Jul 8 13:54:19 2010 From: j.hdez.alvarez at gmail.com (=?ISO-8859-1?Q?Jacqueline_Hern=E1ndez_Alvarez?=) Date: Thu, 8 Jul 2010 12:54:19 -0500 Subject: [Aria-users] Cannon VC-C50i camera, OpenCV and NTSC Message-ID: Hi, I am trying to use the Cannon VC-C50i camera with OpenCV libraries, my code is the following: #include #include #include #include #include using namespace std; int main( ){ CvCapture* capture = cvCaptureFromCAM(0); IplImage* frame = 0; if (!capture){ printf("Error: capture = NULL"); return -1; } cvNamedWindow("cvImageFromCAM", CV_WINDOW_AUTOSIZE); frame = cvQueryFrame(capture); cvShowImage("cvImageFromCAM", frame); cvWaitKey(0); cvDestroyWindow("cvImageFromCAM"); cvReleaseCapture(&capture); return 0; } but, when I run the program, the frame I capture is distorted. If I use XawTV viewer before running the program, adjusting to NTSC mode, the frame I get is a normal image. I need to know, how can I use the camera in NTSC mode with OpenCV? Do you have any idea? Thanks in advance. -- Jacqueline Hern?ndez Alvarez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100708/bd9c23df/attachment.html From flawton at hotmail.com Thu Jul 8 19:45:01 2010 From: flawton at hotmail.com (Fred Lawton) Date: Thu, 8 Jul 2010 16:45:01 -0700 Subject: [Aria-users] p3at heading error Message-ID: I have a p3at. It does not have a laser scanner. One problem I'm having is when I command the robot to turn/change heading it seems to be quite inaccurate. For example, if I give the robot 8 commands to turn 90 degrees, the robot should turn 720 degrees but turns just less than 630 degrees. This is about 45 degrees of error per 360 degree revolution. This seems way too high. Any ideas of what the problem might be or how to troubleshoot the problem? Thanks, Fred UC Riverside, VISLab _________________________________________________________________ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100708/1ad907cc/attachment.html From mbernal at gdl.cinvestav.mx Thu Jul 8 21:55:37 2010 From: mbernal at gdl.cinvestav.mx (Miguel Bernal Marin) Date: Thu, 8 Jul 2010 20:55:37 -0500 (CDT) Subject: [Aria-users] P2 DX: No boot device found Message-ID: <26168.201.154.133.136.1278640537.squirrel@www.gdl.cinvestav.mx> Dear all, We have a Pioneer 2 DX, in our laboratory. Today when we want to connect the audio system (connect the J6 connector), and reboot the computer, an error message shows in the start screen. The message said No boot device found R reboot S setup We notice that it was a HD error, then we did the following task without success: 1. Try to setup de BIOS 2. Change the HD 3. Change the IDE cable 4. Change the IDE converter connector 5. Connect a DVD ROM 6. Connect a 5" HD 7. Disconnect the Audio connector and did the above again. We have noticed that the BIOS does not retain the date, it always starts in 1980. But we think that these is not the real problem. We think that the problem is that the BIOS does not recognize the HD. A few days ago we shutdown the robot when it had no battery. We were distracted and not hear the sound of no battery and it had reset 1 or 2 times before shutting it off completely. Any kind of idea of what might be happening? Thanks in Advance, Miguel BERNAL MARIN -- CINVESTAV Unidad Guadalajara Av. Cientif?ca 1145 Colonia el Baj?o, Zapopan 45015, Jalisco M?xico. Tel: +52 (33) 3777-3600 Fax: +52 (33) 3777-3609 From zhossain.kuet at yahoo.com Fri Jul 9 08:36:23 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Fri, 9 Jul 2010 05:36:23 -0700 (PDT) Subject: [Aria-users] problem with arnlServer In-Reply-To: <4C35D3B2.6040601@mobilerobots.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> Message-ID: <592914.94158.qm@web46413.mail.sp1.yahoo.com> Hi Reed Thank you very much for your reply. Yes always getting same response. but when i use serverDemo from ArNetworking then it's working perfectly. Another problem....i was trying to save a laser txt file and image with single stock by this client program. and I used serverDemo as my server program. I am getting image properly but in laser txt file no data.......please please help.... Code:(client program) #include "Aria.h" #include "ArNetworking.h" #include "cv.h" #include "highgui.h" #include #include using namespace std; IplImage *img=0; int no=1; ArClientBase client; ArSick sick; class InputHandler { public: /** * @param client Our client networking object * @param keyHandler Key handler to register command callbacks with */ InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); virtual ~InputHandler(void); /// Up arrow key handler: drive the robot forward void up(void); /// Down arrow key handler: drive the robot backward void down(void); /// Left arrow key handler: turn the robot left void left(void); /// Right arrow key handler: turn the robot right void right(void); /// Send drive request to the server with stored values void sendInput(void); /// Send a request to enable "safe drive" mode on the server void imageCapture(); protected: ArClientBase *myClient; ArKeyHandler *myKeyHandler; /// Set this to true in the constructor to print out debugging information bool myPrinting; /// Current translation value (a percentage of the maximum speed) double myTransRatio; /// Current rotation ration value (a percentage of the maximum rotational velocity) double myRotRatio; /** Functor objects, given to the key handler, which then call our handler * methods above */ ///@{ ArFunctorC myUpCB; ArFunctorC myDownCB; ArFunctorC myLeftCB; ArFunctorC myRightCB; ArFunctorC myImageCaptureCB; }; InputHandler::InputHandler(ArClientBase *client, ArKeyHandler *keyHandler) : myClient(client), myKeyHandler(keyHandler), myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), /* Initialize functor objects with pointers to our handler methods: */ myUpCB(this, &InputHandler::up), myDownCB(this, &InputHandler::down), myLeftCB(this, &InputHandler::left), myRightCB(this, &InputHandler::right), myImageCaptureCB(this, &InputHandler::imageCapture) { /* Add our functor objects to the key handler, associated with the appropriate * keys: */ myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); myKeyHandler->addKeyHandler('c', &myImageCaptureCB); } InputHandler::~InputHandler(void) { } void InputHandler::up(void) { if (myPrinting) printf("Forwards\n"); myTransRatio = 100; } void InputHandler::down(void) { if (myPrinting) printf("Backwards\n"); myTransRatio = -100; } void InputHandler::left(void) { if (myPrinting) printf("Left\n"); myRotRatio = 100; } void InputHandler::right(void) { if (myPrinting) printf("Right\n"); myRotRatio = -100; } void InputHandler::imageCapture() { /* Construct a request packet. The data is a single byte, with value * 1 to enable safe drive, 0 to disable. */ ArNetPacket p; p.uByteToBuf(90); client.requestOnce("sendVideo", &p); } void InputHandler::sendInput(void) { /* This method is called by the main function to send a ratioDrive * request with our current velocity values. If the server does * not support the ratioDrive request, then we abort now: */ if(!myClient->dataExists("ratioDrive")) return; /// Send a request to enable "safe drive" mode on the server void safeDrive(); /* Construct a ratioDrive request packet. It consists * of three doubles: translation ratio, rotation ratio, and an overall scaling * factor. */ ArNetPacket packet; packet.doubleToBuf(myTransRatio); packet.doubleToBuf(myRotRatio); packet.doubleToBuf(50); // use half of the robot's maximum. //packet.doubleToBuf(myLatRatio); if (myPrinting) printf("Sending\n"); myClient->requestOnce("ratioDrive", &packet); myTransRatio = 0; myRotRatio = 0; //myLatRatio = 0; } /* Key handler for the escape key: shutdown all of Aria. */ void escape(void) { printf("esc pressed, shutting down aria\n"); Aria::shutdown(); } /*Key Handler for the capture key: capture a picture. */ void jpegHandler(ArNetPacket *packet) { //To write a Laser data file std::vector< ArSensorReading >* readings; std::vector< ArSensorReading >::iterator it; FILE* dataFile; dataFile = fopen("laser_log.txt", "w"); sick.lockDevice(); readings = sick.getRawReadingsAsVector(); for (it = readings->begin(); it != readings->end(); it++) { fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); } sick.unlockDevice(); ArUtil::sleep(100); fclose( dataFile );//closed laser datafile //To store a Image unsigned int width; unsigned int height; static unsigned char jpeg[50000]; int jpegSize; FILE *file; width = packet->bufToUByte2(); height = packet->bufToUByte2(); jpegSize = packet->getDataLength() - packet->getDataReadLength(); if(jpegSize > 50000) { ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image is %d bytes, my buffer is 50000 bytes)", jpegSize); return; } packet->bufToData((char *)jpeg, jpegSize); const char base[]="image", ext[]=".jpg"; char filename[FILENAME_MAX]; //char tmpFilename[128]; sprintf(filename,"%s%d%s", base, no, ext); if ((file = ArUtil::fopen(filename, "wb")) != NULL) { fwrite(jpeg, jpegSize, 1, file); fclose(file); #ifdef WIN32 // On windows, rename() fails if the new file already exists unlink(filename); #endif } else ArLog::log(ArLog::Normal, "Could not write temp file "); char ifile[FILENAME_MAX]; sprintf(ifile, "%s%d%s", base, no, ext); img = cvLoadImage(ifile); cvNamedWindow("image",CV_WINDOW_AUTOSIZE); cvShowImage( "image", img ); //cvReleaseImage(&img); //cvDestroyWindow("image"); cvWaitKey(10); no++; } int main(int argc, char **argv) { /* Aria initialization: */ Aria::init(); /* Aria components use this to get options off the command line: */ ArClientSimpleConnector clientConnector(&parser); parser.loadDefaultArguments(); /* Check for -help, and unhandled arguments: */ if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) { Aria::logOptions(); exit(0); } /* Connect our client object to the remote server: */ if (!clientConnector.connectClient(&client)) { if (client.wasRejected()) printf("Server '%s' rejected connection, exiting\n", client.getHost()); else printf("Could not connect to server '%s', exiting\n", client.getHost()); exit(1); } printf("Connected to server.\n"); client.setRobotName(client.getHost()); // include server name in log messages /* Create a key handler and also tell Aria about it */ ArKeyHandler keyHandler; Aria::setKeyHandler(&keyHandler); /* Global escape-key handler to shut everythnig down */ ArGlobalFunctor escapeCB(&escape); keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); client.addHandler("sendVideo", &jpegHandlerCB); client.runAsync(); /* Create the InputHandler object and request safe-drive mode */ InputHandler inputHandler(&client, &keyHandler); //inputHandler.safeDrive(); /* Use ArClientBase::dataExists() to see if the "ratioDrive" request is available on the * currently connected server. */ if(!client.dataExists("ratioDrive") ) printf("Warning: server does not have ratioDrive command, can not use drive commands!\n"); else printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn Left\nRIGHT: Turn Right\n"); printf("c: Image capture\n\nesc: shut down\n"); while (client.getRunningWithLock()) { keyHandler.checkKeys(); inputHandler.sendInput(); ArUtil::sleep(100); } /* The client stopped running, due to disconnection from the server, general * Aria shutdown, or some other reason. */ client.disconnect(); Aria::shutdown(); return 0; } ________________________________ From: Reed Hedges To: aria-users at lists.mobilerobots.com Sent: Fri, July 9, 2010 1:33:38 AM Subject: Re: [Aria-users] problem with arnlServer Does this always happen, or only sometimes? When it happens, check the indicator lights on the top of the SICK laser, and note the sequence of lights and messages printed by arnlServer. Is the laser off (no indicator lights) before you start arnlServer? Reed On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > Hi all, > > please help to find out solutions for two problems mentioned below. > > > 1. laser isn't getting power when i'm running arnlServer program from > onboard computer... > (but laser works with wander program) > [robot at p3at examples]$ ./arnlServer > Could not connect to simulator, connecting to robot through serial port > /dev/ttyS0. > Syncing 0 > Syncing 1 > Syncing 2 > Connected to robot. > Name: Auckland_3502 > Type: Pioneer > Subtype: p3at-sh > Loaded robot parameters from p3at-sh.p > ArLaserConnector: Using robot params for connecting to laser > > lms2xx_1: waiting for laser to power on. > lms2xx_1: Failed to connect to laser, no poweron received. > lms2xx_1: waiting for laser to power on. > lms2xx_1: Failed to connect to laser, no poweron received. > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > Could not connect to all lasers... exiting > > Disconnecting from robot > > 2. How can i save laser reading and images at the same time. > > Any response from you will be appreciated. > > Best regards > Hossain > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, >FAQ, tips, manuals, and software, firmware and driver downloads. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100709/8a17cd6d/attachment-0001.html From zhossain.kuet at yahoo.com Fri Jul 9 11:13:53 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Fri, 9 Jul 2010 08:13:53 -0700 (PDT) Subject: [Aria-users] problem with arnlServer In-Reply-To: <592914.94158.qm@web46413.mail.sp1.yahoo.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> Message-ID: <256977.12011.qm@web46414.mail.sp1.yahoo.com> Hi, sorry I missed one question to answer in my previous mail.... Indicator light remains off all time and getting this output.. [robot at p3at examples]$ ./arnlServer > Could not connect to simulator, connecting to robot through serial port > /dev/ttyS0. > Syncing 0 > Syncing 1 > Syncing 2 > Connected to robot. > Name: Auckland_3502 > Type: Pioneer > Subtype: p3at-sh > Loaded robot parameters from p3at-sh.p > ArLaserConnector: Using robot params for connecting to laser > > lms2xx_1: waiting for laser to power on. > lms2xx_1: Failed to connect to laser, no poweron received. > lms2xx_1: waiting for laser to power on. > lms2xx_1: Failed to connect to laser, no poweron received. > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > Could not connect to all lasers... exiting > > Disconnecting from robot Would you please have a look in my previous mail and give your comments? Best regards hossain ________________________________ From: "Hossain, Md.Z" To: "Help, discussion and announcements for MobileRobots' Advanced Robot Interface for Applications (ARIA) " Sent: Sat, July 10, 2010 12:36:23 AM Subject: Re: [Aria-users] problem with arnlServer Hi Reed Thank you very much for your reply. Yes always getting same response. but when i use serverDemo from ArNetworking then it's working perfectly. Another problem....i was trying to save a laser txt file and image with single stock by this client program. and I used serverDemo as my server program. I am getting image properly but in laser txt file no data.......please please help.... Code:(client program) #include "Aria.h" #include "ArNetworking.h" #include "cv.h" #include "highgui.h" #include #include using namespace std; IplImage *img=0; int no=1; ArClientBase client; ArSick sick; class InputHandler { public: /** * @param client Our client networking object * @param keyHandler Key handler to register command callbacks with */ InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); virtual ~InputHandler(void); /// Up arrow key handler: drive the robot forward void up(void); /// Down arrow key handler: drive the robot backward void down(void); /// Left arrow key handler: turn the robot left void left(void); /// Right arrow key handler: turn the robot right void right(void); /// Send drive request to the server with stored values void sendInput(void); /// Send a request to enable "safe drive" mode on the server void imageCapture(); protected: ArClientBase *myClient; ArKeyHandler *myKeyHandler; /// Set this to true in the constructor to print out debugging information bool myPrinting; /// Current translation value (a percentage of the maximum speed) double myTransRatio; /// Current rotation ration value (a percentage of the maximum rotational velocity) double myRotRatio; /** Functor objects, given to the key handler, which then call our handler * methods above */ ///@{ ArFunctorC myUpCB; ArFunctorC myDownCB; ArFunctorC myLeftCB; ArFunctorC myRightCB; ArFunctorC myImageCaptureCB; }; InputHandler::InputHandler(ArClientBase *client, ArKeyHandler *keyHandler) : myClient(client), myKeyHandler(keyHandler), myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), /* Initialize functor objects with pointers to our handler methods: */ myUpCB(this, &InputHandler::up), myDownCB(this, &InputHandler::down), myLeftCB(this, &InputHandler::left), myRightCB(this, &InputHandler::right), myImageCaptureCB(this, &InputHandler::imageCapture) { /* Add our functor objects to the key handler, associated with the appropriate * keys: */ myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); myKeyHandler->addKeyHandler('c', &myImageCaptureCB); } InputHandler::~InputHandler(void) { } void InputHandler::up(void) { if (myPrinting) printf("Forwards\n"); myTransRatio = 100; } void InputHandler::down(void) { if (myPrinting) printf("Backwards\n"); myTransRatio = -100; } void InputHandler::left(void) { if (myPrinting) printf("Left\n"); myRotRatio = 100; } void InputHandler::right(void) { if (myPrinting) printf("Right\n"); myRotRatio = -100; } void InputHandler::imageCapture() { /* Construct a request packet. The data is a single byte, with value * 1 to enable safe drive, 0 to disable. */ ArNetPacket p; p.uByteToBuf(90); client.requestOnce("sendVideo", &p); } void InputHandler::sendInput(void) { /* This method is called by the main function to send a ratioDrive * request with our current velocity values. If the server does * not support the ratioDrive request, then we abort now: */ if(!myClient->dataExists("ratioDrive")) return; /// Send a request to enable "safe drive" mode on the server void safeDrive(); /* Construct a ratioDrive request packet. It consists * of three doubles: translation ratio, rotation ratio, and an overall scaling * factor. */ ArNetPacket packet; packet.doubleToBuf(myTransRatio); packet.doubleToBuf(myRotRatio); packet.doubleToBuf(50); // use half of the robot's maximum. //packet.doubleToBuf(myLatRatio); if (myPrinting) printf("Sending\n"); myClient->requestOnce("ratioDrive", &packet); myTransRatio = 0; myRotRatio = 0; //myLatRatio = 0; } /* Key handler for the escape key: shutdown all of Aria. */ void escape(void) { printf("esc pressed, shutting down aria\n"); Aria::shutdown(); } /*Key Handler for the capture key: capture a picture. */ void jpegHandler(ArNetPacket *packet) { //To write a Laser data file std::vector< ArSensorReading >* readings; std::vector< ArSensorReading >::iterator it; FILE* dataFile; dataFile = fopen("laser_log.txt", "w"); sick.lockDevice(); readings = sick.getRawReadingsAsVector(); for (it = readings->begin(); it != readings->end(); it++) { fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); } sick.unlockDevice(); ArUtil::sleep(100); fclose( dataFile );//closed laser datafile //To store a Image unsigned int width; unsigned int height; static unsigned char jpeg[50000]; int jpegSize; FILE *file; width = packet->bufToUByte2(); height = packet->bufToUByte2(); jpegSize = packet->getDataLength() - packet->getDataReadLength(); if(jpegSize > 50000) { ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image is %d bytes, my buffer is 50000 bytes)", jpegSize); return; } packet->bufToData((char *)jpeg, jpegSize); const char base[]="image", ext[]=".jpg"; char filename[FILENAME_MAX]; //char tmpFilename[128]; sprintf(filename,"%s%d%s", base, no, ext); if ((file = ArUtil::fopen(filename, "wb")) != NULL) { fwrite(jpeg, jpegSize, 1, file); fclose(file); #ifdef WIN32 // On windows, rename() fails if the new file already exists unlink(filename); #endif } else ArLog::log(ArLog::Normal, "Could not write temp file "); char ifile[FILENAME_MAX]; sprintf(ifile, "%s%d%s", base, no, ext); img = cvLoadImage(ifile); cvNamedWindow("image",CV_WINDOW_AUTOSIZE); cvShowImage( "image", img ); //cvReleaseImage(&img); //cvDestroyWindow("image"); cvWaitKey(10); no++; } int main(int argc, char **argv) { /* Aria initialization: */ Aria::init(); /* Aria components use this to get options off the command line: */ ArClientSimpleConnector clientConnector(&parser); parser.loadDefaultArguments(); /* Check for -help, and unhandled arguments: */ if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) { Aria::logOptions(); exit(0); } /* Connect our client object to the remote server: */ if (!clientConnector.connectClient(&client)) { if (client.wasRejected()) printf("Server '%s' rejected connection, exiting\n", client.getHost()); else printf("Could not connect to server '%s', exiting\n", client.getHost()); exit(1); } printf("Connected to server.\n"); client.setRobotName(client.getHost()); // include server name in log messages /* Create a key handler and also tell Aria about it */ ArKeyHandler keyHandler; Aria::setKeyHandler(&keyHandler); /* Global escape-key handler to shut everythnig down */ ArGlobalFunctor escapeCB(&escape); keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); client.addHandler("sendVideo", &jpegHandlerCB); client.runAsync(); /* Create the InputHandler object and request safe-drive mode */ InputHandler inputHandler(&client, &keyHandler); //inputHandler.safeDrive(); /* Use ArClientBase::dataExists() to see if the "ratioDrive" request is available on the * currently connected server. */ if(!client.dataExists("ratioDrive") ) printf("Warning: server does not have ratioDrive command, can not use drive commands!\n"); else printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn Left\nRIGHT: Turn Right\n"); printf("c: Image capture\n\nesc: shut down\n"); while (client.getRunningWithLock()) { keyHandler.checkKeys(); inputHandler.sendInput(); ArUtil::sleep(100); } /* The client stopped running, due to disconnection from the server, general * Aria shutdown, or some other reason. */ client.disconnect(); Aria::shutdown(); return 0; } ________________________________ From: Reed Hedges To: aria-users at lists.mobilerobots.com Sent: Fri, July 9, 2010 1:33:38 AM Subject: Re: [Aria-users] problem with arnlServer Does this always happen, or only sometimes? When it happens, check the indicator lights on the top of the SICK laser, and note the sequence of lights and messages printed by arnlServer. Is the laser off (no indicator lights) before you start arnlServer? Reed On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > Hi all, > > please help to find out solutions for two problems mentioned below. > > > 1. laser isn't getting power when i'm running arnlServer program from > onboard computer... > (but laser works with wander program) > [robot at p3at examples]$ ./arnlServer > Could not connect to simulator, connecting to robot through serial port > /dev/ttyS0. > Syncing 0 > Syncing 1 > Syncing 2 > Connected to robot. > Name: Auckland_3502 > Type: Pioneer > Subtype: p3at-sh > Loaded robot parameters from p3at-sh.p > ArLaserConnector: Using robot params for connecting to laser > > lms2xx_1: waiting for laser to power on. > lms2xx_1: Failed to connect to laser, no poweron received. > lms2xx_1: waiting for laser to power on. > lms2xx_1: Failed to connect to laser, no poweron received. > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > Could not connect to all lasers... exiting > > Disconnecting from robot > > 2. How can i save laser reading and images at the same time. > > Any response from you will be appreciated. > > Best regards > Hossain > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, >FAQ, tips, manuals, and software, firmware and driver downloads. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100709/55ef58d7/attachment-0001.html From reed at mobilerobots.com Fri Jul 9 11:24:54 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Fri, 09 Jul 2010 11:24:54 -0400 Subject: [Aria-users] problem with arnlServer In-Reply-To: <256977.12011.qm@web46414.mail.sp1.yahoo.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> Message-ID: <4C373F46.4030307@mobilerobots.com> Is there any difference in robot when you use serverDemo or arnlServer, or is it the same robot, same computer, etc? Is the switch on the back of the laser in the on position? Hossain, Md.Z wrote: > Hi, > > sorry I missed one question to answer in my previous mail.... > > Indicator light remains off all time and getting this output.. > > [robot at p3at examples]$ ./arnlServer > > Could not connect to simulator, connecting to robot through serial port > > /dev/ttyS0. > > Syncing 0 > > Syncing 1 > > Syncing 2 > > Connected to robot. > > Name: Auckland_3502 > > Type: Pioneer > > Subtype: p3at-sh > > Loaded robot parameters from p3at-sh.p > > ArLaserConnector: Using robot params for connecting to laser > > > > lms2xx_1: waiting for laser to power on. > > lms2xx_1: Failed to connect to laser, no poweron received. > > lms2xx_1: waiting for laser to power on. > > lms2xx_1: Failed to connect to laser, no poweron received. > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > > Could not connect to all lasers... exiting > > > > Disconnecting from robot > > Would you please have a look in my previous mail and give your comments? > > Best regards > hossain > > > ------------------------------------------------------------------------ > *From:* "Hossain, Md.Z" > *To:* "Help, discussion and announcements for MobileRobots' Advanced > Robot Interface for Applications (ARIA) " > > *Sent:* Sat, July 10, 2010 12:36:23 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > Hi Reed > > Thank you very much for your reply. > > Yes always getting same response. but when i use serverDemo from > ArNetworking then it's working perfectly. > > Another problem....i was trying to save a laser txt file and image with > single stock by this client program. and I used serverDemo as my server > program. I am getting image properly but in laser txt file no > data.......please please help.... > > > Code:(client program) > > #include "Aria.h" > #include "ArNetworking.h" > #include "cv.h" > #include "highgui.h" > #include > #include > using namespace std; > IplImage *img=0; > int no=1; > > ArClientBase client; > ArSick sick; > > > class InputHandler > { > public: > /** > * @param client Our client networking object > * @param keyHandler Key handler to register command callbacks with > */ > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > virtual ~InputHandler(void); > > /// Up arrow key handler: drive the robot forward > void up(void); > > /// Down arrow key handler: drive the robot backward > void down(void); > > /// Left arrow key handler: turn the robot left > void left(void); > > /// Right arrow key handler: turn the robot right > void right(void); > > /// Send drive request to the server with stored values > void sendInput(void); > > /// Send a request to enable "safe drive" mode on the server > void imageCapture(); > > protected: > ArClientBase *myClient; > ArKeyHandler *myKeyHandler; > > /// Set this to true in the constructor to print out debugging information > bool myPrinting; > > /// Current translation value (a percentage of the maximum speed) > double myTransRatio; > > /// Current rotation ration value (a percentage of the maximum > rotational velocity) > double myRotRatio; > > > /** Functor objects, given to the key handler, which then call our handler > * methods above */ > ///@{ > ArFunctorC myUpCB; > ArFunctorC myDownCB; > ArFunctorC myLeftCB; > ArFunctorC myRightCB; > ArFunctorC myImageCaptureCB; > > }; > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > *keyHandler) : > myClient(client), myKeyHandler(keyHandler), > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > /* Initialize functor objects with pointers to our handler methods: */ > myUpCB(this, &InputHandler::up), > myDownCB(this, &InputHandler::down), > myLeftCB(this, &InputHandler::left), > myRightCB(this, &InputHandler::right), > myImageCaptureCB(this, &InputHandler::imageCapture) > { > > /* Add our functor objects to the key handler, associated with the > appropriate > * keys: */ > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > } > > InputHandler::~InputHandler(void) > { > > } > > void InputHandler::up(void) > { > if (myPrinting) > printf("Forwards\n"); > myTransRatio = 100; > } > > void InputHandler::down(void) > { > if (myPrinting) > printf("Backwards\n"); > myTransRatio = -100; > } > > void InputHandler::left(void) > { > if (myPrinting) > printf("Left\n"); > myRotRatio = 100; > } > > void InputHandler::right(void) > { > if (myPrinting) > printf("Right\n"); > myRotRatio = -100; > } > > void InputHandler::imageCapture() > { > /* Construct a request packet. The data is a single byte, with value > * 1 to enable safe drive, 0 to disable. */ > ArNetPacket p; > p.uByteToBuf(90); > client.requestOnce("sendVideo", &p); > } > > > void InputHandler::sendInput(void) > { > /* This method is called by the main function to send a ratioDrive > * request with our current velocity values. If the server does > * not support the ratioDrive request, then we abort now: */ > if(!myClient->dataExists("ratioDrive")) return; > /// Send a request to enable "safe drive" mode on the server > void safeDrive(); > /* Construct a ratioDrive request packet. It consists > * of three doubles: translation ratio, rotation ratio, and an overall > scaling > * factor. */ > ArNetPacket packet; > packet.doubleToBuf(myTransRatio); > packet.doubleToBuf(myRotRatio); > packet.doubleToBuf(50); // use half of the robot's maximum. > //packet.doubleToBuf(myLatRatio); > if (myPrinting) > printf("Sending\n"); > myClient->requestOnce("ratioDrive", &packet); > myTransRatio = 0; > myRotRatio = 0; > //myLatRatio = 0; > } > > > > /* Key handler for the escape key: shutdown all of Aria. */ > void escape(void) > { > printf("esc pressed, shutting down aria\n"); > Aria::shutdown(); > } > > /*Key Handler for the capture key: capture a picture. */ > void jpegHandler(ArNetPacket *packet) > { > //To write a Laser data file > std::vector< ArSensorReading >* readings; > std::vector< ArSensorReading >::iterator it; > > FILE* dataFile; > dataFile = fopen("laser_log.txt", "w"); > > sick.lockDevice(); > > readings = sick.getRawReadingsAsVector(); > > for (it = readings->begin(); it != readings->end(); it++) > { > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > } > sick.unlockDevice(); > > ArUtil::sleep(100); > > fclose( dataFile );//closed laser datafile > > //To store a Image > unsigned int width; > unsigned int height; > static unsigned char jpeg[50000]; > int jpegSize; > FILE *file; > > width = packet->bufToUByte2(); > height = packet->bufToUByte2(); > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > if(jpegSize > 50000) > { > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > is %d bytes, my buffer is 50000 bytes)", jpegSize); > return; > } > packet->bufToData((char *)jpeg, jpegSize); > const char base[]="image", ext[]=".jpg"; > char filename[FILENAME_MAX]; > //char tmpFilename[128]; > sprintf(filename,"%s%d%s", base, no, ext); > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > { > fwrite(jpeg, jpegSize, 1, file); > fclose(file); > > #ifdef WIN32 > // On windows, rename() fails if the new file already exists > unlink(filename); > #endif > > } > else > ArLog::log(ArLog::Normal, "Could not write temp file "); > > char ifile[FILENAME_MAX]; > sprintf(ifile, "%s%d%s", base, no, ext); > img = cvLoadImage(ifile); > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > cvShowImage( "image", img ); > //cvReleaseImage(&img); > //cvDestroyWindow("image"); > cvWaitKey(10); > no++; > } > > int main(int argc, char **argv) > { > /* Aria initialization: */ > Aria::init(); > /* Aria components use this to get options off the command line: */ > ArClientSimpleConnector clientConnector(&parser); > > parser.loadDefaultArguments(); > > /* Check for -help, and unhandled arguments: */ > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > { > Aria::logOptions(); > exit(0); > } > > /* Connect our client object to the remote server: */ > if (!clientConnector.connectClient(&client)) > { > if (client.wasRejected()) > printf("Server '%s' rejected connection, exiting\n", > client.getHost()); > else > printf("Could not connect to server '%s', exiting\n", > client.getHost()); > exit(1); > } > > printf("Connected to server.\n"); > > client.setRobotName(client.getHost()); // include server name in log > messages > > /* Create a key handler and also tell Aria about it */ > ArKeyHandler keyHandler; > Aria::setKeyHandler(&keyHandler); > > /* Global escape-key handler to shut everythnig down */ > ArGlobalFunctor escapeCB(&escape); > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > client.addHandler("sendVideo", &jpegHandlerCB); > client.runAsync(); > > /* Create the InputHandler object and request safe-drive mode */ > InputHandler inputHandler(&client, &keyHandler); > //inputHandler.safeDrive(); > > /* Use ArClientBase::dataExists() to see if the "ratioDrive" request > is available on the > * currently connected server. */ > if(!client.dataExists("ratioDrive") ) > printf("Warning: server does not have ratioDrive command, can not > use drive commands!\n"); > else > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > Left\nRIGHT: Turn Right\n"); > printf("c: Image capture\n\nesc: shut down\n"); > > while (client.getRunningWithLock()) > { > keyHandler.checkKeys(); > inputHandler.sendInput(); > ArUtil::sleep(100); > } > > /* The client stopped running, due to disconnection from the server, > general > * Aria shutdown, or some other reason. */ > client.disconnect(); > Aria::shutdown(); > return 0; > } > > ------------------------------------------------------------------------ > *From:* Reed Hedges > *To:* aria-users at lists.mobilerobots.com > *Sent:* Fri, July 9, 2010 1:33:38 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > > Does this always happen, or only sometimes? When it happens, check the > indicator lights on the top of the SICK laser, and note the sequence of > lights and messages printed by arnlServer. Is the laser off (no > indicator lights) before you start arnlServer? > > Reed > > > > On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > > Hi all, > > > > please help to find out solutions for two problems mentioned below. > > > > > > 1. laser isn't getting power when i'm running arnlServer program from > > onboard computer... > > (but laser works with wander program) > > [robot at p3at examples]$ ./arnlServer > > Could not connect to simulator, connecting to robot through serial port > > /dev/ttyS0. > > Syncing 0 > > Syncing 1 > > Syncing 2 > > Connected to robot. > > Name: Auckland_3502 > > Type: Pioneer > > Subtype: p3at-sh > > Loaded robot parameters from p3at-sh.p > > ArLaserConnector: Using robot params for connecting to laser > > > > lms2xx_1: waiting for laser to power on. > > lms2xx_1: Failed to connect to laser, no poweron received. > > lms2xx_1: waiting for laser to power on. > > lms2xx_1: Failed to connect to laser, no poweron received. > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > > Could not connect to all lasers... exiting > > > > Disconnecting from robot > > > > 2. How can i save laser reading and images at the same time. > > > > Any response from you will be appreciated. > > > > Best regards > > Hossain > > > > > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > >> http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > >> Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From zhossain.kuet at yahoo.com Fri Jul 9 11:45:48 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Fri, 9 Jul 2010 08:45:48 -0700 (PDT) Subject: [Aria-users] problem with arnlServer In-Reply-To: <4C373F46.4030307@mobilerobots.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> <4C373F46.4030307@mobilerobots.com> Message-ID: <819886.98212.qm@web46405.mail.sp1.yahoo.com> thank you once again. everything same...and trying same time...i mean one after another...serverDemo works other one doesn't. Another problem....i was trying to save a laser txt file and image with single stock by below client program. and I used serverDemo as my server program. I am getting image properly but in laser txt file no data.......please please help.... Code:(client program) #include "Aria.h" #include "ArNetworking.h" #include "cv.h" #include "highgui.h" #include #include using namespace std; IplImage *img=0; int no=1; ArClientBase client; ArSick sick; class InputHandler { public: /** * @param client Our client networking object * @param keyHandler Key handler to register command callbacks with */ InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); virtual ~InputHandler(void); /// Up arrow key handler: drive the robot forward void up(void); /// Down arrow key handler: drive the robot backward void down(void); /// Left arrow key handler: turn the robot left void left(void); /// Right arrow key handler: turn the robot right void right(void); /// Send drive request to the server with stored values void sendInput(void); /// Send a request to enable "safe drive" mode on the server void imageCapture(); protected: ArClientBase *myClient; ArKeyHandler *myKeyHandler; /// Set this to true in the constructor to print out debugging information bool myPrinting; /// Current translation value (a percentage of the maximum speed) double myTransRatio; /// Current rotation ration value (a percentage of the maximum rotational velocity) double myRotRatio; /** Functor objects, given to the key handler, which then call our handler * methods above */ ///@{ ArFunctorC myUpCB; ArFunctorC myDownCB; ArFunctorC myLeftCB; ArFunctorC myRightCB; ArFunctorC myImageCaptureCB; }; InputHandler::InputHandler(ArClientBase *client, ArKeyHandler *keyHandler) : myClient(client), myKeyHandler(keyHandler), myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), /* Initialize functor objects with pointers to our handler methods: */ myUpCB(this, &InputHandler::up), myDownCB(this, &InputHandler::down), myLeftCB(this, &InputHandler::left), myRightCB(this, &InputHandler::right), myImageCaptureCB(this, &InputHandler::imageCapture) { /* Add our functor objects to the key handler, associated with the appropriate * keys: */ myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); myKeyHandler->addKeyHandler('c', &myImageCaptureCB); } InputHandler::~InputHandler(void) { } void InputHandler::up(void) { if (myPrinting) printf("Forwards\n"); myTransRatio = 100; } void InputHandler::down(void) { if (myPrinting) printf("Backwards\n"); myTransRatio = -100; } void InputHandler::left(void) { if (myPrinting) printf("Left\n"); myRotRatio = 100; } void InputHandler::right(void) { if (myPrinting) printf("Right\n"); myRotRatio = -100; } void InputHandler::imageCapture() { /* Construct a request packet. The data is a single byte, with value * 1 to enable safe drive, 0 to disable. */ ArNetPacket p; p.uByteToBuf(90); client.requestOnce("sendVideo", &p); } void InputHandler::sendInput(void) { /* This method is called by the main function to send a ratioDrive * request with our current velocity values. If the server does * not support the ratioDrive request, then we abort now: */ if(!myClient->dataExists("ratioDrive")) return; /// Send a request to enable "safe drive" mode on the server void safeDrive(); /* Construct a ratioDrive request packet. It consists * of three doubles: translation ratio, rotation ratio, and an overall scaling * factor. */ ArNetPacket packet; packet.doubleToBuf(myTransRatio); packet.doubleToBuf(myRotRatio); packet.doubleToBuf(50); // use half of the robot's maximum. //packet.doubleToBuf(myLatRatio); if (myPrinting) printf("Sending\n"); myClient->requestOnce("ratioDrive", &packet); myTransRatio = 0; myRotRatio = 0; //myLatRatio = 0; } /* Key handler for the escape key: shutdown all of Aria. */ void escape(void) { printf("esc pressed, shutting down aria\n"); Aria::shutdown(); } /*Key Handler for the capture key: capture a picture. */ void jpegHandler(ArNetPacket *packet) { //To write a Laser data file std::vector< ArSensorReading >* readings; std::vector< ArSensorReading >::iterator it; FILE* dataFile; dataFile = fopen("laser_log.txt", "w"); sick.lockDevice(); readings = sick.getRawReadingsAsVector(); for (it = readings->begin(); it != readings->end(); it++) { fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); } sick.unlockDevice(); ArUtil::sleep(100); fclose( dataFile );//closed laser datafile //To store a Image unsigned int width; unsigned int height; static unsigned char jpeg[50000]; int jpegSize; FILE *file; width = packet->bufToUByte2(); height = packet->bufToUByte2(); jpegSize = packet->getDataLength() - packet->getDataReadLength(); if(jpegSize > 50000) { ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image is %d bytes, my buffer is 50000 bytes)", jpegSize); return; } packet->bufToData((char *)jpeg, jpegSize); const char base[]="image", ext[]=".jpg"; char filename[FILENAME_MAX]; //char tmpFilename[128]; sprintf(filename,"%s%d%s", base, no, ext); if ((file = ArUtil::fopen(filename, "wb")) != NULL) { fwrite(jpeg, jpegSize, 1, file); fclose(file); #ifdef WIN32 // On windows, rename() fails if the new file already exists unlink(filename); #endif } else ArLog::log(ArLog::Normal, "Could not write temp file "); char ifile[FILENAME_MAX]; sprintf(ifile, "%s%d%s", base, no, ext); img = cvLoadImage(ifile); cvNamedWindow("image",CV_WINDOW_AUTOSIZE); cvShowImage( "image", img ); //cvReleaseImage(&img); //cvDestroyWindow("image"); cvWaitKey(10); no++; } int main(int argc, char **argv) { /* Aria initialization: */ Aria::init(); /* Aria components use this to get options off the command line: */ ArClientSimpleConnector clientConnector(&parser); parser.loadDefaultArguments(); /* Check for -help, and unhandled arguments: */ if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) { Aria::logOptions(); exit(0); } /* Connect our client object to the remote server: */ if (!clientConnector.connectClient(&client)) { if (client.wasRejected()) printf("Server '%s' rejected connection, exiting\n", client.getHost()); else printf("Could not connect to server '%s', exiting\n", client.getHost()); exit(1); } printf("Connected to server.\n"); client.setRobotName(client.getHost()); // include server name in log messages /* Create a key handler and also tell Aria about it */ ArKeyHandler keyHandler; Aria::setKeyHandler(&keyHandler); /* Global escape-key handler to shut everythnig down */ ArGlobalFunctor escapeCB(&escape); keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); client.addHandler("sendVideo", &jpegHandlerCB); client.runAsync(); /* Create the InputHandler object and request safe-drive mode */ InputHandler inputHandler(&client, &keyHandler); //inputHandler.safeDrive(); /* Use ArClientBase::dataExists() to see if the "ratioDrive" request is available on the * currently connected server. */ if(!client.dataExists("ratioDrive") ) printf("Warning: server does not have ratioDrive command, can not use drive commands!\n"); else printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn Left\nRIGHT: Turn Right\n"); printf("c: Image capture\n\nesc: shut down\n"); while (client.getRunningWithLock()) { keyHandler.checkKeys(); inputHandler.sendInput(); ArUtil::sleep(100); } /* The client stopped running, due to disconnection from the server, general * Aria shutdown, or some other reason. */ client.disconnect(); Aria::shutdown(); return 0; } ________________________________ From: Reed Hedges To: "Help, discussion and announcements for MobileRobots' Advanced Robot Interface for Applications (ARIA) " Sent: Sat, July 10, 2010 3:24:54 AM Subject: Re: [Aria-users] problem with arnlServer Is there any difference in robot when you use serverDemo or arnlServer, or is it the same robot, same computer, etc? Is the switch on the back of the laser in the on position? Hossain, Md.Z wrote: > Hi, > > sorry I missed one question to answer in my previous mail.... > > Indicator light remains off all time and getting this output.. > > [robot at p3at examples]$ ./arnlServer > > Could not connect to simulator, connecting to robot through serial port > > /dev/ttyS0. > > Syncing 0 > > Syncing 1 > > Syncing 2 > > Connected to robot. > > Name: Auckland_3502 > > Type: Pioneer > > Subtype: p3at-sh > > Loaded robot parameters from p3at-sh.p > > ArLaserConnector: Using robot params for connecting to laser > > > > lms2xx_1: waiting for laser to power on. > > lms2xx_1: Failed to connect to laser, no poweron received. > > lms2xx_1: waiting for laser to power on. > > lms2xx_1: Failed to connect to laser, no poweron received. > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > > Could not connect to all lasers... exiting > > > > Disconnecting from robot > > Would you please have a look in my previous mail and give your comments? > > Best regards > hossain > > > ------------------------------------------------------------------------ > *From:* "Hossain, Md.Z" > *To:* "Help, discussion and announcements for MobileRobots' Advanced > Robot Interface for Applications (ARIA) " > > *Sent:* Sat, July 10, 2010 12:36:23 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > Hi Reed > > Thank you very much for your reply. > > Yes always getting same response. but when i use serverDemo from > ArNetworking then it's working perfectly. > > Another problem....i was trying to save a laser txt file and image with > single stock by this client program. and I used serverDemo as my server > program. I am getting image properly but in laser txt file no > data.......please please help.... > > > Code:(client program) > > #include "Aria.h" > #include "ArNetworking.h" > #include "cv.h" > #include "highgui.h" > #include > #include > using namespace std; > IplImage *img=0; > int no=1; > > ArClientBase client; > ArSick sick; > > > class InputHandler > { > public: > /** > * @param client Our client networking object > * @param keyHandler Key handler to register command callbacks with > */ > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > virtual ~InputHandler(void); > > /// Up arrow key handler: drive the robot forward > void up(void); > > /// Down arrow key handler: drive the robot backward > void down(void); > > /// Left arrow key handler: turn the robot left > void left(void); > > /// Right arrow key handler: turn the robot right > void right(void); > > /// Send drive request to the server with stored values > void sendInput(void); > > /// Send a request to enable "safe drive" mode on the server > void imageCapture(); > > protected: > ArClientBase *myClient; > ArKeyHandler *myKeyHandler; > > /// Set this to true in the constructor to print out debugging information > bool myPrinting; > > /// Current translation value (a percentage of the maximum speed) > double myTransRatio; > > /// Current rotation ration value (a percentage of the maximum > rotational velocity) > double myRotRatio; > > > /** Functor objects, given to the key handler, which then call our handler > * methods above */ > ///@{ > ArFunctorC myUpCB; > ArFunctorC myDownCB; > ArFunctorC myLeftCB; > ArFunctorC myRightCB; > ArFunctorC myImageCaptureCB; > > }; > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > *keyHandler) : > myClient(client), myKeyHandler(keyHandler), > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > /* Initialize functor objects with pointers to our handler methods: */ > myUpCB(this, &InputHandler::up), > myDownCB(this, &InputHandler::down), > myLeftCB(this, &InputHandler::left), > myRightCB(this, &InputHandler::right), > myImageCaptureCB(this, &InputHandler::imageCapture) > { > > /* Add our functor objects to the key handler, associated with the > appropriate > * keys: */ > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > } > > InputHandler::~InputHandler(void) > { > > } > > void InputHandler::up(void) > { > if (myPrinting) > printf("Forwards\n"); > myTransRatio = 100; > } > > void InputHandler::down(void) > { > if (myPrinting) > printf("Backwards\n"); > myTransRatio = -100; > } > > void InputHandler::left(void) > { > if (myPrinting) > printf("Left\n"); > myRotRatio = 100; > } > > void InputHandler::right(void) > { > if (myPrinting) > printf("Right\n"); > myRotRatio = -100; > } > > void InputHandler::imageCapture() > { > /* Construct a request packet. The data is a single byte, with value > * 1 to enable safe drive, 0 to disable. */ > ArNetPacket p; > p.uByteToBuf(90); > client.requestOnce("sendVideo", &p); > } > > > void InputHandler::sendInput(void) > { > /* This method is called by the main function to send a ratioDrive > * request with our current velocity values. If the server does > * not support the ratioDrive request, then we abort now: */ > if(!myClient->dataExists("ratioDrive")) return; > /// Send a request to enable "safe drive" mode on the server > void safeDrive(); > /* Construct a ratioDrive request packet. It consists > * of three doubles: translation ratio, rotation ratio, and an overall > scaling > * factor. */ > ArNetPacket packet; > packet.doubleToBuf(myTransRatio); > packet.doubleToBuf(myRotRatio); > packet.doubleToBuf(50); // use half of the robot's maximum. > //packet.doubleToBuf(myLatRatio); > if (myPrinting) > printf("Sending\n"); > myClient->requestOnce("ratioDrive", &packet); > myTransRatio = 0; > myRotRatio = 0; > //myLatRatio = 0; > } > > > > /* Key handler for the escape key: shutdown all of Aria. */ > void escape(void) > { > printf("esc pressed, shutting down aria\n"); > Aria::shutdown(); > } > > /*Key Handler for the capture key: capture a picture. */ > void jpegHandler(ArNetPacket *packet) > { > //To write a Laser data file > std::vector< ArSensorReading >* readings; > std::vector< ArSensorReading >::iterator it; > > FILE* dataFile; > dataFile = fopen("laser_log.txt", "w"); > > sick.lockDevice(); > > readings = sick.getRawReadingsAsVector(); > > for (it = readings->begin(); it != readings->end(); it++) > { > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > } > sick.unlockDevice(); > > ArUtil::sleep(100); > > fclose( dataFile );//closed laser datafile > > //To store a Image > unsigned int width; > unsigned int height; > static unsigned char jpeg[50000]; > int jpegSize; > FILE *file; > > width = packet->bufToUByte2(); > height = packet->bufToUByte2(); > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > if(jpegSize > 50000) > { > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > is %d bytes, my buffer is 50000 bytes)", jpegSize); > return; > } > packet->bufToData((char *)jpeg, jpegSize); > const char base[]="image", ext[]=".jpg"; > char filename[FILENAME_MAX]; > //char tmpFilename[128]; > sprintf(filename,"%s%d%s", base, no, ext); > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > { > fwrite(jpeg, jpegSize, 1, file); > fclose(file); > > #ifdef WIN32 > // On windows, rename() fails if the new file already exists > unlink(filename); > #endif > > } > else > ArLog::log(ArLog::Normal, "Could not write temp file "); > > char ifile[FILENAME_MAX]; > sprintf(ifile, "%s%d%s", base, no, ext); > img = cvLoadImage(ifile); > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > cvShowImage( "image", img ); > //cvReleaseImage(&img); > //cvDestroyWindow("image"); > cvWaitKey(10); > no++; > } > > int main(int argc, char **argv) > { > /* Aria initialization: */ > Aria::init(); > /* Aria components use this to get options off the command line: */ > ArClientSimpleConnector clientConnector(&parser); > > parser.loadDefaultArguments(); > > /* Check for -help, and unhandled arguments: */ > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > { > Aria::logOptions(); > exit(0); > } > > /* Connect our client object to the remote server: */ > if (!clientConnector.connectClient(&client)) > { > if (client.wasRejected()) > printf("Server '%s' rejected connection, exiting\n", > client.getHost()); > else > printf("Could not connect to server '%s', exiting\n", > client.getHost()); > exit(1); > } > > printf("Connected to server.\n"); > > client.setRobotName(client.getHost()); // include server name in log > messages > > /* Create a key handler and also tell Aria about it */ > ArKeyHandler keyHandler; > Aria::setKeyHandler(&keyHandler); > > /* Global escape-key handler to shut everythnig down */ > ArGlobalFunctor escapeCB(&escape); > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > client.addHandler("sendVideo", &jpegHandlerCB); > client.runAsync(); > > /* Create the InputHandler object and request safe-drive mode */ > InputHandler inputHandler(&client, &keyHandler); > //inputHandler.safeDrive(); > > /* Use ArClientBase::dataExists() to see if the "ratioDrive" request > is available on the > * currently connected server. */ > if(!client.dataExists("ratioDrive") ) > printf("Warning: server does not have ratioDrive command, can not > use drive commands!\n"); > else > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > Left\nRIGHT: Turn Right\n"); > printf("c: Image capture\n\nesc: shut down\n"); > > while (client.getRunningWithLock()) > { > keyHandler.checkKeys(); > inputHandler.sendInput(); > ArUtil::sleep(100); > } > > /* The client stopped running, due to disconnection from the server, > general > * Aria shutdown, or some other reason. */ > client.disconnect(); > Aria::shutdown(); > return 0; > } > > ------------------------------------------------------------------------ > *From:* Reed Hedges > *To:* aria-users at lists.mobilerobots.com > *Sent:* Fri, July 9, 2010 1:33:38 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > > Does this always happen, or only sometimes? When it happens, check the > indicator lights on the top of the SICK laser, and note the sequence of > lights and messages printed by arnlServer. Is the laser off (no > indicator lights) before you start arnlServer? > > Reed > > > > On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > > Hi all, > > > > please help to find out solutions for two problems mentioned below. > > > > > > 1. laser isn't getting power when i'm running arnlServer program from > > onboard computer... > > (but laser works with wander program) > > [robot at p3at examples]$ ./arnlServer > > Could not connect to simulator, connecting to robot through serial port > > /dev/ttyS0. > > Syncing 0 > > Syncing 1 > > Syncing 2 > > Connected to robot. > > Name: Auckland_3502 > > Type: Pioneer > > Subtype: p3at-sh > > Loaded robot parameters from p3at-sh.p > > ArLaserConnector: Using robot params for connecting to laser > > > > lms2xx_1: waiting for laser to power on. > > lms2xx_1: Failed to connect to laser, no poweron received. > > lms2xx_1: waiting for laser to power on. > > lms2xx_1: Failed to connect to laser, no poweron received. > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > > Could not connect to all lasers... exiting > > > > Disconnecting from robot > > > > 2. How can i save laser reading and images at the same time. > > > > Any response from you will be appreciated. > > > > Best regards > > Hossain > > > > > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > >> http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > >> Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, >FAQ, tips, manuals, and software, firmware and driver downloads. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100709/9b5e220c/attachment-0001.html From reed at mobilerobots.com Fri Jul 9 12:07:54 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Fri, 09 Jul 2010 12:07:54 -0400 Subject: [Aria-users] problem with arnlServer In-Reply-To: <819886.98212.qm@web46405.mail.sp1.yahoo.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> <4C373F46.4030307@mobilerobots.com> <819886.98212.qm@web46405.mail.sp1.yahoo.com> Message-ID: <4C37495A.4080005@mobilerobots.com> serverDemo does not normally support any video requests unless you have modified it. Since your laser log is written in the video image handler, it would only happen if the server responds with a video image. You can add video serving of your own design to serverDemo (responding to getPictureCam1 or sendVideo requests), or you can add a ArHybridForwarderVideo object, and run savServer or ACTS before running serverDemo. You can check whether the server has the sendVideo request or not. (Newer ones have "getPictureCam1" instead, which is a newer scheme to allow for multiple cameras and other options as well.) if (client.dataExists("getPictureCam1")) { client.requestOnce("getPictureCam1"); } else if(client.dataExists("sendVideo")) { client.requestOnce("sendVideo"); } else { ArLog::log("Error, server does not support video requests"); } Also, note you don't need to supply a packet with the sendVideo request. > Another problem....i was trying to save a laser txt file and image with > single stock by below client program. and I used serverDemo as my server > program. I am getting image properly but in laser txt file no > data.......please please help.... > > Code:(client program) > > #include "Aria.h" > #include "ArNetworking.h" > #include "cv.h" > #include "highgui.h" > #include > #include > using namespace std; > IplImage *img=0; > int no=1; > > ArClientBase client; > ArSick sick; > > > class InputHandler > { > public: > /** > * @param client Our client networking object > * @param keyHandler Key handler to register command callbacks with > */ > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > virtual ~InputHandler(void); > > /// Up arrow key handler: drive the robot forward > void up(void); > > /// Down arrow key handler: drive the robot backward > void down(void); > > /// Left arrow key handler: turn the robot left > void left(void); > > > /// Right arrow key handler: turn the robot right > void right(void); > > /// Send drive request to the server with stored values > void sendInput(void); > > /// Send a request to enable "safe drive" mode on the server > void imageCapture(); > > protected: > ArClientBase *myClient; > ArKeyHandler *myKeyHandler; > > /// Set this to true in the constructor to print out debugging information > bool myPrinting; > > /// Current translation value (a percentage of the maximum speed) > double myTransRatio; > > /// Current rotation ration value (a percentage of the maximum rotational > velocity) > double myRotRatio; > > > /** Functor objects, given to the key handler, which then call our handler > * methods above */ > ///@{ > ArFunctorC myUpCB; > ArFunctorC myDownCB; > ArFunctorC myLeftCB; > ArFunctorC > myRightCB; > ArFunctorC myImageCaptureCB; > > }; > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler *keyHandler) : > myClient(client), myKeyHandler(keyHandler), > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > /* Initialize functor objects with pointers to our handler methods: */ > myUpCB(this, &InputHandler::up), > myDownCB(this, &InputHandler::down), > myLeftCB(this, &InputHandler::left), > myRightCB(this, &InputHandler::right), > myImageCaptureCB(this, &InputHandler::imageCapture) > { > > /* Add our functor objects to the key handler, associated with the appropriate > * keys: */ > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > } > > InputHandler::~InputHandler(void) > { > > } > > void InputHandler::up(void) > { > if (myPrinting) > printf("Forwards\n"); > myTransRatio = 100; > } > > void InputHandler::down(void) > { > if (myPrinting) > printf("Backwards\n"); > myTransRatio = -100; > } > > void InputHandler::left(void) > { > if (myPrinting) > printf("Left\n"); > myRotRatio = 100; > } > > void InputHandler::right(void) > { > if (myPrinting) > printf("Right\n"); > myRotRatio = -100; > } > > void InputHandler::imageCapture() > { > /* Construct a request packet. The data is a single byte, with value > * 1 to enable safe drive, 0 to disable. */ > ArNetPacket p; > p.uByteToBuf(90); > client.requestOnce("sendVideo", &p); > } > > > void > InputHandler::sendInput(void) > { > /* This method is called by the main function to send a ratioDrive > * request with our current velocity values. If the server does > * not support the ratioDrive request, then we abort now: */ > if(!myClient->dataExists("ratioDrive")) return; > /// Send a request to enable "safe drive" mode on the server > void safeDrive(); > /* Construct a ratioDrive request packet. It consists > * of three doubles: translation ratio, rotation ratio, and an overall scaling > * factor. */ > ArNetPacket packet; > packet.doubleToBuf(myTransRatio); > packet.doubleToBuf(myRotRatio); > packet.doubleToBuf(50); // use half of the robot's maximum. > //packet.doubleToBuf(myLatRatio); > if (myPrinting) > printf("Sending\n"); > myClient->requestOnce("ratioDrive", &packet); > myTransRatio = 0; > myRotRatio = 0; > //myLatRatio = 0; > } > > > > /* Key handler for > the escape key: shutdown all of Aria. */ > void escape(void) > { > printf("esc pressed, shutting down aria\n"); > Aria::shutdown(); > } > > /*Key Handler for the capture key: capture a picture. */ > void jpegHandler(ArNetPacket *packet) > { > //To write a Laser data file > std::vector< ArSensorReading >* readings; > std::vector< ArSensorReading >::iterator it; > > FILE* dataFile; > dataFile = fopen("laser_log.txt", "w"); > > sick.lockDevice(); > > readings = sick.getRawReadingsAsVector(); > > for (it = readings->begin(); it != readings->end(); it++) > { > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > } > sick.unlockDevice(); > > ArUtil::sleep(100); > > fclose( dataFile );//closed laser datafile > > //To store a Image > unsigned int width; > unsigned int height; > static unsigned char jpeg[50000]; > int jpegSize; > > FILE *file; > > width = packet->bufToUByte2(); > height = packet->bufToUByte2(); > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > if(jpegSize > 50000) > { > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image is %d > bytes, my buffer is 50000 bytes)", jpegSize); > return; > } > packet->bufToData((char *)jpeg, jpegSize); > const char base[]="image", ext[]=".jpg"; > char filename[FILENAME_MAX]; > //char tmpFilename[128]; > sprintf(filename,"%s%d%s", base, no, ext); > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > { > fwrite(jpeg, jpegSize, 1, file); > fclose(file); > > #ifdef WIN32 > // On windows, rename() fails if the new file already exists > unlink(filename); > #endif > > } > else > ArLog::log(ArLog::Normal, "Could not write temp file "); > > char ifile[FILENAME_MAX]; > > sprintf(ifile, "%s%d%s", base, no, ext); > img = cvLoadImage(ifile); > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > cvShowImage( "image", img ); > //cvReleaseImage(&img); > //cvDestroyWindow("image"); > cvWaitKey(10); > no++; > } > > int main(int argc, char **argv) > { > /* Aria initialization: */ > Aria::init(); > /* Aria components use this to get options off the command line: */ > ArClientSimpleConnector clientConnector(&parser); > > parser.loadDefaultArguments(); > > /* Check for -help, and unhandled arguments: */ > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > { > Aria::logOptions(); > exit(0); > } > > /* Connect our client object to the remote server: */ > if (!clientConnector.connectClient(&client)) > { > if (client.wasRejected()) > printf("Server '%s' rejected connection, exiting\n", > client.getHost()); > else > printf("Could not connect to server '%s', exiting\n", client.getHost()); > exit(1); > } > > printf("Connected to server.\n"); > > client.setRobotName(client.getHost()); // include server name in log messages > > /* Create a key handler and also tell Aria about it */ > ArKeyHandler keyHandler; > Aria::setKeyHandler(&keyHandler); > > /* Global escape-key handler to shut everythnig down */ > ArGlobalFunctor escapeCB(&escape); > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > client.addHandler("sendVideo", &jpegHandlerCB); > client.runAsync(); > > /* Create the InputHandler object and request safe-drive mode */ > InputHandler inputHandler(&client, &keyHandler); > //inputHandler.safeDrive(); > > /* Use ArClientBase::dataExists() to see if the > "ratioDrive" request is > available on the > > * currently connected server. */ > if(!client.dataExists("ratioDrive") ) > printf("Warning: server does not have ratioDrive command, can not use > drive commands!\n"); > else > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn Left\nRIGHT: > Turn Right\n"); > printf("c: Image capture\n\nesc: shut down\n"); > > while (client.getRunningWithLock()) > { > keyHandler.checkKeys(); > inputHandler.sendInput(); > ArUtil::sleep(100); > } > > /* The client stopped running, due to disconnection from the server, general > * Aria shutdown, or some other reason. */ > client.disconnect(); > Aria::shutdown(); > return 0; > } > > > > ------------------------------------------------------------------------ > *From:* Reed Hedges > *To:* "Help, discussion and announcements for MobileRobots' Advanced > Robot Interface for Applications (ARIA) " > > *Sent:* Sat, July 10, 2010 3:24:54 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > > Is there any difference in robot when you use serverDemo or arnlServer, > or is it > the same robot, same computer, etc? Is the switch on the back of the > laser in > the on position? > > Hossain, Md.Z wrote: > > Hi, > > > > sorry I missed one question to answer in my previous mail.... > > > > Indicator light remains off all time and getting this output.. > > > > [robot at p3at examples]$ ./arnlServer > > > Could not connect to simulator, connecting to robot through serial > port > > > /dev/ttyS0. > > > Syncing 0 > > > Syncing 1 > > > Syncing 2 > > > Connected to robot. > > > Name: Auckland_3502 > > > Type: Pioneer > > > Subtype: p3at-sh > > > Loaded robot parameters from p3at-sh.p > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > lms2xx_1: waiting for laser to power on. > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > lms2xx_1: waiting for laser to power on. > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > > > Could not connect to all lasers... exiting > > > > > > Disconnecting from robot > > > > Would you please have a look in my previous mail and give your comments? > > > > Best regards > > hossain > > > > > > ------------------------------------------------------------------------ > > *From:* "Hossain, Md.Z" > > > *To:* "Help, discussion and announcements for MobileRobots' Advanced > > Robot Interface for Applications (ARIA) " > > > > > *Sent:* Sat, July 10, 2010 12:36:23 AM > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > Hi Reed > > > > Thank you very much for your reply. > > > > Yes always getting same response. but when i use serverDemo from > > ArNetworking then it's working perfectly. > > > > Another problem....i was trying to save a laser txt file and image with > > single stock by this client program. and I used serverDemo as my server > > program. I am getting image properly but in laser txt file no > > data.......please please help.... > > > > > > Code:(client program) > > > > #include "Aria.h" > > #include "ArNetworking.h" > > #include "cv.h" > > #include "highgui.h" > > #include > > #include > > using namespace std; > > IplImage *img=0; > > int no=1; > > > > ArClientBase client; > > ArSick sick; > > > > > > class InputHandler > > { > > public: > > /** > > * @param client Our client networking object > > * @param keyHandler Key handler to register command callbacks with > > */ > > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > > virtual ~InputHandler(void); > > > > /// Up arrow key handler: drive the robot forward > > void up(void); > > > > /// Down arrow key handler: drive the robot backward > > void down(void); > > > > /// Left arrow key handler: turn the robot left > > void left(void); > > > > /// Right arrow key handler: turn the robot right > > void right(void); > > > > /// Send drive request to the server with stored values > > void sendInput(void); > > > > /// Send a request to enable "safe drive" mode on the server > > void imageCapture(); > > > > protected: > > ArClientBase *myClient; > > ArKeyHandler *myKeyHandler; > > > > /// Set this to true in the constructor to print out debugging > information > > bool myPrinting; > > > > /// Current translation value (a percentage of the maximum speed) > > double myTransRatio; > > > > /// Current rotation ration value (a percentage of the maximum > > rotational velocity) > > double myRotRatio; > > > > > > /** Functor objects, given to the key handler, which then call our > handler > > * methods above */ > > ///@{ > > ArFunctorC myUpCB; > > ArFunctorC myDownCB; > > ArFunctorC myLeftCB; > > ArFunctorC myRightCB; > > ArFunctorC myImageCaptureCB; > > > > }; > > > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > > *keyHandler) : > > myClient(client), myKeyHandler(keyHandler), > > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > > > /* Initialize functor objects with pointers to our handler methods: */ > > myUpCB(this, &InputHandler::up), > > myDownCB(this, &InputHandler::down), > > myLeftCB(this, &InputHandler::left), > > myRightCB(this, &InputHandler::right), > > myImageCaptureCB(this, &InputHandler::imageCapture) > > { > > > > /* Add our functor objects to the key handler, associated with the > > appropriate > > * keys: */ > > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > > } > > > > InputHandler::~InputHandler(void) > > { > > > > } > > > > void InputHandler::up(void) > > { > > if (myPrinting) > > printf("Forwards\n"); > > myTransRatio = 100; > > } > > > > void InputHandler::down(void) > > { > > if (myPrinting) > > printf("Backwards\n"); > > myTransRatio = -100; > > } > > > > void InputHandler::left(void) > > { > > if (myPrinting) > > printf("Left\n"); > > myRotRatio = 100; > > } > > > > void InputHandler::right(void) > > { > > if (myPrinting) > > printf("Right\n"); > > myRotRatio = -100; > > } > > > > void InputHandler::imageCapture() > > { > > /* Construct a request packet. The data is a single byte, with value > > * 1 to enable safe drive, 0 to disable. */ > > ArNetPacket p; > > p.uByteToBuf(90); > > client.requestOnce("sendVideo", &p); > > } > > > > > > void InputHandler::sendInput(void) > > { > > /* This method is called by the main function to send a ratioDrive > > * request with our current velocity values. If the server does > > * not support the ratioDrive request, then we abort now: */ > > if(!myClient->dataExists("ratioDrive")) return; > > /// Send a request to enable "safe drive" mode on the server > > void safeDrive(); > > /* Construct a ratioDrive request packet. It consists > > * of three doubles: translation ratio, rotation ratio, and an overall > > scaling > > * factor. */ > > ArNetPacket packet; > > packet.doubleToBuf(myTransRatio); > > packet.doubleToBuf(myRotRatio); > > packet.doubleToBuf(50); // use half of the robot's maximum. > > //packet.doubleToBuf(myLatRatio); > > if (myPrinting) > > printf("Sending\n"); > > myClient->requestOnce("ratioDrive", &packet); > > myTransRatio = 0; > > myRotRatio = 0; > > //myLatRatio = 0; > > } > > > > > > > > /* Key handler for the escape key: shutdown all of Aria. */ > > void escape(void) > > { > > printf("esc pressed, shutting down aria\n"); > > Aria::shutdown(); > > } > > > > /*Key Handler for the capture key: capture a picture. */ > > void jpegHandler(ArNetPacket *packet) > > { > > //To write a Laser data file > > std::vector< ArSensorReading >* readings; > > std::vector< ArSensorReading >::iterator it; > > > > FILE* dataFile; > > dataFile = fopen("laser_log.txt", "w"); > > > > sick.lockDevice(); > > > > readings = sick.getRawReadingsAsVector(); > > > > for (it = readings->begin(); it != readings->end(); it++) > > { > > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > > } > > sick.unlockDevice(); > > > > ArUtil::sleep(100); > > > > fclose( dataFile );//closed laser datafile > > > > //To store a Image > > unsigned int width; > > unsigned int height; > > static unsigned char jpeg[50000]; > > int jpegSize; > > FILE *file; > > > > width = packet->bufToUByte2(); > > height = packet->bufToUByte2(); > > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > > if(jpegSize > 50000) > > { > > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > > is %d bytes, my buffer is 50000 bytes)", jpegSize); > > return; > > } > > packet->bufToData((char *)jpeg, jpegSize); > > const char base[]="image", ext[]=".jpg"; > > char filename[FILENAME_MAX]; > > //char tmpFilename[128]; > > sprintf(filename,"%s%d%s", base, no, ext); > > > > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > > { > > fwrite(jpeg, jpegSize, 1, file); > > fclose(file); > > > > #ifdef WIN32 > > // On windows, rename() fails if the new file already exists > > unlink(filename); > > #endif > > > > } > > else > > ArLog::log(ArLog::Normal, "Could not write temp file "); > > > > char ifile[FILENAME_MAX]; > > sprintf(ifile, "%s%d%s", base, no, ext); > > img = cvLoadImage(ifile); > > > > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > > cvShowImage( "image", img ); > > //cvReleaseImage(&img); > > //cvDestroyWindow("image"); > > cvWaitKey(10); > > no++; > > } > > > > int main(int argc, char **argv) > > { > > /* Aria initialization: */ > > Aria::init(); > > /* Aria components use this to get options off the command line: */ > > ArClientSimpleConnector clientConnector(&parser); > > > > parser.loadDefaultArguments(); > > > > /* Check for -help, and unhandled arguments: */ > > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > > { > > Aria::logOptions(); > > exit(0); > > } > > > > /* Connect our client object to the remote server: */ > > if (!clientConnector.connectClient(&client)) > > { > > if (client.wasRejected()) > > printf("Server '%s' rejected connection, exiting\n", > > client.getHost()); > > else > > printf("Could not connect to server '%s', exiting\n", > > client.getHost()); > > exit(1); > > } > > > > printf("Connected to server.\n"); > > > > client.setRobotName(client.getHost()); // include server name in log > > messages > > > > /* Create a key handler and also tell Aria about it */ > > ArKeyHandler keyHandler; > > Aria::setKeyHandler(&keyHandler); > > > > /* Global escape-key handler to shut everythnig down */ > > ArGlobalFunctor escapeCB(&escape); > > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > > client.addHandler("sendVideo", &jpegHandlerCB); > > client.runAsync(); > > > > /* Create the InputHandler object and request safe-drive mode */ > > InputHandler inputHandler(&client, &keyHandler); > > //inputHandler.safeDrive(); > > > > /* Use ArClientBase::dataExists() to see if the "ratioDrive" request > > is available on the > > * currently connected server. */ > > if(!client.dataExists("ratioDrive") ) > > printf("Warning: server does not have ratioDrive command, can not > > use drive commands!\n"); > > else > > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > > Left\nRIGHT: Turn Right\n"); > > printf("c: Image capture\n\nesc: shut down\n"); > > > > while (client.getRunningWithLock()) > > { > > keyHandler.checkKeys(); > > inputHandler.sendInput(); > > ArUtil::sleep(100); > > } > > > > /* The client stopped running, due to disconnection from the server, > > general > > * Aria shutdown, or some other reason. */ > > client.disconnect(); > > Aria::shutdown(); > > return 0; > > } > > > > ------------------------------------------------------------------------ > > *From:* Reed Hedges > > > *To:* aria-users at lists.mobilerobots.com > > > *Sent:* Fri, July 9, 2010 1:33:38 AM > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > Does this always happen, or only sometimes? When it happens, check the > > indicator lights on the top of the SICK laser, and note the sequence of > > lights and messages printed by arnlServer. Is the laser off (no > > indicator lights) before you start arnlServer? > > > > Reed > > > > > > > > On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > > > Hi all, > > > > > > please help to find out solutions for two problems mentioned below. > > > > > > > > > 1. laser isn't getting power when i'm running arnlServer program from > > > onboard computer... > > > (but laser works with wander program) > > > [robot at p3at examples]$ ./arnlServer > > > Could not connect to simulator, connecting to robot through serial > port > > > /dev/ttyS0. > > > Syncing 0 > > > Syncing 1 > > > Syncing 2 > > > Connected to robot. > > > Name: Auckland_3502 > > > Type: Pioneer > > > Subtype: p3at-sh > > > Loaded robot parameters from p3at-sh.p > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > lms2xx_1: waiting for laser to power on. > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > lms2xx_1: waiting for laser to power on. > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > > > Could not connect to all lasers... exiting > > > > > > Disconnecting from robot > > > > > > 2. How can i save laser reading and images at the same time. > > > > > > Any response from you will be appreciated. > > > > > > Best regards > > > Hossain > > > > > > > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > >> > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > >> > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From zhossain.kuet at yahoo.com Fri Jul 9 12:46:12 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Fri, 9 Jul 2010 09:46:12 -0700 (PDT) Subject: [Aria-users] problem with arnlServer In-Reply-To: <4C37495A.4080005@mobilerobots.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> <4C373F46.4030307@mobilerobots.com> <819886.98212.qm@web46405.mail.sp1.yahoo.com> <4C37495A.4080005@mobilerobots.com> Message-ID: <142326.1966.qm@web46416.mail.sp1.yahoo.com> I am sorry to say i don't understand all of your message. what I am doing that is I run ./savServer and then ./serverDemo and then client program in my client laptop. actually i'm getting image properly whenever i press 'c'(as my program) but in laser file getting nothing.. yes i checked before 'getPictureCam1' doesn't work. ok iwon't use packet from now on. would you tell me a little bit details? best regards hossain ________________________________ From: Reed Hedges To: "Help, discussion and announcements for MobileRobots' Advanced Robot Interface for Applications (ARIA) " Sent: Sat, July 10, 2010 4:07:54 AM Subject: Re: [Aria-users] problem with arnlServer serverDemo does not normally support any video requests unless you have modified it. Since your laser log is written in the video image handler, it would only happen if the server responds with a video image. You can add video serving of your own design to serverDemo (responding to getPictureCam1 or sendVideo requests), or you can add a ArHybridForwarderVideo object, and run savServer or ACTS before running serverDemo. You can check whether the server has the sendVideo request or not. (Newer ones have "getPictureCam1" instead, which is a newer scheme to allow for multiple cameras and other options as well.) if (client.dataExists("getPictureCam1")) { client.requestOnce("getPictureCam1"); } else if(client.dataExists("sendVideo")) { client.requestOnce("sendVideo"); } else { ArLog::log("Error, server does not support video requests"); } Also, note you don't need to supply a packet with the sendVideo request. > Another problem....i was trying to save a laser txt file and image with > single stock by below client program. and I used serverDemo as my server > program. I am getting image properly but in laser txt file no > data.......please please help.... > > Code:(client program) > > #include "Aria.h" > #include "ArNetworking.h" > #include "cv.h" > #include "highgui.h" > #include > #include > using namespace std; > IplImage *img=0; > int no=1; > > ArClientBase client; > ArSick sick; > > > class InputHandler > { > public: > /** > * @param client Our client networking object > * @param keyHandler Key handler to register command callbacks with > */ > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > virtual ~InputHandler(void); > > /// Up arrow key handler: drive the robot forward > void up(void); > > /// Down arrow key handler: drive the robot backward > void down(void); > > /// Left arrow key handler: turn the robot left > void left(void); > > > /// Right arrow key handler: turn the robot right > void right(void); > > /// Send drive request to the server with stored values > void sendInput(void); > > /// Send a request to enable "safe drive" mode on the server > void imageCapture(); > > protected: > ArClientBase *myClient; > ArKeyHandler *myKeyHandler; > > /// Set this to true in the constructor to print out debugging information > bool myPrinting; > > /// Current translation value (a percentage of the maximum speed) > double myTransRatio; > > /// Current rotation ration value (a percentage of the maximum rotational > velocity) > double myRotRatio; > > > /** Functor objects, given to the key handler, which then call our handler > * methods above */ > ///@{ > ArFunctorC myUpCB; > ArFunctorC myDownCB; > ArFunctorC myLeftCB; > ArFunctorC > myRightCB; > ArFunctorC myImageCaptureCB; > > }; > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler *keyHandler) : > myClient(client), myKeyHandler(keyHandler), > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > /* Initialize functor objects with pointers to our handler methods: */ > myUpCB(this, &InputHandler::up), > myDownCB(this, &InputHandler::down), > myLeftCB(this, &InputHandler::left), > myRightCB(this, &InputHandler::right), > myImageCaptureCB(this, &InputHandler::imageCapture) > { > > /* Add our functor objects to the key handler, associated with the >appropriate > * keys: */ > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > } > > InputHandler::~InputHandler(void) > { > > } > > void InputHandler::up(void) > { > if (myPrinting) > printf("Forwards\n"); > myTransRatio = 100; > } > > void InputHandler::down(void) > { > if (myPrinting) > printf("Backwards\n"); > myTransRatio = -100; > } > > void InputHandler::left(void) > { > if (myPrinting) > printf("Left\n"); > myRotRatio = 100; > } > > void InputHandler::right(void) > { > if (myPrinting) > printf("Right\n"); > myRotRatio = -100; > } > > void InputHandler::imageCapture() > { > /* Construct a request packet. The data is a single byte, with value > * 1 to enable safe drive, 0 to disable. */ > ArNetPacket p; > p.uByteToBuf(90); > client.requestOnce("sendVideo", &p); > } > > > void > InputHandler::sendInput(void) > { > /* This method is called by the main function to send a ratioDrive > * request with our current velocity values. If the server does > * not support the ratioDrive request, then we abort now: */ > if(!myClient->dataExists("ratioDrive")) return; > /// Send a request to enable "safe drive" mode on the server > void safeDrive(); > /* Construct a ratioDrive request packet. It consists > * of three doubles: translation ratio, rotation ratio, and an overall >scaling > * factor. */ > ArNetPacket packet; > packet.doubleToBuf(myTransRatio); > packet.doubleToBuf(myRotRatio); > packet.doubleToBuf(50); // use half of the robot's maximum. > //packet.doubleToBuf(myLatRatio); > if (myPrinting) > printf("Sending\n"); > myClient->requestOnce("ratioDrive", &packet); > myTransRatio = 0; > myRotRatio = 0; > //myLatRatio = 0; > } > > > > /* Key handler for > the escape key: shutdown all of Aria. */ > void escape(void) > { > printf("esc pressed, shutting down aria\n"); > Aria::shutdown(); > } > > /*Key Handler for the capture key: capture a picture. */ > void jpegHandler(ArNetPacket *packet) > { > //To write a Laser data file > std::vector< ArSensorReading >* readings; > std::vector< ArSensorReading >::iterator it; > > FILE* dataFile; > dataFile = fopen("laser_log.txt", "w"); > > sick.lockDevice(); > > readings = sick.getRawReadingsAsVector(); > > for (it = readings->begin(); it != readings->end(); it++) > { > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > } > sick.unlockDevice(); > > ArUtil::sleep(100); > > fclose( dataFile );//closed laser datafile > > //To store a Image > unsigned int width; > unsigned int height; > static unsigned char jpeg[50000]; > int jpegSize; > > FILE *file; > > width = packet->bufToUByte2(); > height = packet->bufToUByte2(); > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > if(jpegSize > 50000) > { > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image is %d > bytes, my buffer is 50000 bytes)", jpegSize); > return; > } > packet->bufToData((char *)jpeg, jpegSize); > const char base[]="image", ext[]=".jpg"; > char filename[FILENAME_MAX]; > //char tmpFilename[128]; > sprintf(filename,"%s%d%s", base, no, ext); > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > { > fwrite(jpeg, jpegSize, 1, file); > fclose(file); > > #ifdef WIN32 > // On windows, rename() fails if the new file already exists > unlink(filename); > #endif > > } > else > ArLog::log(ArLog::Normal, "Could not write temp file "); > > char ifile[FILENAME_MAX]; > > sprintf(ifile, "%s%d%s", base, no, ext); > img = cvLoadImage(ifile); > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > cvShowImage( "image", img ); > //cvReleaseImage(&img); > //cvDestroyWindow("image"); > cvWaitKey(10); > no++; > } > > int main(int argc, char **argv) > { > /* Aria initialization: */ > Aria::init(); > /* Aria components use this to get options off the command line: */ > ArClientSimpleConnector clientConnector(&parser); > > parser.loadDefaultArguments(); > > /* Check for -help, and unhandled arguments: */ > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > { > Aria::logOptions(); > exit(0); > } > > /* Connect our client object to the remote server: */ > if (!clientConnector.connectClient(&client)) > { > if (client.wasRejected()) > printf("Server '%s' rejected connection, exiting\n", > client.getHost()); > else > printf("Could not connect to server '%s', exiting\n", client.getHost()); > exit(1); > } > > printf("Connected to server.\n"); > > client.setRobotName(client.getHost()); // include server name in log messages > > /* Create a key handler and also tell Aria about it */ > ArKeyHandler keyHandler; > Aria::setKeyHandler(&keyHandler); > > /* Global escape-key handler to shut everythnig down */ > ArGlobalFunctor escapeCB(&escape); > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > client.addHandler("sendVideo", &jpegHandlerCB); > client.runAsync(); > > /* Create the InputHandler object and request safe-drive mode */ > InputHandler inputHandler(&client, &keyHandler); > //inputHandler.safeDrive(); > > /* Use ArClientBase::dataExists() to see if the > "ratioDrive" request is > available on the > > * currently connected server. */ > if(!client.dataExists("ratioDrive") ) > printf("Warning: server does not have ratioDrive command, can not use > drive commands!\n"); > else > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn Left\nRIGHT: > Turn Right\n"); > printf("c: Image capture\n\nesc: shut down\n"); > > while (client.getRunningWithLock()) > { > keyHandler.checkKeys(); > inputHandler.sendInput(); > ArUtil::sleep(100); > } > > /* The client stopped running, due to disconnection from the server, general > * Aria shutdown, or some other reason. */ > client.disconnect(); > Aria::shutdown(); > return 0; > } > > > > ------------------------------------------------------------------------ > *From:* Reed Hedges > *To:* "Help, discussion and announcements for MobileRobots' Advanced > Robot Interface for Applications (ARIA) " > > *Sent:* Sat, July 10, 2010 3:24:54 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > > Is there any difference in robot when you use serverDemo or arnlServer, > or is it > the same robot, same computer, etc? Is the switch on the back of the > laser in > the on position? > > Hossain, Md.Z wrote: > > Hi, > > > > sorry I missed one question to answer in my previous mail.... > > > > Indicator light remains off all time and getting this output.. > > > > [robot at p3at examples]$ ./arnlServer > > > Could not connect to simulator, connecting to robot through serial > port > > > /dev/ttyS0. > > > Syncing 0 > > > Syncing 1 > > > Syncing 2 > > > Connected to robot. > > > Name: Auckland_3502 > > > Type: Pioneer > > > Subtype: p3at-sh > > > Loaded robot parameters from p3at-sh.p > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > lms2xx_1: waiting for laser to power on. > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > lms2xx_1: waiting for laser to power on. > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > > > Could not connect to all lasers... exiting > > > > > > Disconnecting from robot > > > > Would you please have a look in my previous mail and give your comments? > > > > Best regards > > hossain > > > > > > ------------------------------------------------------------------------ > > *From:* "Hossain, Md.Z" > > > *To:* "Help, discussion and announcements for MobileRobots' Advanced > > Robot Interface for Applications (ARIA) " > > > > > *Sent:* Sat, July 10, 2010 12:36:23 AM > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > Hi Reed > > > > Thank you very much for your reply. > > > > Yes always getting same response. but when i use serverDemo from > > ArNetworking then it's working perfectly. > > > > Another problem....i was trying to save a laser txt file and image with > > single stock by this client program. and I used serverDemo as my server > > program. I am getting image properly but in laser txt file no > > data.......please please help.... > > > > > > Code:(client program) > > > > #include "Aria.h" > > #include "ArNetworking.h" > > #include "cv.h" > > #include "highgui.h" > > #include > > #include > > using namespace std; > > IplImage *img=0; > > int no=1; > > > > ArClientBase client; > > ArSick sick; > > > > > > class InputHandler > > { > > public: > > /** > > * @param client Our client networking object > > * @param keyHandler Key handler to register command callbacks with > > */ > > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > > virtual ~InputHandler(void); > > > > /// Up arrow key handler: drive the robot forward > > void up(void); > > > > /// Down arrow key handler: drive the robot backward > > void down(void); > > > > /// Left arrow key handler: turn the robot left > > void left(void); > > > > /// Right arrow key handler: turn the robot right > > void right(void); > > > > /// Send drive request to the server with stored values > > void sendInput(void); > > > > /// Send a request to enable "safe drive" mode on the server > > void imageCapture(); > > > > protected: > > ArClientBase *myClient; > > ArKeyHandler *myKeyHandler; > > > > /// Set this to true in the constructor to print out debugging > information > > bool myPrinting; > > > > /// Current translation value (a percentage of the maximum speed) > > double myTransRatio; > > > > /// Current rotation ration value (a percentage of the maximum > > rotational velocity) > > double myRotRatio; > > > > > > /** Functor objects, given to the key handler, which then call our > handler > > * methods above */ > > ///@{ > > ArFunctorC myUpCB; > > ArFunctorC myDownCB; > > ArFunctorC myLeftCB; > > ArFunctorC myRightCB; > > ArFunctorC myImageCaptureCB; > > > > }; > > > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > > *keyHandler) : > > myClient(client), myKeyHandler(keyHandler), > > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > > > /* Initialize functor objects with pointers to our handler methods: */ > > myUpCB(this, &InputHandler::up), > > myDownCB(this, &InputHandler::down), > > myLeftCB(this, &InputHandler::left), > > myRightCB(this, &InputHandler::right), > > myImageCaptureCB(this, &InputHandler::imageCapture) > > { > > > > /* Add our functor objects to the key handler, associated with the > > appropriate > > * keys: */ > > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > > } > > > > InputHandler::~InputHandler(void) > > { > > > > } > > > > void InputHandler::up(void) > > { > > if (myPrinting) > > printf("Forwards\n"); > > myTransRatio = 100; > > } > > > > void InputHandler::down(void) > > { > > if (myPrinting) > > printf("Backwards\n"); > > myTransRatio = -100; > > } > > > > void InputHandler::left(void) > > { > > if (myPrinting) > > printf("Left\n"); > > myRotRatio = 100; > > } > > > > void InputHandler::right(void) > > { > > if (myPrinting) > > printf("Right\n"); > > myRotRatio = -100; > > } > > > > void InputHandler::imageCapture() > > { > > /* Construct a request packet. The data is a single byte, with value > > * 1 to enable safe drive, 0 to disable. */ > > ArNetPacket p; > > p.uByteToBuf(90); > > client.requestOnce("sendVideo", &p); > > } > > > > > > void InputHandler::sendInput(void) > > { > > /* This method is called by the main function to send a ratioDrive > > * request with our current velocity values. If the server does > > * not support the ratioDrive request, then we abort now: */ > > if(!myClient->dataExists("ratioDrive")) return; > > /// Send a request to enable "safe drive" mode on the server > > void safeDrive(); > > /* Construct a ratioDrive request packet. It consists > > * of three doubles: translation ratio, rotation ratio, and an overall > > scaling > > * factor. */ > > ArNetPacket packet; > > packet.doubleToBuf(myTransRatio); > > packet.doubleToBuf(myRotRatio); > > packet.doubleToBuf(50); // use half of the robot's maximum. > > //packet.doubleToBuf(myLatRatio); > > if (myPrinting) > > printf("Sending\n"); > > myClient->requestOnce("ratioDrive", &packet); > > myTransRatio = 0; > > myRotRatio = 0; > > //myLatRatio = 0; > > } > > > > > > > > /* Key handler for the escape key: shutdown all of Aria. */ > > void escape(void) > > { > > printf("esc pressed, shutting down aria\n"); > > Aria::shutdown(); > > } > > > > /*Key Handler for the capture key: capture a picture. */ > > void jpegHandler(ArNetPacket *packet) > > { > > //To write a Laser data file > > std::vector< ArSensorReading >* readings; > > std::vector< ArSensorReading >::iterator it; > > > > FILE* dataFile; > > dataFile = fopen("laser_log.txt", "w"); > > > > sick.lockDevice(); > > > > readings = sick.getRawReadingsAsVector(); > > > > for (it = readings->begin(); it != readings->end(); it++) > > { > > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > > } > > sick.unlockDevice(); > > > > ArUtil::sleep(100); > > > > fclose( dataFile );//closed laser datafile > > > > //To store a Image > > unsigned int width; > > unsigned int height; > > static unsigned char jpeg[50000]; > > int jpegSize; > > FILE *file; > > > > width = packet->bufToUByte2(); > > height = packet->bufToUByte2(); > > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > > if(jpegSize > 50000) > > { > > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > > is %d bytes, my buffer is 50000 bytes)", jpegSize); > > return; > > } > > packet->bufToData((char *)jpeg, jpegSize); > > const char base[]="image", ext[]=".jpg"; > > char filename[FILENAME_MAX]; > > //char tmpFilename[128]; > > sprintf(filename,"%s%d%s", base, no, ext); > > > > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > > { > > fwrite(jpeg, jpegSize, 1, file); > > fclose(file); > > > > #ifdef WIN32 > > // On windows, rename() fails if the new file already exists > > unlink(filename); > > #endif > > > > } > > else > > ArLog::log(ArLog::Normal, "Could not write temp file "); > > > > char ifile[FILENAME_MAX]; > > sprintf(ifile, "%s%d%s", base, no, ext); > > img = cvLoadImage(ifile); > > > > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > > cvShowImage( "image", img ); > > //cvReleaseImage(&img); > > //cvDestroyWindow("image"); > > cvWaitKey(10); > > no++; > > } > > > > int main(int argc, char **argv) > > { > > /* Aria initialization: */ > > Aria::init(); > > /* Aria components use this to get options off the command line: */ > > ArClientSimpleConnector clientConnector(&parser); > > > > parser.loadDefaultArguments(); > > > > /* Check for -help, and unhandled arguments: */ > > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > > { > > Aria::logOptions(); > > exit(0); > > } > > > > /* Connect our client object to the remote server: */ > > if (!clientConnector.connectClient(&client)) > > { > > if (client.wasRejected()) > > printf("Server '%s' rejected connection, exiting\n", > > client.getHost()); > > else > > printf("Could not connect to server '%s', exiting\n", > > client.getHost()); > > exit(1); > > } > > > > printf("Connected to server.\n"); > > > > client.setRobotName(client.getHost()); // include server name in log > > messages > > > > /* Create a key handler and also tell Aria about it */ > > ArKeyHandler keyHandler; > > Aria::setKeyHandler(&keyHandler); > > > > /* Global escape-key handler to shut everythnig down */ > > ArGlobalFunctor escapeCB(&escape); > > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > > client.addHandler("sendVideo", &jpegHandlerCB); > > client.runAsync(); > > > > /* Create the InputHandler object and request safe-drive mode */ > > InputHandler inputHandler(&client, &keyHandler); > > //inputHandler.safeDrive(); > > > > /* Use ArClientBase::dataExists() to see if the "ratioDrive" request > > is available on the > > * currently connected server. */ > > if(!client.dataExists("ratioDrive") ) > > printf("Warning: server does not have ratioDrive command, can not > > use drive commands!\n"); > > else > > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > > Left\nRIGHT: Turn Right\n"); > > printf("c: Image capture\n\nesc: shut down\n"); > > > > while (client.getRunningWithLock()) > > { > > keyHandler.checkKeys(); > > inputHandler.sendInput(); > > ArUtil::sleep(100); > > } > > > > /* The client stopped running, due to disconnection from the server, > > general > > * Aria shutdown, or some other reason. */ > > client.disconnect(); > > Aria::shutdown(); > > return 0; > > } > > > > ------------------------------------------------------------------------ > > *From:* Reed Hedges > > > *To:* aria-users at lists.mobilerobots.com > > > *Sent:* Fri, July 9, 2010 1:33:38 AM > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > Does this always happen, or only sometimes? When it happens, check the > > indicator lights on the top of the SICK laser, and note the sequence of > > lights and messages printed by arnlServer. Is the laser off (no > > indicator lights) before you start arnlServer? > > > > Reed > > > > > > > > On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > > > Hi all, > > > > > > please help to find out solutions for two problems mentioned below. > > > > > > > > > 1. laser isn't getting power when i'm running arnlServer program from > > > onboard computer... > > > (but laser works with wander program) > > > [robot at p3at examples]$ ./arnlServer > > > Could not connect to simulator, connecting to robot through serial > port > > > /dev/ttyS0. > > > Syncing 0 > > > Syncing 1 > > > Syncing 2 > > > Connected to robot. > > > Name: Auckland_3502 > > > Type: Pioneer > > > Subtype: p3at-sh > > > Loaded robot parameters from p3at-sh.p > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > lms2xx_1: waiting for laser to power on. > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > lms2xx_1: waiting for laser to power on. > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, stopping > > > Could not connect to all lasers... exiting > > > > > > Disconnecting from robot > > > > > > 2. How can i save laser reading and images at the same time. > > > > > > Any response from you will be appreciated. > > > > > > Best regards > > > Hossain > > > > > > > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > >> > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > >> > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, >FAQ, tips, manuals, and software, firmware and driver downloads. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100709/bd8d8381/attachment-0001.html From reed at mobilerobots.com Fri Jul 9 13:35:33 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Fri, 09 Jul 2010 13:35:33 -0400 Subject: [Aria-users] problem with arnlServer In-Reply-To: <142326.1966.qm@web46416.mail.sp1.yahoo.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> <4C373F46.4030307@mobilerobots.com> <819886.98212.qm@web46405.mail.sp1.yahoo.com> <4C37495A.4080005@mobilerobots.com> <142326.1966.qm@web46416.mail.sp1.yahoo.com> Message-ID: <4C375DE5.4060506@mobilerobots.com> I was mistaken -- serverDemo *does* have ArHybridForwarderVideo. As far as I can tell from looking quickly at your code, writing to the laser log file should work, if jpegHandler() is called, and it sucessfully opens the file. (you could check whether dataFile is NULL after the call to fopen, in case it fails to open the file for some reason). Is the file created, but empty? Maybe there are 0 raw readings. Hossain, Md.Z wrote: > I am sorry to say i don't understand all of your message. > what I am doing that is I run ./savServer and then ./serverDemo and then > client program in my client laptop. actually i'm getting image properly > whenever i press 'c'(as my program) but in laser file getting nothing.. > > yes i checked before 'getPictureCam1' doesn't work. > ok iwon't use packet from now on. > would you tell me a little bit details? > > best regards > hossain > > ------------------------------------------------------------------------ > *From:* Reed Hedges > *To:* "Help, discussion and announcements for MobileRobots' Advanced > Robot Interface for Applications (ARIA) " > > *Sent:* Sat, July 10, 2010 4:07:54 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > > serverDemo does not normally support any video requests unless you have > modified > it. Since your laser log is written in the video image handler, it > would only > happen if the server responds with a video image. You can add video > serving of > your own design to serverDemo (responding to getPictureCam1 or sendVideo > requests), or you can add a ArHybridForwarderVideo object, and run > savServer or > ACTS before running serverDemo. > > You can check whether the server has the sendVideo request or not. > (Newer ones > have "getPictureCam1" instead, which is a newer scheme to allow for > multiple > cameras and other options as well.) > > if (client.dataExists("getPictureCam1")) > { > client.requestOnce("getPictureCam1"); > } > else if(client.dataExists("sendVideo")) > { > client.requestOnce("sendVideo"); > } > else > { > ArLog::log("Error, server does not support video requests"); > } > > > > Also, note you don't need to supply a packet with the sendVideo request. > > > > > Another problem....i was trying to save a laser txt file and image with > > single stock by below client program. and I used serverDemo as my server > > program. I am getting image properly but in laser txt file no > > data.......please please help.... > > > > Code:(client program) > > > > #include "Aria.h" > > #include "ArNetworking.h" > > #include "cv.h" > > #include "highgui.h" > > #include > > #include > > using namespace std; > > IplImage *img=0; > > int no=1; > > > > ArClientBase client; > > ArSick sick; > > > > > > class InputHandler > > { > > public: > > /** > > * @param client Our client networking object > > * @param keyHandler Key handler to register command callbacks with > > */ > > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > > virtual ~InputHandler(void); > > > > /// Up arrow key handler: drive the robot forward > > void up(void); > > > > /// Down arrow key handler: drive the robot backward > > void down(void); > > > > /// Left arrow key handler: turn the robot left > > void left(void); > > > > > > /// Right arrow key handler: turn the robot right > > void right(void); > > > > /// Send drive request to the server with stored values > > void sendInput(void); > > > > /// Send a request to enable "safe drive" mode on the server > > void imageCapture(); > > > > protected: > > ArClientBase *myClient; > > ArKeyHandler *myKeyHandler; > > > > /// Set this to true in the constructor to print out debugging > information > > bool myPrinting; > > > > /// Current translation value (a percentage of the maximum speed) > > double myTransRatio; > > > > /// Current rotation ration value (a percentage of the maximum > rotational > > velocity) > > double myRotRatio; > > > > > > /** Functor objects, given to the key handler, which then call our > handler > > * methods above */ > > ///@{ > > ArFunctorC myUpCB; > > ArFunctorC myDownCB; > > ArFunctorC myLeftCB; > > ArFunctorC > > myRightCB; > > ArFunctorC myImageCaptureCB; > > > > }; > > > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > *keyHandler) : > > myClient(client), myKeyHandler(keyHandler), > > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > > > /* Initialize functor objects with pointers to our handler methods: */ > > myUpCB(this, &InputHandler::up), > > myDownCB(this, &InputHandler::down), > > myLeftCB(this, &InputHandler::left), > > myRightCB(this, &InputHandler::right), > > myImageCaptureCB(this, &InputHandler::imageCapture) > > { > > > > /* Add our functor objects to the key handler, associated with the > appropriate > > * keys: */ > > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > > } > > > > InputHandler::~InputHandler(void) > > { > > > > } > > > > void InputHandler::up(void) > > { > > if (myPrinting) > > printf("Forwards\n"); > > myTransRatio = 100; > > } > > > > void InputHandler::down(void) > > { > > if (myPrinting) > > printf("Backwards\n"); > > myTransRatio = -100; > > } > > > > void InputHandler::left(void) > > { > > if (myPrinting) > > printf("Left\n"); > > myRotRatio = 100; > > } > > > > void InputHandler::right(void) > > { > > if (myPrinting) > > printf("Right\n"); > > myRotRatio = -100; > > } > > > > void InputHandler::imageCapture() > > { > > /* Construct a request packet. The data is a single byte, with value > > * 1 to enable safe drive, 0 to disable. */ > > ArNetPacket p; > > p.uByteToBuf(90); > > client.requestOnce("sendVideo", &p); > > } > > > > > > void > > InputHandler::sendInput(void) > > { > > /* This method is called by the main function to send a ratioDrive > > * request with our current velocity values. If the server does > > * not support the ratioDrive request, then we abort now: */ > > if(!myClient->dataExists("ratioDrive")) return; > > /// Send a request to enable "safe drive" mode on the server > > void safeDrive(); > > /* Construct a ratioDrive request packet. It consists > > * of three doubles: translation ratio, rotation ratio, and an > overall scaling > > * factor. */ > > ArNetPacket packet; > > packet.doubleToBuf(myTransRatio); > > packet.doubleToBuf(myRotRatio); > > packet.doubleToBuf(50); // use half of the robot's maximum. > > //packet.doubleToBuf(myLatRatio); > > if (myPrinting) > > printf("Sending\n"); > > myClient->requestOnce("ratioDrive", &packet); > > myTransRatio = 0; > > myRotRatio = 0; > > //myLatRatio = 0; > > } > > > > > > > > /* Key handler for > > the escape key: shutdown all of Aria. */ > > void escape(void) > > { > > printf("esc pressed, shutting down aria\n"); > > Aria::shutdown(); > > } > > > > /*Key Handler for the capture key: capture a picture. */ > > void jpegHandler(ArNetPacket *packet) > > { > > //To write a Laser data file > > std::vector< ArSensorReading >* readings; > > std::vector< ArSensorReading >::iterator it; > > > > FILE* dataFile; > > dataFile = fopen("laser_log.txt", "w"); > > > > sick.lockDevice(); > > > > readings = sick.getRawReadingsAsVector(); > > > > for (it = readings->begin(); it != readings->end(); it++) > > { > > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > > } > > sick.unlockDevice(); > > > > ArUtil::sleep(100); > > > > fclose( dataFile );//closed laser datafile > > > > //To store a Image > > unsigned int width; > > unsigned int height; > > static unsigned char jpeg[50000]; > > int jpegSize; > > > > FILE *file; > > > > width = packet->bufToUByte2(); > > height = packet->bufToUByte2(); > > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > > if(jpegSize > 50000) > > { > > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > is %d > > bytes, my buffer is 50000 bytes)", jpegSize); > > return; > > } > > packet->bufToData((char *)jpeg, jpegSize); > > const char base[]="image", ext[]=".jpg"; > > char filename[FILENAME_MAX]; > > //char tmpFilename[128]; > > sprintf(filename,"%s%d%s", base, no, ext); > > > > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > > { > > fwrite(jpeg, jpegSize, 1, file); > > fclose(file); > > > > #ifdef WIN32 > > // On windows, rename() fails if the new file already exists > > unlink(filename); > > #endif > > > > } > > else > > ArLog::log(ArLog::Normal, "Could not write temp file "); > > > > char ifile[FILENAME_MAX]; > > > > sprintf(ifile, "%s%d%s", base, no, ext); > > img = cvLoadImage(ifile); > > > > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > > cvShowImage( "image", img ); > > //cvReleaseImage(&img); > > //cvDestroyWindow("image"); > > cvWaitKey(10); > > no++; > > } > > > > int main(int argc, char **argv) > > { > > /* Aria initialization: */ > > Aria::init(); > > /* Aria components use this to get options off the command line: */ > > ArClientSimpleConnector clientConnector(&parser); > > > > parser.loadDefaultArguments(); > > > > /* Check for -help, and unhandled arguments: */ > > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > > { > > Aria::logOptions(); > > exit(0); > > } > > > > /* Connect our client object to the remote server: */ > > if (!clientConnector.connectClient(&client)) > > { > > if (client.wasRejected()) > > printf("Server '%s' rejected connection, exiting\n", > > client.getHost()); > > else > > printf("Could not connect to server '%s', exiting\n", > client.getHost()); > > exit(1); > > } > > > > printf("Connected to server.\n"); > > > > client.setRobotName(client.getHost()); // include server name in log > messages > > > > /* Create a key handler and also tell Aria about it */ > > ArKeyHandler keyHandler; > > Aria::setKeyHandler(&keyHandler); > > > > /* Global escape-key handler to shut everythnig down */ > > ArGlobalFunctor escapeCB(&escape); > > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > > client.addHandler("sendVideo", &jpegHandlerCB); > > client.runAsync(); > > > > /* Create the InputHandler object and request safe-drive mode */ > > InputHandler inputHandler(&client, &keyHandler); > > //inputHandler.safeDrive(); > > > > /* Use ArClientBase::dataExists() to see if the > > "ratioDrive" request is > > available on the > > > > * currently connected server. */ > > if(!client.dataExists("ratioDrive") ) > > printf("Warning: server does not have ratioDrive command, can > not use > > drive commands!\n"); > > else > > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > Left\nRIGHT: > > Turn Right\n"); > > printf("c: Image capture\n\nesc: shut down\n"); > > > > while (client.getRunningWithLock()) > > { > > keyHandler.checkKeys(); > > inputHandler.sendInput(); > > ArUtil::sleep(100); > > } > > > > /* The client stopped running, due to disconnection from the server, > general > > * Aria shutdown, or some other reason. */ > > client.disconnect(); > > Aria::shutdown(); > > return 0; > > } > > > > > > > > ------------------------------------------------------------------------ > > *From:* Reed Hedges > > > *To:* "Help, discussion and announcements for MobileRobots' Advanced > > Robot Interface for Applications (ARIA) " > > > > > *Sent:* Sat, July 10, 2010 3:24:54 AM > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > Is there any difference in robot when you use serverDemo or arnlServer, > > or is it > > the same robot, same computer, etc? Is the switch on the back of the > > laser in > > the on position? > > > > Hossain, Md.Z wrote: > > > Hi, > > > > > > sorry I missed one question to answer in my previous mail.... > > > > > > Indicator light remains off all time and getting this output.. > > > > > > [robot at p3at examples]$ ./arnlServer > > > > Could not connect to simulator, connecting to robot through serial > > port > > > > /dev/ttyS0. > > > > Syncing 0 > > > > Syncing 1 > > > > Syncing 2 > > > > Connected to robot. > > > > Name: Auckland_3502 > > > > Type: Pioneer > > > > Subtype: p3at-sh > > > > Loaded robot parameters from p3at-sh.p > > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, > stopping > > > > Could not connect to all lasers... exiting > > > > > > > > Disconnecting from robot > > > > > > Would you please have a look in my previous mail and give your > comments? > > > > > > Best regards > > > hossain > > > > > > > > > > ------------------------------------------------------------------------ > > > *From:* "Hossain, Md.Z" > > >> > > > *To:* "Help, discussion and announcements for MobileRobots' Advanced > > > Robot Interface for Applications (ARIA) " > > > > > >> > > > *Sent:* Sat, July 10, 2010 12:36:23 AM > > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > Hi Reed > > > > > > Thank you very much for your reply. > > > > > > Yes always getting same response. but when i use serverDemo from > > > ArNetworking then it's working perfectly. > > > > > > Another problem....i was trying to save a laser txt file and image > with > > > single stock by this client program. and I used serverDemo as my > server > > > program. I am getting image properly but in laser txt file no > > > data.......please please help.... > > > > > > > > > Code:(client program) > > > > > > #include "Aria.h" > > > #include "ArNetworking.h" > > > #include "cv.h" > > > #include "highgui.h" > > > #include > > > #include > > > using namespace std; > > > IplImage *img=0; > > > int no=1; > > > > > > ArClientBase client; > > > ArSick sick; > > > > > > > > > class InputHandler > > > { > > > public: > > > /** > > > * @param client Our client networking object > > > * @param keyHandler Key handler to register command callbacks with > > > */ > > > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > > > virtual ~InputHandler(void); > > > > > > /// Up arrow key handler: drive the robot forward > > > void up(void); > > > > > > /// Down arrow key handler: drive the robot backward > > > void down(void); > > > > > > /// Left arrow key handler: turn the robot left > > > void left(void); > > > > > > /// Right arrow key handler: turn the robot right > > > void right(void); > > > > > > /// Send drive request to the server with stored values > > > void sendInput(void); > > > > > > /// Send a request to enable "safe drive" mode on the server > > > void imageCapture(); > > > > > > protected: > > > ArClientBase *myClient; > > > ArKeyHandler *myKeyHandler; > > > > > > /// Set this to true in the constructor to print out debugging > > information > > > bool myPrinting; > > > > > > /// Current translation value (a percentage of the maximum speed) > > > double myTransRatio; > > > > > > /// Current rotation ration value (a percentage of the maximum > > > rotational velocity) > > > double myRotRatio; > > > > > > > > > /** Functor objects, given to the key handler, which then call our > > handler > > > * methods above */ > > > ///@{ > > > ArFunctorC myUpCB; > > > ArFunctorC myDownCB; > > > ArFunctorC myLeftCB; > > > ArFunctorC myRightCB; > > > ArFunctorC myImageCaptureCB; > > > > > > }; > > > > > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > > > *keyHandler) : > > > myClient(client), myKeyHandler(keyHandler), > > > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > > > > > /* Initialize functor objects with pointers to our handler > methods: */ > > > myUpCB(this, &InputHandler::up), > > > myDownCB(this, &InputHandler::down), > > > myLeftCB(this, &InputHandler::left), > > > myRightCB(this, &InputHandler::right), > > > myImageCaptureCB(this, &InputHandler::imageCapture) > > > { > > > > > > /* Add our functor objects to the key handler, associated with the > > > appropriate > > > * keys: */ > > > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > > > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > > > } > > > > > > InputHandler::~InputHandler(void) > > > { > > > > > > } > > > > > > void InputHandler::up(void) > > > { > > > if (myPrinting) > > > printf("Forwards\n"); > > > myTransRatio = 100; > > > } > > > > > > void InputHandler::down(void) > > > { > > > if (myPrinting) > > > printf("Backwards\n"); > > > myTransRatio = -100; > > > } > > > > > > void InputHandler::left(void) > > > { > > > if (myPrinting) > > > printf("Left\n"); > > > myRotRatio = 100; > > > } > > > > > > void InputHandler::right(void) > > > { > > > if (myPrinting) > > > printf("Right\n"); > > > myRotRatio = -100; > > > } > > > > > > void InputHandler::imageCapture() > > > { > > > /* Construct a request packet. The data is a single byte, with value > > > * 1 to enable safe drive, 0 to disable. */ > > > ArNetPacket p; > > > p.uByteToBuf(90); > > > client.requestOnce("sendVideo", &p); > > > } > > > > > > > > > void InputHandler::sendInput(void) > > > { > > > /* This method is called by the main function to send a ratioDrive > > > * request with our current velocity values. If the server does > > > * not support the ratioDrive request, then we abort now: */ > > > if(!myClient->dataExists("ratioDrive")) return; > > > /// Send a request to enable "safe drive" mode on the server > > > void safeDrive(); > > > /* Construct a ratioDrive request packet. It consists > > > * of three doubles: translation ratio, rotation ratio, and an > overall > > > scaling > > > * factor. */ > > > ArNetPacket packet; > > > packet.doubleToBuf(myTransRatio); > > > packet.doubleToBuf(myRotRatio); > > > packet.doubleToBuf(50); // use half of the robot's maximum. > > > //packet.doubleToBuf(myLatRatio); > > > if (myPrinting) > > > printf("Sending\n"); > > > myClient->requestOnce("ratioDrive", &packet); > > > myTransRatio = 0; > > > myRotRatio = 0; > > > //myLatRatio = 0; > > > } > > > > > > > > > > > > /* Key handler for the escape key: shutdown all of Aria. */ > > > void escape(void) > > > { > > > printf("esc pressed, shutting down aria\n"); > > > Aria::shutdown(); > > > } > > > > > > /*Key Handler for the capture key: capture a picture. */ > > > void jpegHandler(ArNetPacket *packet) > > > { > > > //To write a Laser data file > > > std::vector< ArSensorReading >* readings; > > > std::vector< ArSensorReading >::iterator it; > > > > > > FILE* dataFile; > > > dataFile = fopen("laser_log.txt", "w"); > > > > > > sick.lockDevice(); > > > > > > readings = sick.getRawReadingsAsVector(); > > > > > > for (it = readings->begin(); it != readings->end(); it++) > > > { > > > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), > (*it).getLocalY() ); > > > } > > > sick.unlockDevice(); > > > > > > ArUtil::sleep(100); > > > > > > fclose( dataFile );//closed laser datafile > > > > > > //To store a Image > > > unsigned int width; > > > unsigned int height; > > > static unsigned char jpeg[50000]; > > > int jpegSize; > > > FILE *file; > > > > > > width = packet->bufToUByte2(); > > > height = packet->bufToUByte2(); > > > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > > > if(jpegSize > 50000) > > > { > > > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > > > is %d bytes, my buffer is 50000 bytes)", jpegSize); > > > return; > > > } > > > packet->bufToData((char *)jpeg, jpegSize); > > > const char base[]="image", ext[]=".jpg"; > > > char filename[FILENAME_MAX]; > > > //char tmpFilename[128]; > > > sprintf(filename,"%s%d%s", base, no, ext); > > > > > > > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > > > { > > > fwrite(jpeg, jpegSize, 1, file); > > > fclose(file); > > > > > > #ifdef WIN32 > > > // On windows, rename() fails if the new file already exists > > > unlink(filename); > > > #endif > > > > > > } > > > else > > > ArLog::log(ArLog::Normal, "Could not write temp file "); > > > > > > char ifile[FILENAME_MAX]; > > > sprintf(ifile, "%s%d%s", base, no, ext); > > > img = cvLoadImage(ifile); > > > > > > > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > > > cvShowImage( "image", img ); > > > //cvReleaseImage(&img); > > > //cvDestroyWindow("image"); > > > cvWaitKey(10); > > > no++; > > > } > > > > > > int main(int argc, char **argv) > > > { > > > /* Aria initialization: */ > > > Aria::init(); > > > /* Aria components use this to get options off the command line: */ > > > ArClientSimpleConnector clientConnector(&parser); > > > > > > parser.loadDefaultArguments(); > > > > > > /* Check for -help, and unhandled arguments: */ > > > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > > > { > > > Aria::logOptions(); > > > exit(0); > > > } > > > > > > /* Connect our client object to the remote server: */ > > > if (!clientConnector.connectClient(&client)) > > > { > > > if (client.wasRejected()) > > > printf("Server '%s' rejected connection, exiting\n", > > > client.getHost()); > > > else > > > printf("Could not connect to server '%s', exiting\n", > > > client.getHost()); > > > exit(1); > > > } > > > > > > printf("Connected to server.\n"); > > > > > > client.setRobotName(client.getHost()); // include server name in log > > > messages > > > > > > /* Create a key handler and also tell Aria about it */ > > > ArKeyHandler keyHandler; > > > Aria::setKeyHandler(&keyHandler); > > > > > > /* Global escape-key handler to shut everythnig down */ > > > ArGlobalFunctor escapeCB(&escape); > > > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > > > > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > > > client.addHandler("sendVideo", &jpegHandlerCB); > > > client.runAsync(); > > > > > > /* Create the InputHandler object and request safe-drive mode */ > > > InputHandler inputHandler(&client, &keyHandler); > > > //inputHandler.safeDrive(); > > > > > > /* Use ArClientBase::dataExists() to see if the "ratioDrive" request > > > is available on the > > > * currently connected server. */ > > > if(!client.dataExists("ratioDrive") ) > > > printf("Warning: server does not have ratioDrive command, can not > > > use drive commands!\n"); > > > else > > > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > > > Left\nRIGHT: Turn Right\n"); > > > printf("c: Image capture\n\nesc: shut down\n"); > > > > > > while (client.getRunningWithLock()) > > > { > > > keyHandler.checkKeys(); > > > inputHandler.sendInput(); > > > ArUtil::sleep(100); > > > } > > > > > > /* The client stopped running, due to disconnection from the server, > > > general > > > * Aria shutdown, or some other reason. */ > > > client.disconnect(); > > > Aria::shutdown(); > > > return 0; > > > } > > > > > > > ------------------------------------------------------------------------ > > > *From:* Reed Hedges > > >> > > > *To:* aria-users at lists.mobilerobots.com > > > > > > > *Sent:* Fri, July 9, 2010 1:33:38 AM > > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > > > > Does this always happen, or only sometimes? When it happens, > check the > > > indicator lights on the top of the SICK laser, and note the > sequence of > > > lights and messages printed by arnlServer. Is the laser off (no > > > indicator lights) before you start arnlServer? > > > > > > Reed > > > > > > > > > > > > On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > > > > Hi all, > > > > > > > > please help to find out solutions for two problems mentioned below. > > > > > > > > > > > > 1. laser isn't getting power when i'm running arnlServer > program from > > > > onboard computer... > > > > (but laser works with wander program) > > > > [robot at p3at examples]$ ./arnlServer > > > > Could not connect to simulator, connecting to robot through serial > > port > > > > /dev/ttyS0. > > > > Syncing 0 > > > > Syncing 1 > > > > Syncing 2 > > > > Connected to robot. > > > > Name: Auckland_3502 > > > > Type: Pioneer > > > > Subtype: p3at-sh > > > > Loaded robot parameters from p3at-sh.p > > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, > stopping > > > > Could not connect to all lasers... exiting > > > > > > > > Disconnecting from robot > > > > > > > > 2. How can i save laser reading and images at the same time. > > > > > > > > Any response from you will be appreciated. > > > > > > > > Best regards > > > > Hossain > > > > > > > > > > > > > > > > _______________________________________________ > > > > Aria-users mailing list > > > > Aria-users at lists.mobilerobots.com > > > > > > > > > >> >> > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > >> > > > > >> > > Visit http://robots.mobilerobots.com for information including > > > documentation, FAQ, tips, manuals, and software, firmware and driver > > > downloads. > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > > > > > >> > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > >> > > > > > > Visit http://robots.mobilerobots.com for information including > > > documentation, FAQ, tips, manuals, and software, firmware and driver > > > downloads. > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From zhossain.kuet at yahoo.com Sat Jul 10 00:09:29 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Fri, 9 Jul 2010 21:09:29 -0700 (PDT) Subject: [Aria-users] problem with arnlServer In-Reply-To: <4C375DE5.4060506@mobilerobots.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> <4C373F46.4030307@mobilerobots.com> <819886.98212.qm@web46405.mail.sp1.yahoo.com> <4C37495A.4080005@mobilerobots.com> <142326.1966.qm@web46416.mail.sp1.yahoo.com> <4C375DE5.4060506@mobilerobots.com> Message-ID: <357018.2560.qm@web46414.mail.sp1.yahoo.com> thanks again..it's okay. Yes, when i call jpegHandler, two files are being created where image.jpg file perfect but laser_log.txt file empty. I don't know what to do now. if possible please help. it's very urgent for me. best regards hossain ________________________________ From: Reed Hedges To: "Help, discussion and announcements for MobileRobots' Advanced Robot Interface for Applications (ARIA) " Sent: Sat, July 10, 2010 5:35:33 AM Subject: Re: [Aria-users] problem with arnlServer I was mistaken -- serverDemo *does* have ArHybridForwarderVideo. As far as I can tell from looking quickly at your code, writing to the laser log file should work, if jpegHandler() is called, and it sucessfully opens the file. (you could check whether dataFile is NULL after the call to fopen, in case it fails to open the file for some reason). Is the file created, but empty? Maybe there are 0 raw readings. Hossain, Md.Z wrote: > I am sorry to say i don't understand all of your message. > what I am doing that is I run ./savServer and then ./serverDemo and then > client program in my client laptop. actually i'm getting image properly > whenever i press 'c'(as my program) but in laser file getting nothing.. > > yes i checked before 'getPictureCam1' doesn't work. > ok iwon't use packet from now on. > would you tell me a little bit details? > > best regards > hossain > > ------------------------------------------------------------------------ > *From:* Reed Hedges > *To:* "Help, discussion and announcements for MobileRobots' Advanced > Robot Interface for Applications (ARIA) " > > *Sent:* Sat, July 10, 2010 4:07:54 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > > serverDemo does not normally support any video requests unless you have > modified > it. Since your laser log is written in the video image handler, it > would only > happen if the server responds with a video image. You can add video > serving of > your own design to serverDemo (responding to getPictureCam1 or sendVideo > requests), or you can add a ArHybridForwarderVideo object, and run > savServer or > ACTS before running serverDemo. > > You can check whether the server has the sendVideo request or not. > (Newer ones > have "getPictureCam1" instead, which is a newer scheme to allow for > multiple > cameras and other options as well.) > > if (client.dataExists("getPictureCam1")) > { > client.requestOnce("getPictureCam1"); > } > else if(client.dataExists("sendVideo")) > { > client.requestOnce("sendVideo"); > } > else > { > ArLog::log("Error, server does not support video requests"); > } > > > > Also, note you don't need to supply a packet with the sendVideo request. > > > > > Another problem....i was trying to save a laser txt file and image with > > single stock by below client program. and I used serverDemo as my server > > program. I am getting image properly but in laser txt file no > > data.......please please help.... > > > > Code:(client program) > > > > #include "Aria.h" > > #include "ArNetworking.h" > > #include "cv.h" > > #include "highgui.h" > > #include > > #include > > using namespace std; > > IplImage *img=0; > > int no=1; > > > > ArClientBase client; > > ArSick sick; > > > > > > class InputHandler > > { > > public: > > /** > > * @param client Our client networking object > > * @param keyHandler Key handler to register command callbacks with > > */ > > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > > virtual ~InputHandler(void); > > > > /// Up arrow key handler: drive the robot forward > > void up(void); > > > > /// Down arrow key handler: drive the robot backward > > void down(void); > > > > /// Left arrow key handler: turn the robot left > > void left(void); > > > > > > /// Right arrow key handler: turn the robot right > > void right(void); > > > > /// Send drive request to the server with stored values > > void sendInput(void); > > > > /// Send a request to enable "safe drive" mode on the server > > void imageCapture(); > > > > protected: > > ArClientBase *myClient; > > ArKeyHandler *myKeyHandler; > > > > /// Set this to true in the constructor to print out debugging > information > > bool myPrinting; > > > > /// Current translation value (a percentage of the maximum speed) > > double myTransRatio; > > > > /// Current rotation ration value (a percentage of the maximum > rotational > > velocity) > > double myRotRatio; > > > > > > /** Functor objects, given to the key handler, which then call our > handler > > * methods above */ > > ///@{ > > ArFunctorC myUpCB; > > ArFunctorC myDownCB; > > ArFunctorC myLeftCB; > > ArFunctorC > > myRightCB; > > ArFunctorC myImageCaptureCB; > > > > }; > > > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > *keyHandler) : > > myClient(client), myKeyHandler(keyHandler), > > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > > > /* Initialize functor objects with pointers to our handler methods: */ > > myUpCB(this, &InputHandler::up), > > myDownCB(this, &InputHandler::down), > > myLeftCB(this, &InputHandler::left), > > myRightCB(this, &InputHandler::right), > > myImageCaptureCB(this, &InputHandler::imageCapture) > > { > > > > /* Add our functor objects to the key handler, associated with the > appropriate > > * keys: */ > > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > > } > > > > InputHandler::~InputHandler(void) > > { > > > > } > > > > void InputHandler::up(void) > > { > > if (myPrinting) > > printf("Forwards\n"); > > myTransRatio = 100; > > } > > > > void InputHandler::down(void) > > { > > if (myPrinting) > > printf("Backwards\n"); > > myTransRatio = -100; > > } > > > > void InputHandler::left(void) > > { > > if (myPrinting) > > printf("Left\n"); > > myRotRatio = 100; > > } > > > > void InputHandler::right(void) > > { > > if (myPrinting) > > printf("Right\n"); > > myRotRatio = -100; > > } > > > > void InputHandler::imageCapture() > > { > > /* Construct a request packet. The data is a single byte, with value > > * 1 to enable safe drive, 0 to disable. */ > > ArNetPacket p; > > p.uByteToBuf(90); > > client.requestOnce("sendVideo", &p); > > } > > > > > > void > > InputHandler::sendInput(void) > > { > > /* This method is called by the main function to send a ratioDrive > > * request with our current velocity values. If the server does > > * not support the ratioDrive request, then we abort now: */ > > if(!myClient->dataExists("ratioDrive")) return; > > /// Send a request to enable "safe drive" mode on the server > > void safeDrive(); > > /* Construct a ratioDrive request packet. It consists > > * of three doubles: translation ratio, rotation ratio, and an > overall scaling > > * factor. */ > > ArNetPacket packet; > > packet.doubleToBuf(myTransRatio); > > packet.doubleToBuf(myRotRatio); > > packet.doubleToBuf(50); // use half of the robot's maximum. > > //packet.doubleToBuf(myLatRatio); > > if (myPrinting) > > printf("Sending\n"); > > myClient->requestOnce("ratioDrive", &packet); > > myTransRatio = 0; > > myRotRatio = 0; > > //myLatRatio = 0; > > } > > > > > > > > /* Key handler for > > the escape key: shutdown all of Aria. */ > > void escape(void) > > { > > printf("esc pressed, shutting down aria\n"); > > Aria::shutdown(); > > } > > > > /*Key Handler for the capture key: capture a picture. */ > > void jpegHandler(ArNetPacket *packet) > > { > > //To write a Laser data file > > std::vector< ArSensorReading >* readings; > > std::vector< ArSensorReading >::iterator it; > > > > FILE* dataFile; > > dataFile = fopen("laser_log.txt", "w"); > > > > sick.lockDevice(); > > > > readings = sick.getRawReadingsAsVector(); > > > > for (it = readings->begin(); it != readings->end(); it++) > > { > > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > > } > > sick.unlockDevice(); > > > > ArUtil::sleep(100); > > > > fclose( dataFile );//closed laser datafile > > > > //To store a Image > > unsigned int width; > > unsigned int height; > > static unsigned char jpeg[50000]; > > int jpegSize; > > > > FILE *file; > > > > width = packet->bufToUByte2(); > > height = packet->bufToUByte2(); > > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > > if(jpegSize > 50000) > > { > > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > is %d > > bytes, my buffer is 50000 bytes)", jpegSize); > > return; > > } > > packet->bufToData((char *)jpeg, jpegSize); > > const char base[]="image", ext[]=".jpg"; > > char filename[FILENAME_MAX]; > > //char tmpFilename[128]; > > sprintf(filename,"%s%d%s", base, no, ext); > > > > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > > { > > fwrite(jpeg, jpegSize, 1, file); > > fclose(file); > > > > #ifdef WIN32 > > // On windows, rename() fails if the new file already exists > > unlink(filename); > > #endif > > > > } > > else > > ArLog::log(ArLog::Normal, "Could not write temp file "); > > > > char ifile[FILENAME_MAX]; > > > > sprintf(ifile, "%s%d%s", base, no, ext); > > img = cvLoadImage(ifile); > > > > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > > cvShowImage( "image", img ); > > //cvReleaseImage(&img); > > //cvDestroyWindow("image"); > > cvWaitKey(10); > > no++; > > } > > > > int main(int argc, char **argv) > > { > > /* Aria initialization: */ > > Aria::init(); > > /* Aria components use this to get options off the command line: */ > > ArClientSimpleConnector clientConnector(&parser); > > > > parser.loadDefaultArguments(); > > > > /* Check for -help, and unhandled arguments: */ > > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > > { > > Aria::logOptions(); > > exit(0); > > } > > > > /* Connect our client object to the remote server: */ > > if (!clientConnector.connectClient(&client)) > > { > > if (client.wasRejected()) > > printf("Server '%s' rejected connection, exiting\n", > > client.getHost()); > > else > > printf("Could not connect to server '%s', exiting\n", > client.getHost()); > > exit(1); > > } > > > > printf("Connected to server.\n"); > > > > client.setRobotName(client.getHost()); // include server name in log > messages > > > > /* Create a key handler and also tell Aria about it */ > > ArKeyHandler keyHandler; > > Aria::setKeyHandler(&keyHandler); > > > > /* Global escape-key handler to shut everythnig down */ > > ArGlobalFunctor escapeCB(&escape); > > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > > client.addHandler("sendVideo", &jpegHandlerCB); > > client.runAsync(); > > > > /* Create the InputHandler object and request safe-drive mode */ > > InputHandler inputHandler(&client, &keyHandler); > > //inputHandler.safeDrive(); > > > > /* Use ArClientBase::dataExists() to see if the > > "ratioDrive" request is > > available on the > > > > * currently connected server. */ > > if(!client.dataExists("ratioDrive") ) > > printf("Warning: server does not have ratioDrive command, can > not use > > drive commands!\n"); > > else > > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > Left\nRIGHT: > > Turn Right\n"); > > printf("c: Image capture\n\nesc: shut down\n"); > > > > while (client.getRunningWithLock()) > > { > > keyHandler.checkKeys(); > > inputHandler.sendInput(); > > ArUtil::sleep(100); > > } > > > > /* The client stopped running, due to disconnection from the server, > general > > * Aria shutdown, or some other reason. */ > > client.disconnect(); > > Aria::shutdown(); > > return 0; > > } > > > > > > > > ------------------------------------------------------------------------ > > *From:* Reed Hedges > > > *To:* "Help, discussion and announcements for MobileRobots' Advanced > > Robot Interface for Applications (ARIA) " > > > > > *Sent:* Sat, July 10, 2010 3:24:54 AM > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > Is there any difference in robot when you use serverDemo or arnlServer, > > or is it > > the same robot, same computer, etc? Is the switch on the back of the > > laser in > > the on position? > > > > Hossain, Md.Z wrote: > > > Hi, > > > > > > sorry I missed one question to answer in my previous mail.... > > > > > > Indicator light remains off all time and getting this output.. > > > > > > [robot at p3at examples]$ ./arnlServer > > > > Could not connect to simulator, connecting to robot through serial > > port > > > > /dev/ttyS0. > > > > Syncing 0 > > > > Syncing 1 > > > > Syncing 2 > > > > Connected to robot. > > > > Name: Auckland_3502 > > > > Type: Pioneer > > > > Subtype: p3at-sh > > > > Loaded robot parameters from p3at-sh.p > > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, > stopping > > > > Could not connect to all lasers... exiting > > > > > > > > Disconnecting from robot > > > > > > Would you please have a look in my previous mail and give your > comments? > > > > > > Best regards > > > hossain > > > > > > > > > > ------------------------------------------------------------------------ > > > *From:* "Hossain, Md.Z" > > >> > > > *To:* "Help, discussion and announcements for MobileRobots' Advanced > > > Robot Interface for Applications (ARIA) " > > > > > >> > > > *Sent:* Sat, July 10, 2010 12:36:23 AM > > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > Hi Reed > > > > > > Thank you very much for your reply. > > > > > > Yes always getting same response. but when i use serverDemo from > > > ArNetworking then it's working perfectly. > > > > > > Another problem....i was trying to save a laser txt file and image > with > > > single stock by this client program. and I used serverDemo as my > server > > > program. I am getting image properly but in laser txt file no > > > data.......please please help.... > > > > > > > > > Code:(client program) > > > > > > #include "Aria.h" > > > #include "ArNetworking.h" > > > #include "cv.h" > > > #include "highgui.h" > > > #include > > > #include > > > using namespace std; > > > IplImage *img=0; > > > int no=1; > > > > > > ArClientBase client; > > > ArSick sick; > > > > > > > > > class InputHandler > > > { > > > public: > > > /** > > > * @param client Our client networking object > > > * @param keyHandler Key handler to register command callbacks with > > > */ > > > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > > > virtual ~InputHandler(void); > > > > > > /// Up arrow key handler: drive the robot forward > > > void up(void); > > > > > > /// Down arrow key handler: drive the robot backward > > > void down(void); > > > > > > /// Left arrow key handler: turn the robot left > > > void left(void); > > > > > > /// Right arrow key handler: turn the robot right > > > void right(void); > > > > > > /// Send drive request to the server with stored values > > > void sendInput(void); > > > > > > /// Send a request to enable "safe drive" mode on the server > > > void imageCapture(); > > > > > > protected: > > > ArClientBase *myClient; > > > ArKeyHandler *myKeyHandler; > > > > > > /// Set this to true in the constructor to print out debugging > > information > > > bool myPrinting; > > > > > > /// Current translation value (a percentage of the maximum speed) > > > double myTransRatio; > > > > > > /// Current rotation ration value (a percentage of the maximum > > > rotational velocity) > > > double myRotRatio; > > > > > > > > > /** Functor objects, given to the key handler, which then call our > > handler > > > * methods above */ > > > ///@{ > > > ArFunctorC myUpCB; > > > ArFunctorC myDownCB; > > > ArFunctorC myLeftCB; > > > ArFunctorC myRightCB; > > > ArFunctorC myImageCaptureCB; > > > > > > }; > > > > > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > > > *keyHandler) : > > > myClient(client), myKeyHandler(keyHandler), > > > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > > > > > /* Initialize functor objects with pointers to our handler > methods: */ > > > myUpCB(this, &InputHandler::up), > > > myDownCB(this, &InputHandler::down), > > > myLeftCB(this, &InputHandler::left), > > > myRightCB(this, &InputHandler::right), > > > myImageCaptureCB(this, &InputHandler::imageCapture) > > > { > > > > > > /* Add our functor objects to the key handler, associated with the > > > appropriate > > > * keys: */ > > > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > > > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > > > } > > > > > > InputHandler::~InputHandler(void) > > > { > > > > > > } > > > > > > void InputHandler::up(void) > > > { > > > if (myPrinting) > > > printf("Forwards\n"); > > > myTransRatio = 100; > > > } > > > > > > void InputHandler::down(void) > > > { > > > if (myPrinting) > > > printf("Backwards\n"); > > > myTransRatio = -100; > > > } > > > > > > void InputHandler::left(void) > > > { > > > if (myPrinting) > > > printf("Left\n"); > > > myRotRatio = 100; > > > } > > > > > > void InputHandler::right(void) > > > { > > > if (myPrinting) > > > printf("Right\n"); > > > myRotRatio = -100; > > > } > > > > > > void InputHandler::imageCapture() > > > { > > > /* Construct a request packet. The data is a single byte, with value > > > * 1 to enable safe drive, 0 to disable. */ > > > ArNetPacket p; > > > p.uByteToBuf(90); > > > client.requestOnce("sendVideo", &p); > > > } > > > > > > > > > void InputHandler::sendInput(void) > > > { > > > /* This method is called by the main function to send a ratioDrive > > > * request with our current velocity values. If the server does > > > * not support the ratioDrive request, then we abort now: */ > > > if(!myClient->dataExists("ratioDrive")) return; > > > /// Send a request to enable "safe drive" mode on the server > > > void safeDrive(); > > > /* Construct a ratioDrive request packet. It consists > > > * of three doubles: translation ratio, rotation ratio, and an > overall > > > scaling > > > * factor. */ > > > ArNetPacket packet; > > > packet.doubleToBuf(myTransRatio); > > > packet.doubleToBuf(myRotRatio); > > > packet.doubleToBuf(50); // use half of the robot's maximum. > > > //packet.doubleToBuf(myLatRatio); > > > if (myPrinting) > > > printf("Sending\n"); > > > myClient->requestOnce("ratioDrive", &packet); > > > myTransRatio = 0; > > > myRotRatio = 0; > > > //myLatRatio = 0; > > > } > > > > > > > > > > > > /* Key handler for the escape key: shutdown all of Aria. */ > > > void escape(void) > > > { > > > printf("esc pressed, shutting down aria\n"); > > > Aria::shutdown(); > > > } > > > > > > /*Key Handler for the capture key: capture a picture. */ > > > void jpegHandler(ArNetPacket *packet) > > > { > > > //To write a Laser data file > > > std::vector< ArSensorReading >* readings; > > > std::vector< ArSensorReading >::iterator it; > > > > > > FILE* dataFile; > > > dataFile = fopen("laser_log.txt", "w"); > > > > > > sick.lockDevice(); > > > > > > readings = sick.getRawReadingsAsVector(); > > > > > > for (it = readings->begin(); it != readings->end(); it++) > > > { > > > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), > (*it).getLocalY() ); > > > } > > > sick.unlockDevice(); > > > > > > ArUtil::sleep(100); > > > > > > fclose( dataFile );//closed laser datafile > > > > > > //To store a Image > > > unsigned int width; > > > unsigned int height; > > > static unsigned char jpeg[50000]; > > > int jpegSize; > > > FILE *file; > > > > > > width = packet->bufToUByte2(); > > > height = packet->bufToUByte2(); > > > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > > > if(jpegSize > 50000) > > > { > > > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > > > is %d bytes, my buffer is 50000 bytes)", jpegSize); > > > return; > > > } > > > packet->bufToData((char *)jpeg, jpegSize); > > > const char base[]="image", ext[]=".jpg"; > > > char filename[FILENAME_MAX]; > > > //char tmpFilename[128]; > > > sprintf(filename,"%s%d%s", base, no, ext); > > > > > > > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > > > { > > > fwrite(jpeg, jpegSize, 1, file); > > > fclose(file); > > > > > > #ifdef WIN32 > > > // On windows, rename() fails if the new file already exists > > > unlink(filename); > > > #endif > > > > > > } > > > else > > > ArLog::log(ArLog::Normal, "Could not write temp file "); > > > > > > char ifile[FILENAME_MAX]; > > > sprintf(ifile, "%s%d%s", base, no, ext); > > > img = cvLoadImage(ifile); > > > > > > > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > > > cvShowImage( "image", img ); > > > //cvReleaseImage(&img); > > > //cvDestroyWindow("image"); > > > cvWaitKey(10); > > > no++; > > > } > > > > > > int main(int argc, char **argv) > > > { > > > /* Aria initialization: */ > > > Aria::init(); > > > /* Aria components use this to get options off the command line: */ > > > ArClientSimpleConnector clientConnector(&parser); > > > > > > parser.loadDefaultArguments(); > > > > > > /* Check for -help, and unhandled arguments: */ > > > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > > > { > > > Aria::logOptions(); > > > exit(0); > > > } > > > > > > /* Connect our client object to the remote server: */ > > > if (!clientConnector.connectClient(&client)) > > > { > > > if (client.wasRejected()) > > > printf("Server '%s' rejected connection, exiting\n", > > > client.getHost()); > > > else > > > printf("Could not connect to server '%s', exiting\n", > > > client.getHost()); > > > exit(1); > > > } > > > > > > printf("Connected to server.\n"); > > > > > > client.setRobotName(client.getHost()); // include server name in log > > > messages > > > > > > /* Create a key handler and also tell Aria about it */ > > > ArKeyHandler keyHandler; > > > Aria::setKeyHandler(&keyHandler); > > > > > > /* Global escape-key handler to shut everythnig down */ > > > ArGlobalFunctor escapeCB(&escape); > > > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > > > > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > > > client.addHandler("sendVideo", &jpegHandlerCB); > > > client.runAsync(); > > > > > > /* Create the InputHandler object and request safe-drive mode */ > > > InputHandler inputHandler(&client, &keyHandler); > > > //inputHandler.safeDrive(); > > > > > > /* Use ArClientBase::dataExists() to see if the "ratioDrive" request > > > is available on the > > > * currently connected server. */ > > > if(!client.dataExists("ratioDrive") ) > > > printf("Warning: server does not have ratioDrive command, can not > > > use drive commands!\n"); > > > else > > > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > > > Left\nRIGHT: Turn Right\n"); > > > printf("c: Image capture\n\nesc: shut down\n"); > > > > > > while (client.getRunningWithLock()) > > > { > > > keyHandler.checkKeys(); > > > inputHandler.sendInput(); > > > ArUtil::sleep(100); > > > } > > > > > > /* The client stopped running, due to disconnection from the server, > > > general > > > * Aria shutdown, or some other reason. */ > > > client.disconnect(); > > > Aria::shutdown(); > > > return 0; > > > } > > > > > > > ------------------------------------------------------------------------ > > > *From:* Reed Hedges > > >> > > > *To:* aria-users at lists.mobilerobots.com > > > > > > > *Sent:* Fri, July 9, 2010 1:33:38 AM > > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > > > > Does this always happen, or only sometimes? When it happens, > check the > > > indicator lights on the top of the SICK laser, and note the > sequence of > > > lights and messages printed by arnlServer. Is the laser off (no > > > indicator lights) before you start arnlServer? > > > > > > Reed > > > > > > > > > > > > On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > > > > Hi all, > > > > > > > > please help to find out solutions for two problems mentioned below. > > > > > > > > > > > > 1. laser isn't getting power when i'm running arnlServer > program from > > > > onboard computer... > > > > (but laser works with wander program) > > > > [robot at p3at examples]$ ./arnlServer > > > > Could not connect to simulator, connecting to robot through serial > > port > > > > /dev/ttyS0. > > > > Syncing 0 > > > > Syncing 1 > > > > Syncing 2 > > > > Connected to robot. > > > > Name: Auckland_3502 > > > > Type: Pioneer > > > > Subtype: p3at-sh > > > > Loaded robot parameters from p3at-sh.p > > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, > stopping > > > > Could not connect to all lasers... exiting > > > > > > > > Disconnecting from robot > > > > > > > > 2. How can i save laser reading and images at the same time. > > > > > > > > Any response from you will be appreciated. > > > > > > > > Best regards > > > > Hossain > > > > > > > > > > > > > > > > _______________________________________________ > > > > Aria-users mailing list > > > > Aria-users at lists.mobilerobots.com > > > > > > > > > >> >> > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > >> > > > > >> > > Visit http://robots.mobilerobots.com for information including > > > documentation, FAQ, tips, manuals, and software, firmware and driver > > > downloads. > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > > > > > >> > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > >> > > > > > > Visit http://robots.mobilerobots.com for information including > > > documentation, FAQ, tips, manuals, and software, firmware and driver > > > downloads. > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, >FAQ, tips, manuals, and software, firmware and driver downloads. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100709/5c425a68/attachment-0001.html From shai.kaplan at gmail.com Mon Jul 12 08:46:05 2010 From: shai.kaplan at gmail.com (Shai Kaplan) Date: Mon, 12 Jul 2010 15:46:05 +0300 Subject: [Aria-users] odometry getPose problem in python on windows Message-ID: Hi All, I am using the ARIA with python 2.6 on windows. In general it works OK. For some reason I get zeros in all odometry functions getPose getX getY etc. whe I use the MobileSim. This problem for example demonstrated with the simple.py python example provided with ARIA. I have not tried it yet on the robot itself. I can tell that the demo.exe retrieve odometry information correctly from the mobilesim (in position mode). Thanks for any help. Shai -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100712/68f8d516/attachment.html From zhossain.kuet at yahoo.com Mon Jul 12 19:46:52 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Mon, 12 Jul 2010 16:46:52 -0700 (PDT) Subject: [Aria-users] Failed to get laser data Message-ID: <348507.53442.qm@web46416.mail.sp1.yahoo.com> Hi, When i call jpegHandler, two files are being created(when i press 'c' according to my program) where image.jpg file perfect but laser_log.txt file empty. I don't know what to do now. if possible please help. it's very urgent for me. I run ./savServer and ./serverDemo and then client program from my laptop. Any advice will be appreciated. (Client Program) #include "Aria.h" #include "ArNetworking.h" #include "cv.h" #include "highgui.h" #include #include using namespace std; IplImage *img=0; int no=1; ArClientBase client; ArSick sick; class InputHandler { public: /** * @param client Our client networking object * @param keyHandler Key handler to register command callbacks with */ InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); virtual ~InputHandler(void); /// Up arrow key handler: drive the robot forward void up(void); /// Down arrow key handler: drive the robot backward void down(void); /// Left arrow key handler: turn the robot left void left(void); /// Right arrow key handler: turn the robot right void right(void); /// Send drive request to the server with stored values void sendInput(void); /// Send a request to enable "safe drive" mode on the server void imageCapture(); protected: ArClientBase *myClient; ArKeyHandler *myKeyHandler; /// Set this to true in the constructor to print out debugging information bool myPrinting; /// Current translation value (a percentage of the maximum speed) double myTransRatio; /// Current rotation ration value (a percentage of the maximum rotational velocity) double myRotRatio; /** Functor objects, given to the key handler, which then call our handler * methods above */ ///@{ ArFunctorC myUpCB; ArFunctorC myDownCB; ArFunctorC myLeftCB; ArFunctorC myRightCB; ArFunctorC myImageCaptureCB; }; InputHandler::InputHandler(ArClientBase *client, ArKeyHandler *keyHandler) : myClient(client), myKeyHandler(keyHandler), myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), /* Initialize functor objects with pointers to our handler methods: */ myUpCB(this, &InputHandler::up), myDownCB(this, &InputHandler::down), myLeftCB(this, &InputHandler::left), myRightCB(this, &InputHandler::right), myImageCaptureCB(this, &InputHandler::imageCapture) { /* Add our functor objects to the key handler, associated with the appropriate * keys: */ myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); myKeyHandler->addKeyHandler('c', &myImageCaptureCB); } InputHandler::~InputHandler(void) { } void InputHandler::up(void) { if (myPrinting) printf("Forwards\n"); myTransRatio = 100; } void InputHandler::down(void) { if (myPrinting) printf("Backwards\n"); myTransRatio = -100; } void InputHandler::left(void) { if (myPrinting) printf("Left\n"); myRotRatio = 100; } void InputHandler::right(void) { if (myPrinting) printf("Right\n"); myRotRatio = -100; } void InputHandler::imageCapture() { /* Construct a request packet. The data is a single byte, with value * 1 to enable safe drive, 0 to disable. */ ArNetPacket p; p.uByteToBuf(90); client.requestOnce("sendVideo", &p); } void InputHandler::sendInput(void) { if(!myClient->dataExists("ratioDrive")) return; /// Send a request to enable "safe drive" mode on the server void safeDrive(); /* Construct a ratioDrive request packet. It consists * of three doubles: translation ratio, rotation ratio, and an overall scaling * factor. */ ArNetPacket packet; packet.doubleToBuf(myTransRatio); packet.doubleToBuf(myRotRatio); packet.doubleToBuf(50); // use half of the robot's maximum. //packet.doubleToBuf(myLatRatio); if (myPrinting) printf("Sending\n"); myClient->requestOnce("ratioDrive", &packet); myTransRatio = 0; myRotRatio = 0; //myLatRatio = 0; } /* Key handler for the escape key: shutdown all of Aria. */ void escape(void) { printf("esc pressed, shutting down aria\n"); Aria::shutdown(); } /*Key Handler for the capture key: capture a picture. */ void jpegHandler(ArNetPacket *packet) { //double filter=30000; std::vector< ArSensorReading >* readings; std::vector< ArSensorReading >::iterator it; // int counter=0; FILE* dataFile; dataFile = fopen("laser_log.txt", "w"); sick.lockDevice(); readings = sick.getRawReadingsAsVector(); for (it = readings->begin(); it != readings->end(); it++) { fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); } sick.unlockDevice(); ArUtil::sleep(100); fclose( dataFile ); unsigned int width; unsigned int height; static unsigned char jpeg[50000]; int jpegSize; FILE *file; width = packet->bufToUByte2(); height = packet->bufToUByte2(); jpegSize = packet->getDataLength() - packet->getDataReadLength(); if(jpegSize > 50000) { ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image is %d bytes, my buffer is 50000 bytes)", jpegSize); return; } packet->bufToData((char *)jpeg, jpegSize); const char base[]="image", ext[]=".jpg"; char filename[FILENAME_MAX]; //char tmpFilename[128]; sprintf(filename,"%s%d%s", base, no, ext); if ((file = ArUtil::fopen(filename, "wb")) != NULL) { fwrite(jpeg, jpegSize, 1, file); fclose(file); #ifdef WIN32 // On windows, rename() fails if the new file already exists unlink(filename); #endif } else ArLog::log(ArLog::Normal, "Could not write temp file "); char ifile[FILENAME_MAX]; sprintf(ifile, "%s%d%s", base, no, ext); img = cvLoadImage(ifile); cvNamedWindow("image",CV_WINDOW_AUTOSIZE); cvShowImage( "image", img ); //cvReleaseImage(&img); //cvDestroyWindow("image"); cvWaitKey(10); no++; } int main(int argc, char **argv) { /* Aria initialization: */ Aria::init(); /* Aria components use this to get options off the command line: */ ArArgumentParser parser(&argc, argv); ArClientSimpleConnector clientConnector(&parser); parser.loadDefaultArguments(); /* Check for -help, and unhandled arguments: */ if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) { Aria::logOptions(); exit(0); } /* Connect our client object to the remote server: */ if (!clientConnector.connectClient(&client)) { if (client.wasRejected()) printf("Server '%s' rejected connection, exiting\n", client.getHost()); else printf("Could not connect to server '%s', exiting\n", client.getHost()); exit(1); } printf("Connected to server.\n"); client.setRobotName(client.getHost()); // include server name in log messages /* Create a key handler and also tell Aria about it */ ArKeyHandler keyHandler; Aria::setKeyHandler(&keyHandler); /* Global escape-key handler to shut everythnig down */ ArGlobalFunctor escapeCB(&escape); keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); client.addHandler("sendVideo", &jpegHandlerCB); client.runAsync(); /* Create the InputHandler object and request safe-drive mode */ InputHandler inputHandler(&client, &keyHandler); //inputHandler.safeDrive(); /* Use ArClientBase::dataExists() to see if the "ratioDrive" request is available on the * currently connected server. */ if(!client.dataExists("ratioDrive") ) printf("Warning: server does not have ratioDrive command, can not use drive commands!\n"); else printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn Left\nRIGHT: Turn Right\n"); printf("c: Image capture\n\nesc: shut down\n"); while (client.getRunningWithLock()) { keyHandler.checkKeys(); inputHandler.sendInput(); ArUtil::sleep(100); } /* The client stopped running, due to disconnection from the server, general * Aria shutdown, or some other reason. */ client.disconnect(); Aria::shutdown(); return 0; } best regards hossain ________________________________ From: Reed Hedges To: "Help, discussion and announcements for MobileRobots' Advanced Robot Interface for Applications (ARIA) " Sent: Sat, July 10, 2010 5:35:33 AM Subject: Re: [Aria-users] problem with arnlServer I was mistaken -- serverDemo *does* have ArHybridForwarderVideo. As far as I can tell from looking quickly at your code, writing to the laser log file should work, if jpegHandler() is called, and it sucessfully opens the file. (you could check whether dataFile is NULL after the call to fopen, in case it fails to open the file for some reason). Is the file created, but empty? Maybe there are 0 raw readings. Hossain, Md.Z wrote: > I am sorry to say i don't understand all of your message. > what I am doing that is I run ./savServer and then ./serverDemo and then > client program in my client laptop. actually i'm getting image properly > whenever i press 'c'(as my program) but in laser file getting nothing.. > > yes i checked before 'getPictureCam1' doesn't work. > ok iwon't use packet from now on. > would you tell me a little bit details? > > best regards > hossain > > ------------------------------------------------------------------------ > *From:* Reed Hedges > *To:* "Help, discussion and announcements for MobileRobots' Advanced > Robot Interface for Applications (ARIA) " > > *Sent:* Sat, July 10, 2010 4:07:54 AM > *Subject:* Re: [Aria-users] problem with arnlServer > > > serverDemo does not normally support any video requests unless you have > modified > it. Since your laser log is written in the video image handler, it > would only > happen if the server responds with a video image. You can add video > serving of > your own design to serverDemo (responding to getPictureCam1 or sendVideo > requests), or you can add a ArHybridForwarderVideo object, and run > savServer or > ACTS before running serverDemo. > > You can check whether the server has the sendVideo request or not. > (Newer ones > have "getPictureCam1" instead, which is a newer scheme to allow for > multiple > cameras and other options as well.) > > if (client.dataExists("getPictureCam1")) > { > client.requestOnce("getPictureCam1"); > } > else if(client.dataExists("sendVideo")) > { > client.requestOnce("sendVideo"); > } > else > { > ArLog::log("Error, server does not support video requests"); > } > > > > Also, note you don't need to supply a packet with the sendVideo request. > > > > > Another problem....i was trying to save a laser txt file and image with > > single stock by below client program. and I used serverDemo as my server > > program. I am getting image properly but in laser txt file no > > data.......please please help.... > > > > Code:(client program) > > > > #include "Aria.h" > > #include "ArNetworking.h" > > #include "cv.h" > > #include "highgui.h" > > #include > > #include > > using namespace std; > > IplImage *img=0; > > int no=1; > > > > ArClientBase client; > > ArSick sick; > > > > > > class InputHandler > > { > > public: > > /** > > * @param client Our client networking object > > * @param keyHandler Key handler to register command callbacks with > > */ > > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > > virtual ~InputHandler(void); > > > > /// Up arrow key handler: drive the robot forward > > void up(void); > > > > /// Down arrow key handler: drive the robot backward > > void down(void); > > > > /// Left arrow key handler: turn the robot left > > void left(void); > > > > > > /// Right arrow key handler: turn the robot right > > void right(void); > > > > /// Send drive request to the server with stored values > > void sendInput(void); > > > > /// Send a request to enable "safe drive" mode on the server > > void imageCapture(); > > > > protected: > > ArClientBase *myClient; > > ArKeyHandler *myKeyHandler; > > > > /// Set this to true in the constructor to print out debugging > information > > bool myPrinting; > > > > /// Current translation value (a percentage of the maximum speed) > > double myTransRatio; > > > > /// Current rotation ration value (a percentage of the maximum > rotational > > velocity) > > double myRotRatio; > > > > > > /** Functor objects, given to the key handler, which then call our > handler > > * methods above */ > > ///@{ > > ArFunctorC myUpCB; > > ArFunctorC myDownCB; > > ArFunctorC myLeftCB; > > ArFunctorC > > myRightCB; > > ArFunctorC myImageCaptureCB; > > > > }; > > > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > *keyHandler) : > > myClient(client), myKeyHandler(keyHandler), > > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > > > /* Initialize functor objects with pointers to our handler methods: */ > > myUpCB(this, &InputHandler::up), > > myDownCB(this, &InputHandler::down), > > myLeftCB(this, &InputHandler::left), > > myRightCB(this, &InputHandler::right), > > myImageCaptureCB(this, &InputHandler::imageCapture) > > { > > > > /* Add our functor objects to the key handler, associated with the > appropriate > > * keys: */ > > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > > } > > > > InputHandler::~InputHandler(void) > > { > > > > } > > > > void InputHandler::up(void) > > { > > if (myPrinting) > > printf("Forwards\n"); > > myTransRatio = 100; > > } > > > > void InputHandler::down(void) > > { > > if (myPrinting) > > printf("Backwards\n"); > > myTransRatio = -100; > > } > > > > void InputHandler::left(void) > > { > > if (myPrinting) > > printf("Left\n"); > > myRotRatio = 100; > > } > > > > void InputHandler::right(void) > > { > > if (myPrinting) > > printf("Right\n"); > > myRotRatio = -100; > > } > > > > void InputHandler::imageCapture() > > { > > /* Construct a request packet. The data is a single byte, with value > > * 1 to enable safe drive, 0 to disable. */ > > ArNetPacket p; > > p.uByteToBuf(90); > > client.requestOnce("sendVideo", &p); > > } > > > > > > void > > InputHandler::sendInput(void) > > { > > /* This method is called by the main function to send a ratioDrive > > * request with our current velocity values. If the server does > > * not support the ratioDrive request, then we abort now: */ > > if(!myClient->dataExists("ratioDrive")) return; > > /// Send a request to enable "safe drive" mode on the server > > void safeDrive(); > > /* Construct a ratioDrive request packet. It consists > > * of three doubles: translation ratio, rotation ratio, and an > overall scaling > > * factor. */ > > ArNetPacket packet; > > packet.doubleToBuf(myTransRatio); > > packet.doubleToBuf(myRotRatio); > > packet.doubleToBuf(50); // use half of the robot's maximum. > > //packet.doubleToBuf(myLatRatio); > > if (myPrinting) > > printf("Sending\n"); > > myClient->requestOnce("ratioDrive", &packet); > > myTransRatio = 0; > > myRotRatio = 0; > > //myLatRatio = 0; > > } > > > > > > > > /* Key handler for > > the escape key: shutdown all of Aria. */ > > void escape(void) > > { > > printf("esc pressed, shutting down aria\n"); > > Aria::shutdown(); > > } > > > > /*Key Handler for the capture key: capture a picture. */ > > void jpegHandler(ArNetPacket *packet) > > { > > //To write a Laser data file > > std::vector< ArSensorReading >* readings; > > std::vector< ArSensorReading >::iterator it; > > > > FILE* dataFile; > > dataFile = fopen("laser_log.txt", "w"); > > > > sick.lockDevice(); > > > > readings = sick.getRawReadingsAsVector(); > > > > for (it = readings->begin(); it != readings->end(); it++) > > { > > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), (*it).getLocalY() ); > > } > > sick.unlockDevice(); > > > > ArUtil::sleep(100); > > > > fclose( dataFile );//closed laser datafile > > > > //To store a Image > > unsigned int width; > > unsigned int height; > > static unsigned char jpeg[50000]; > > int jpegSize; > > > > FILE *file; > > > > width = packet->bufToUByte2(); > > height = packet->bufToUByte2(); > > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > > if(jpegSize > 50000) > > { > > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > is %d > > bytes, my buffer is 50000 bytes)", jpegSize); > > return; > > } > > packet->bufToData((char *)jpeg, jpegSize); > > const char base[]="image", ext[]=".jpg"; > > char filename[FILENAME_MAX]; > > //char tmpFilename[128]; > > sprintf(filename,"%s%d%s", base, no, ext); > > > > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > > { > > fwrite(jpeg, jpegSize, 1, file); > > fclose(file); > > > > #ifdef WIN32 > > // On windows, rename() fails if the new file already exists > > unlink(filename); > > #endif > > > > } > > else > > ArLog::log(ArLog::Normal, "Could not write temp file "); > > > > char ifile[FILENAME_MAX]; > > > > sprintf(ifile, "%s%d%s", base, no, ext); > > img = cvLoadImage(ifile); > > > > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > > cvShowImage( "image", img ); > > //cvReleaseImage(&img); > > //cvDestroyWindow("image"); > > cvWaitKey(10); > > no++; > > } > > > > int main(int argc, char **argv) > > { > > /* Aria initialization: */ > > Aria::init(); > > /* Aria components use this to get options off the command line: */ > > ArClientSimpleConnector clientConnector(&parser); > > > > parser.loadDefaultArguments(); > > > > /* Check for -help, and unhandled arguments: */ > > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > > { > > Aria::logOptions(); > > exit(0); > > } > > > > /* Connect our client object to the remote server: */ > > if (!clientConnector.connectClient(&client)) > > { > > if (client.wasRejected()) > > printf("Server '%s' rejected connection, exiting\n", > > client.getHost()); > > else > > printf("Could not connect to server '%s', exiting\n", > client.getHost()); > > exit(1); > > } > > > > printf("Connected to server.\n"); > > > > client.setRobotName(client.getHost()); // include server name in log > messages > > > > /* Create a key handler and also tell Aria about it */ > > ArKeyHandler keyHandler; > > Aria::setKeyHandler(&keyHandler); > > > > /* Global escape-key handler to shut everythnig down */ > > ArGlobalFunctor escapeCB(&escape); > > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > > client.addHandler("sendVideo", &jpegHandlerCB); > > client.runAsync(); > > > > /* Create the InputHandler object and request safe-drive mode */ > > InputHandler inputHandler(&client, &keyHandler); > > //inputHandler.safeDrive(); > > > > /* Use ArClientBase::dataExists() to see if the > > "ratioDrive" request is > > available on the > > > > * currently connected server. */ > > if(!client.dataExists("ratioDrive") ) > > printf("Warning: server does not have ratioDrive command, can > not use > > drive commands!\n"); > > else > > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > Left\nRIGHT: > > Turn Right\n"); > > printf("c: Image capture\n\nesc: shut down\n"); > > > > while (client.getRunningWithLock()) > > { > > keyHandler.checkKeys(); > > inputHandler.sendInput(); > > ArUtil::sleep(100); > > } > > > > /* The client stopped running, due to disconnection from the server, > general > > * Aria shutdown, or some other reason. */ > > client.disconnect(); > > Aria::shutdown(); > > return 0; > > } > > > > > > > > ------------------------------------------------------------------------ > > *From:* Reed Hedges > > > *To:* "Help, discussion and announcements for MobileRobots' Advanced > > Robot Interface for Applications (ARIA) " > > > > > *Sent:* Sat, July 10, 2010 3:24:54 AM > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > Is there any difference in robot when you use serverDemo or arnlServer, > > or is it > > the same robot, same computer, etc? Is the switch on the back of the > > laser in > > the on position? > > > > Hossain, Md.Z wrote: > > > Hi, > > > > > > sorry I missed one question to answer in my previous mail.... > > > > > > Indicator light remains off all time and getting this output.. > > > > > > [robot at p3at examples]$ ./arnlServer > > > > Could not connect to simulator, connecting to robot through serial > > port > > > > /dev/ttyS0. > > > > Syncing 0 > > > > Syncing 1 > > > > Syncing 2 > > > > Connected to robot. > > > > Name: Auckland_3502 > > > > Type: Pioneer > > > > Subtype: p3at-sh > > > > Loaded robot parameters from p3at-sh.p > > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, > stopping > > > > Could not connect to all lasers... exiting > > > > > > > > Disconnecting from robot > > > > > > Would you please have a look in my previous mail and give your > comments? > > > > > > Best regards > > > hossain > > > > > > > > > > ------------------------------------------------------------------------ > > > *From:* "Hossain, Md.Z" > > >> > > > *To:* "Help, discussion and announcements for MobileRobots' Advanced > > > Robot Interface for Applications (ARIA) " > > > > > >> > > > *Sent:* Sat, July 10, 2010 12:36:23 AM > > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > Hi Reed > > > > > > Thank you very much for your reply. > > > > > > Yes always getting same response. but when i use serverDemo from > > > ArNetworking then it's working perfectly. > > > > > > Another problem....i was trying to save a laser txt file and image > with > > > single stock by this client program. and I used serverDemo as my > server > > > program. I am getting image properly but in laser txt file no > > > data.......please please help.... > > > > > > > > > Code:(client program) > > > > > > #include "Aria.h" > > > #include "ArNetworking.h" > > > #include "cv.h" > > > #include "highgui.h" > > > #include > > > #include > > > using namespace std; > > > IplImage *img=0; > > > int no=1; > > > > > > ArClientBase client; > > > ArSick sick; > > > > > > > > > class InputHandler > > > { > > > public: > > > /** > > > * @param client Our client networking object > > > * @param keyHandler Key handler to register command callbacks with > > > */ > > > InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); > > > virtual ~InputHandler(void); > > > > > > /// Up arrow key handler: drive the robot forward > > > void up(void); > > > > > > /// Down arrow key handler: drive the robot backward > > > void down(void); > > > > > > /// Left arrow key handler: turn the robot left > > > void left(void); > > > > > > /// Right arrow key handler: turn the robot right > > > void right(void); > > > > > > /// Send drive request to the server with stored values > > > void sendInput(void); > > > > > > /// Send a request to enable "safe drive" mode on the server > > > void imageCapture(); > > > > > > protected: > > > ArClientBase *myClient; > > > ArKeyHandler *myKeyHandler; > > > > > > /// Set this to true in the constructor to print out debugging > > information > > > bool myPrinting; > > > > > > /// Current translation value (a percentage of the maximum speed) > > > double myTransRatio; > > > > > > /// Current rotation ration value (a percentage of the maximum > > > rotational velocity) > > > double myRotRatio; > > > > > > > > > /** Functor objects, given to the key handler, which then call our > > handler > > > * methods above */ > > > ///@{ > > > ArFunctorC myUpCB; > > > ArFunctorC myDownCB; > > > ArFunctorC myLeftCB; > > > ArFunctorC myRightCB; > > > ArFunctorC myImageCaptureCB; > > > > > > }; > > > > > > InputHandler::InputHandler(ArClientBase *client, ArKeyHandler > > > *keyHandler) : > > > myClient(client), myKeyHandler(keyHandler), > > > myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), > > > > > > /* Initialize functor objects with pointers to our handler > methods: */ > > > myUpCB(this, &InputHandler::up), > > > myDownCB(this, &InputHandler::down), > > > myLeftCB(this, &InputHandler::left), > > > myRightCB(this, &InputHandler::right), > > > myImageCaptureCB(this, &InputHandler::imageCapture) > > > { > > > > > > /* Add our functor objects to the key handler, associated with the > > > appropriate > > > * keys: */ > > > myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); > > > myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); > > > myKeyHandler->addKeyHandler('c', &myImageCaptureCB); > > > } > > > > > > InputHandler::~InputHandler(void) > > > { > > > > > > } > > > > > > void InputHandler::up(void) > > > { > > > if (myPrinting) > > > printf("Forwards\n"); > > > myTransRatio = 100; > > > } > > > > > > void InputHandler::down(void) > > > { > > > if (myPrinting) > > > printf("Backwards\n"); > > > myTransRatio = -100; > > > } > > > > > > void InputHandler::left(void) > > > { > > > if (myPrinting) > > > printf("Left\n"); > > > myRotRatio = 100; > > > } > > > > > > void InputHandler::right(void) > > > { > > > if (myPrinting) > > > printf("Right\n"); > > > myRotRatio = -100; > > > } > > > > > > void InputHandler::imageCapture() > > > { > > > /* Construct a request packet. The data is a single byte, with value > > > * 1 to enable safe drive, 0 to disable. */ > > > ArNetPacket p; > > > p.uByteToBuf(90); > > > client.requestOnce("sendVideo", &p); > > > } > > > > > > > > > void InputHandler::sendInput(void) > > > { > > > /* This method is called by the main function to send a ratioDrive > > > * request with our current velocity values. If the server does > > > * not support the ratioDrive request, then we abort now: */ > > > if(!myClient->dataExists("ratioDrive")) return; > > > /// Send a request to enable "safe drive" mode on the server > > > void safeDrive(); > > > /* Construct a ratioDrive request packet. It consists > > > * of three doubles: translation ratio, rotation ratio, and an > overall > > > scaling > > > * factor. */ > > > ArNetPacket packet; > > > packet.doubleToBuf(myTransRatio); > > > packet.doubleToBuf(myRotRatio); > > > packet.doubleToBuf(50); // use half of the robot's maximum. > > > //packet.doubleToBuf(myLatRatio); > > > if (myPrinting) > > > printf("Sending\n"); > > > myClient->requestOnce("ratioDrive", &packet); > > > myTransRatio = 0; > > > myRotRatio = 0; > > > //myLatRatio = 0; > > > } > > > > > > > > > > > > /* Key handler for the escape key: shutdown all of Aria. */ > > > void escape(void) > > > { > > > printf("esc pressed, shutting down aria\n"); > > > Aria::shutdown(); > > > } > > > > > > /*Key Handler for the capture key: capture a picture. */ > > > void jpegHandler(ArNetPacket *packet) > > > { > > > //To write a Laser data file > > > std::vector< ArSensorReading >* readings; > > > std::vector< ArSensorReading >::iterator it; > > > > > > FILE* dataFile; > > > dataFile = fopen("laser_log.txt", "w"); > > > > > > sick.lockDevice(); > > > > > > readings = sick.getRawReadingsAsVector(); > > > > > > for (it = readings->begin(); it != readings->end(); it++) > > > { > > > fprintf( dataFile, "%f %f\n", (*it).getLocalX(), > (*it).getLocalY() ); > > > } > > > sick.unlockDevice(); > > > > > > ArUtil::sleep(100); > > > > > > fclose( dataFile );//closed laser datafile > > > > > > //To store a Image > > > unsigned int width; > > > unsigned int height; > > > static unsigned char jpeg[50000]; > > > int jpegSize; > > > FILE *file; > > > > > > width = packet->bufToUByte2(); > > > height = packet->bufToUByte2(); > > > jpegSize = packet->getDataLength() - packet->getDataReadLength(); > > > if(jpegSize > 50000) > > > { > > > ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image > > > is %d bytes, my buffer is 50000 bytes)", jpegSize); > > > return; > > > } > > > packet->bufToData((char *)jpeg, jpegSize); > > > const char base[]="image", ext[]=".jpg"; > > > char filename[FILENAME_MAX]; > > > //char tmpFilename[128]; > > > sprintf(filename,"%s%d%s", base, no, ext); > > > > > > > > > if ((file = ArUtil::fopen(filename, "wb")) != NULL) > > > { > > > fwrite(jpeg, jpegSize, 1, file); > > > fclose(file); > > > > > > #ifdef WIN32 > > > // On windows, rename() fails if the new file already exists > > > unlink(filename); > > > #endif > > > > > > } > > > else > > > ArLog::log(ArLog::Normal, "Could not write temp file "); > > > > > > char ifile[FILENAME_MAX]; > > > sprintf(ifile, "%s%d%s", base, no, ext); > > > img = cvLoadImage(ifile); > > > > > > > > > cvNamedWindow("image",CV_WINDOW_AUTOSIZE); > > > cvShowImage( "image", img ); > > > //cvReleaseImage(&img); > > > //cvDestroyWindow("image"); > > > cvWaitKey(10); > > > no++; > > > } > > > > > > int main(int argc, char **argv) > > > { > > > /* Aria initialization: */ > > > Aria::init(); > > > /* Aria components use this to get options off the command line: */ > > > ArClientSimpleConnector clientConnector(&parser); > > > > > > parser.loadDefaultArguments(); > > > > > > /* Check for -help, and unhandled arguments: */ > > > if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) > > > { > > > Aria::logOptions(); > > > exit(0); > > > } > > > > > > /* Connect our client object to the remote server: */ > > > if (!clientConnector.connectClient(&client)) > > > { > > > if (client.wasRejected()) > > > printf("Server '%s' rejected connection, exiting\n", > > > client.getHost()); > > > else > > > printf("Could not connect to server '%s', exiting\n", > > > client.getHost()); > > > exit(1); > > > } > > > > > > printf("Connected to server.\n"); > > > > > > client.setRobotName(client.getHost()); // include server name in log > > > messages > > > > > > /* Create a key handler and also tell Aria about it */ > > > ArKeyHandler keyHandler; > > > Aria::setKeyHandler(&keyHandler); > > > > > > /* Global escape-key handler to shut everythnig down */ > > > ArGlobalFunctor escapeCB(&escape); > > > keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); > > > > > > ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); > > > client.addHandler("sendVideo", &jpegHandlerCB); > > > client.runAsync(); > > > > > > /* Create the InputHandler object and request safe-drive mode */ > > > InputHandler inputHandler(&client, &keyHandler); > > > //inputHandler.safeDrive(); > > > > > > /* Use ArClientBase::dataExists() to see if the "ratioDrive" request > > > is available on the > > > * currently connected server. */ > > > if(!client.dataExists("ratioDrive") ) > > > printf("Warning: server does not have ratioDrive command, can not > > > use drive commands!\n"); > > > else > > > printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn > > > Left\nRIGHT: Turn Right\n"); > > > printf("c: Image capture\n\nesc: shut down\n"); > > > > > > while (client.getRunningWithLock()) > > > { > > > keyHandler.checkKeys(); > > > inputHandler.sendInput(); > > > ArUtil::sleep(100); > > > } > > > > > > /* The client stopped running, due to disconnection from the server, > > > general > > > * Aria shutdown, or some other reason. */ > > > client.disconnect(); > > > Aria::shutdown(); > > > return 0; > > > } > > > > > > > ------------------------------------------------------------------------ > > > *From:* Reed Hedges > > >> > > > *To:* aria-users at lists.mobilerobots.com > > > > > > > *Sent:* Fri, July 9, 2010 1:33:38 AM > > > *Subject:* Re: [Aria-users] problem with arnlServer > > > > > > > > > Does this always happen, or only sometimes? When it happens, > check the > > > indicator lights on the top of the SICK laser, and note the > sequence of > > > lights and messages printed by arnlServer. Is the laser off (no > > > indicator lights) before you start arnlServer? > > > > > > Reed > > > > > > > > > > > > On 07/06/2010 03:43 AM, Hossain, Md.Z wrote: > > > > Hi all, > > > > > > > > please help to find out solutions for two problems mentioned below. > > > > > > > > > > > > 1. laser isn't getting power when i'm running arnlServer > program from > > > > onboard computer... > > > > (but laser works with wander program) > > > > [robot at p3at examples]$ ./arnlServer > > > > Could not connect to simulator, connecting to robot through serial > > port > > > > /dev/ttyS0. > > > > Syncing 0 > > > > Syncing 1 > > > > Syncing 2 > > > > Connected to robot. > > > > Name: Auckland_3502 > > > > Type: Pioneer > > > > Subtype: p3at-sh > > > > Loaded robot parameters from p3at-sh.p > > > > ArLaserConnector: Using robot params for connecting to laser > > > > > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > lms2xx_1: waiting for laser to power on. > > > > lms2xx_1: Failed to connect to laser, no poweron received. > > > > ArLaserConnector::connectLasers: Could not connect lms2xx_1, > stopping > > > > Could not connect to all lasers... exiting > > > > > > > > Disconnecting from robot > > > > > > > > 2. How can i save laser reading and images at the same time. > > > > > > > > Any response from you will be appreciated. > > > > > > > > Best regards > > > > Hossain > > > > > > > > > > > > > > > > _______________________________________________ > > > > Aria-users mailing list > > > > Aria-users at lists.mobilerobots.com > > > > > > > > > >> >> > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > >> > > > > >> > > Visit http://robots.mobilerobots.com for information including > > > documentation, FAQ, tips, manuals, and software, firmware and driver > > > downloads. > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > > > > > >> > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > >> > > > > > > Visit http://robots.mobilerobots.com for information including > > > documentation, FAQ, tips, manuals, and software, firmware and driver > > > downloads. > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, >FAQ, tips, manuals, and software, firmware and driver downloads. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100712/09242012/attachment-0001.html From toshy.maeda at gmail.com Tue Jul 13 09:26:20 2010 From: toshy.maeda at gmail.com (Bruno Maeda) Date: Tue, 13 Jul 2010 10:26:20 -0300 Subject: [Aria-users] Robot is losting itself Message-ID: Hi there, I'm having some problems with my simulations, and would like some help. The thing is: My robot, on MobileSim, start at some local point, move around (following a policy control) and, when it reaches a goal, restart all over again.... and it does that for about 100 times. The problem is that at some point (usually not at the first "tryout") the robot start to get lost... and I don't know why is that happening... Do anyone have a clue? I'm guessing the problem is that when the robot get stalled, it "drives back" a little so it can continue... but I couldn't figure out yet. thanks. -- ???? :: toshy maeda :: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100713/d4441f50/attachment.html From reed at mobilerobots.com Tue Jul 13 12:19:07 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Tue, 13 Jul 2010 12:19:07 -0400 Subject: [Aria-users] Robot is losting itself In-Reply-To: References: Message-ID: <4C3C91FB.4050906@mobilerobots.com> Hi Toshy, What do you mean by getting lost? Are you using ARNL or SONARNL for localization, and it's entering its lost state? Or something else? Thanks Reed On 07/13/2010 09:26 AM, Bruno Maeda wrote: > Hi there, > > I'm having some problems with my simulations, and would like some help. > The thing is: My robot, on MobileSim, start at some local point, move > around (following a policy control) and, when it reaches a goal, restart > all over again.... and it does that for about 100 times. > The problem is that at some point (usually not at the first "tryout") > the robot start to get lost... and I don't know why is that happening... > Do anyone have a clue? I'm guessing the problem is that when the robot > get stalled, it "drives back" a little so it can continue... but I > couldn't figure out yet. > > thanks. > > -- > ???? :: toshy maeda :: > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From toshy.maeda at gmail.com Tue Jul 13 12:21:08 2010 From: toshy.maeda at gmail.com (Bruno Maeda) Date: Tue, 13 Jul 2010 13:21:08 -0300 Subject: [Aria-users] Robot is losting itself In-Reply-To: <4C3C91FB.4050906@mobilerobots.com> References: <4C3C91FB.4050906@mobilerobots.com> Message-ID: hi reed, yes, i'm using SonARNL for localization, and it seems do be working fine, but after a while the robot start getting some "localization failure"... tohy maeda On Tue, Jul 13, 2010 at 1:19 PM, Reed Hedges wrote: > > Hi Toshy, > > What do you mean by getting lost? Are you using ARNL or SONARNL for > localization, and it's entering its lost state? Or something else? > > Thanks > > Reed > > > On 07/13/2010 09:26 AM, Bruno Maeda wrote: > > Hi there, > > > > I'm having some problems with my simulations, and would like some help. > > The thing is: My robot, on MobileSim, start at some local point, move > > around (following a policy control) and, when it reaches a goal, restart > > all over again.... and it does that for about 100 times. > > The problem is that at some point (usually not at the first "tryout") > > the robot start to get lost... and I don't know why is that happening... > > Do anyone have a clue? I'm guessing the problem is that when the robot > > get stalled, it "drives back" a little so it can continue... but I > > couldn't figure out yet. > > > > thanks. > > > > -- > > ???? :: toshy maeda :: > > > > > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > -- ???? :: toshy maeda :: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100713/e09c95bd/attachment.html From reed at mobilerobots.com Tue Jul 13 14:16:35 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Tue, 13 Jul 2010 14:16:35 -0400 Subject: [Aria-users] problem with arnlServer In-Reply-To: <357018.2560.qm@web46414.mail.sp1.yahoo.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> <4C373F46.4030307@mobilerobots.com> <819886.98212.qm@web46405.mail.sp1.yahoo.com> <4C37495A.4080005@mobilerobots.com> <142326.1966.qm@web46416.mail.sp1.yahoo.com> <4C375DE5.4060506@mobilerobots.com> <357018.2560.qm@web46414.mail.sp1.yahoo.com> Message-ID: <4C3CAD83.9000605@mobilerobots.com> One possability is that getRawReadingsAsVector() is not returning any laser readings. Try counting and printing out the number of readings in that vector. If it is indeed 0, then we can try to figure out why that is. (Side note, getRawReadings() will be a bit faster than getRawReadingsAsVector(), since getRawReadingsAsVector has to create and copy a new vector object. But this is not important unless you are calling it very frequently.) On 07/10/2010 12:09 AM, Hossain, Md.Z wrote: > thanks again..it's okay. > Yes, when i call jpegHandler, two files are being created where > image.jpg file perfect but laser_log.txt file empty. I don't know what > to do now. if possible please help. it's very urgent for me. > > best regards > hossain > > From zhossain.kuet at yahoo.com Wed Jul 14 00:14:58 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Tue, 13 Jul 2010 21:14:58 -0700 (PDT) Subject: [Aria-users] problem with arnlServer In-Reply-To: <4C3CAD83.9000605@mobilerobots.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> <4C373F46.4030307@mobilerobots.com> <819886.98212.qm@web46405.mail.sp1.yahoo.com> <4C37495A.4080005@mobilerobots.com> <142326.1966.qm@web46416.mail.sp1.yahoo.com> <4C375DE5.4060506@mobilerobots.com> <357018.2560.qm@web46414.mail.sp1.yahoo.com> <4C3CAD83.9000605@mobilerobots.com> Message-ID: <803186.80682.qm@web46401.mail.sp1.yahoo.com> Hi thank you again. Now i used getRawReadings() and for sick.getRawReadings()->size() i'm getting 0. please have a look on my main program, may be i did some mistake over there, may be i couldn't connect sick laser properly from client side. I really can't say how urgent this is to me. I am eagerly waiting for your solution. client program: #include "Aria.h" #include "ArNetworking.h" #include "cv.h" #include "highgui.h" #include #include using namespace std; IplImage *img=0; int no=1; ArClientBase client; ArSick sick; class InputHandler { public: /** * @param client Our client networking object * @param keyHandler Key handler to register command callbacks with */ InputHandler(ArClientBase *client, ArKeyHandler *keyHandler); virtual ~InputHandler(void); /// Up arrow key handler: drive the robot forward void up(void); /// Down arrow key handler: drive the robot backward void down(void); /// Left arrow key handler: turn the robot left void left(void); /// Right arrow key handler: turn the robot right void right(void); /// Send drive request to the server with stored values void sendInput(void); /// Send a request to enable "safe drive" mode on the server void imageCapture(); protected: ArClientBase *myClient; ArKeyHandler *myKeyHandler; /// Set this to true in the constructor to print out debugging information bool myPrinting; /// Current translation value (a percentage of the maximum speed) double myTransRatio; /// Current rotation ration value (a percentage of the maximum rotational velocity) double myRotRatio; /** Functor objects, given to the key handler, which then call our handler * methods above */ ///@{ ArFunctorC myUpCB; ArFunctorC myDownCB; ArFunctorC myLeftCB; ArFunctorC myRightCB; ArFunctorC myImageCaptureCB; }; InputHandler::InputHandler(ArClientBase *client, ArKeyHandler *keyHandler) : myClient(client), myKeyHandler(keyHandler), myPrinting(false), myTransRatio(0.0), myRotRatio(0.0), /* Initialize functor objects with pointers to our handler methods: */ myUpCB(this, &InputHandler::up), myDownCB(this, &InputHandler::down), myLeftCB(this, &InputHandler::left), myRightCB(this, &InputHandler::right), myImageCaptureCB(this, &InputHandler::imageCapture) { /* Add our functor objects to the key handler, associated with the appropriate * keys: */ myKeyHandler->addKeyHandler(ArKeyHandler::UP, &myUpCB); myKeyHandler->addKeyHandler(ArKeyHandler::DOWN, &myDownCB); myKeyHandler->addKeyHandler(ArKeyHandler::LEFT, &myLeftCB); myKeyHandler->addKeyHandler(ArKeyHandler::RIGHT, &myRightCB); myKeyHandler->addKeyHandler('c', &myImageCaptureCB); } InputHandler::~InputHandler(void) { } void InputHandler::up(void) { if (myPrinting) printf("Forwards\n"); myTransRatio = 100; } void InputHandler::down(void) { if (myPrinting) printf("Backwards\n"); myTransRatio = -100; } void InputHandler::left(void) { if (myPrinting) printf("Left\n"); myRotRatio = 100; } void InputHandler::right(void) { if (myPrinting) printf("Right\n"); myRotRatio = -100; } void InputHandler::imageCapture() { /* Construct a request packet. The data is a single byte, with value * 1 to enable safe drive, 0 to disable. */ ArNetPacket p; p.uByteToBuf(90); client.requestOnce("sendVideo", &p); } void InputHandler::sendInput(void) { if(!myClient->dataExists("ratioDrive")) return; /// Send a request to enable "safe drive" mode on the server void safeDrive(); /* Construct a ratioDrive request packet. It consists * of three doubles: translation ratio, rotation ratio, and an overall scaling * factor. */ ArNetPacket packet; packet.doubleToBuf(myTransRatio); packet.doubleToBuf(myRotRatio); packet.doubleToBuf(50); // use half of the robot's maximum. //packet.doubleToBuf(myLatRatio); if (myPrinting) printf("Sending\n"); myClient->requestOnce("ratioDrive", &packet); myTransRatio = 0; myRotRatio = 0; //myLatRatio = 0; } /* Key handler for the escape key: shutdown all of Aria. */ void escape(void) { printf("esc pressed, shutting down aria\n"); Aria::shutdown(); } /*Key Handler for the capture key: capture a picture. */ void jpegHandler(ArNetPacket *packet) { sick.lockDevice(); printf("laser data size: %d ",sick.getRawReadings()->size()); sick.unlockDevice(); ArUtil::sleep(100); unsigned int width; unsigned int height; static unsigned char jpeg[50000]; int jpegSize; FILE *file; width = packet->bufToUByte2(); height = packet->bufToUByte2(); jpegSize = packet->getDataLength() - packet->getDataReadLength(); if(jpegSize > 50000) { ArLog::log(ArLog::Normal, "Cannot save image, it's too big. (image is %d bytes, my buffer is 50000 bytes)", jpegSize); return; } packet->bufToData((char *)jpeg, jpegSize); const char base[]="image", ext[]=".jpg"; char filename[FILENAME_MAX]; //char tmpFilename[128]; sprintf(filename,"%s%d%s", base, no, ext); if ((file = ArUtil::fopen(filename, "wb")) != NULL) { fwrite(jpeg, jpegSize, 1, file); fclose(file); #ifdef WIN32 // On windows, rename() fails if the new file already exists unlink(filename); #endif } else ArLog::log(ArLog::Normal, "Could not write temp file "); char ifile[FILENAME_MAX]; sprintf(ifile, "%s%d%s", base, no, ext); img = cvLoadImage(ifile); cvNamedWindow("image",CV_WINDOW_AUTOSIZE); cvShowImage( "image", img ); //cvReleaseImage(&img); //cvDestroyWindow("image"); cvWaitKey(10); no++; } int main(int argc, char **argv) { /* Aria initialization: */ Aria::init(); /* Aria components use this to get options off the command line: */ ArArgumentParser parser(&argc, argv); ArClientSimpleConnector clientConnector(&parser); parser.loadDefaultArguments(); /* Check for -help, and unhandled arguments: */ if (!Aria::parseArgs() || !parser.checkHelpAndWarnUnparsed()) { Aria::logOptions(); exit(0); } /* Connect our client object to the remote server: */ if (!clientConnector.connectClient(&client)) { if (client.wasRejected()) printf("Server '%s' rejected connection, exiting\n", client.getHost()); else printf("Could not connect to server '%s', exiting\n", client.getHost()); exit(1); } printf("Connected to server.\n"); client.setRobotName(client.getHost()); // include server name in log messages /* Create a key handler and also tell Aria about it */ ArKeyHandler keyHandler; Aria::setKeyHandler(&keyHandler); /* Global escape-key handler to shut everythnig down */ ArGlobalFunctor escapeCB(&escape); keyHandler.addKeyHandler(ArKeyHandler::ESCAPE, &escapeCB); ArGlobalFunctor1 jpegHandlerCB(&jpegHandler); client.addHandler("sendVideo", &jpegHandlerCB); client.runAsync(); /* Create the InputHandler object and request safe-drive mode */ InputHandler inputHandler(&client, &keyHandler); //inputHandler.safeDrive(); /* Use ArClientBase::dataExists() to see if the "ratioDrive" request is available on the * currently connected server. */ if(!client.dataExists("ratioDrive") ) printf("Warning: server does not have ratioDrive command, can not use drive commands!\n"); else printf("\nKeys are:\nUP: Forward\nDOWN: Backward\nLEFT: Turn Left\nRIGHT: Turn Right\n"); printf("c: Image capture\n\nesc: shut down\n"); while (client.getRunningWithLock()) { keyHandler.checkKeys(); inputHandler.sendInput(); ArUtil::sleep(100); } /* The client stopped running, due to disconnection from the server, general * Aria shutdown, or some other reason. */ client.disconnect(); Aria::shutdown(); return 0; } ________________________________ From: Reed Hedges To: aria-users at lists.mobilerobots.com Sent: Wed, July 14, 2010 6:16:35 AM Subject: Re: [Aria-users] problem with arnlServer One possability is that getRawReadingsAsVector() is not returning any laser readings. Try counting and printing out the number of readings in that vector. If it is indeed 0, then we can try to figure out why that is. (Side note, getRawReadings() will be a bit faster than getRawReadingsAsVector(), since getRawReadingsAsVector has to create and copy a new vector object. But this is not important unless you are calling it very frequently.) On 07/10/2010 12:09 AM, Hossain, Md.Z wrote: > thanks again..it's okay. > Yes, when i call jpegHandler, two files are being created where > image.jpg file perfect but laser_log.txt file empty. I don't know what > to do now. if possible please help. it's very urgent for me. > > best regards > hossain > > _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100713/361d283b/attachment-0001.html From zhossain.kuet at yahoo.com Wed Jul 14 04:46:33 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Wed, 14 Jul 2010 01:46:33 -0700 (PDT) Subject: [Aria-users] connection of robot controller In-Reply-To: <803186.80682.qm@web46401.mail.sp1.yahoo.com> References: <873863.26468.qm@web46411.mail.sp1.yahoo.com> <4C35D3B2.6040601@mobilerobots.com> <592914.94158.qm@web46413.mail.sp1.yahoo.com> <256977.12011.qm@web46414.mail.sp1.yahoo.com> <4C373F46.4030307@mobilerobots.com> <819886.98212.qm@web46405.mail.sp1.yahoo.com> <4C37495A.4080005@mobilerobots.com> <142326.1966.qm@web46416.mail.sp1.yahoo.com> <4C375DE5.4060506@mobilerobots.com> <357018.2560.qm@web46414.mail.sp1.yahoo.com> <4C3CAD83.9000605@mobilerobots.com> <803186.80682.qm@web46401.mail.sp1.yahoo.com> Message-ID: <900209.54938.qm@web46408.mail.sp1.yahoo.com> Hi, I need some information. which port robot controller(P3AT), Sick(lsm200), canon camera vcc50i are connected to? can i get these information from onboard computer? Will I have to check physically? best regards hossain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100714/f49f7609/attachment.html From evbacca at univalle.edu.co Wed Jul 14 05:17:44 2010 From: evbacca at univalle.edu.co (evbacca at univalle.edu.co) Date: Wed, 14 Jul 2010 04:17:44 -0500 (COT) Subject: [Aria-users] URG laser readings Message-ID: <62097.192.168.20.33.1279099064.squirrel@swebse47.univalle.edu.co> Hi everybody, I'm trying to write a program to extract the URG laser readings, but I don't know how to do it. For the SICK laser is easy, but for the URG just I don't know. Please, someone could help me with this? i.e. if I'm using the ArLaserConnector how can I get the laser readings?. thanks in advance for your time. From reed at mobilerobots.com Wed Jul 14 10:21:36 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Wed, 14 Jul 2010 10:21:36 -0400 Subject: [Aria-users] URG laser readings In-Reply-To: <62097.192.168.20.33.1279099064.squirrel@swebse47.univalle.edu.co> References: <62097.192.168.20.33.1279099064.squirrel@swebse47.univalle.edu.co> Message-ID: <4C3DC7F0.4030807@mobilerobots.com> If you are using ARIA, then the readings are available in mostly the same way as with the SICK, via methods from the ArLaser class (via ArRangeDevice parent class) such as getCurrentBuffer(). ArUrg does not provide "raw" readings however, I don't think. To get ArLaser objects that ArLaserConnector created, use the new findLaser() or getLaserMap() methods of ArRobot. E.g. findLaser(0) or findLaser(1). (These may return NULL if there is no such laser). evbacca at univalle.edu.co wrote: > Hi everybody, > > I'm trying to write a program to extract the URG laser readings, but I > don't know how to do it. For the SICK laser is easy, but for the URG just > I don't know. > > Please, someone could help me with this? i.e. if I'm using the > ArLaserConnector how can I get the laser readings?. > > thanks in advance for your time. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From shai.kaplan at gmail.com Wed Jul 14 12:16:47 2010 From: shai.kaplan at gmail.com (Shai Kaplan) Date: Wed, 14 Jul 2010 19:16:47 +0300 Subject: [Aria-users] Aria python on windows Message-ID: Hello, I am using the Aria python on windows with python 2.6. Compilation worked succesfuly and I can run ARIA python scripts that control the robot. I am experiencing a wierd error. Every function of the the ArRobot instance in python that is expected to return a double type (python float) return non relevant very small or large numbers or exceptions for example: robot.getVel() return -2.41785360162e-159 robot.getX() return 3.20869118999e-289 I get exception on robot.getRobotRadius() and some other functions of robot properties I think it might be related to type conversion in the python wrapper. Any idea what might be the case and how to solve this? Thanks Shai -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100714/3c63af15/attachment.html From evbacca at univalle.edu.co Wed Jul 14 12:25:12 2010 From: evbacca at univalle.edu.co (evbacca at univalle.edu.co) Date: Wed, 14 Jul 2010 11:25:12 -0500 (COT) Subject: [Aria-users] URG laser readings Message-ID: <52458.192.168.20.33.1279124712.squirrel@swebse47.univalle.edu.co> Hi, Thanks for your answer. Now I have another problem, sadly our old URG compatible with SCIP 1.1 has just damaged. We have another new URG-04LX with firmware 3.3 and SCIP 2. I updated the firmware in order to reset the communication protocol to 1.1 (as the manufaturer said). But, I can not to connect to the URG: urg_1: '3 ' urg_1::blockingConnect: Did not get back version response (even after switching to autobaudchoice) If I use the URG application shared by the manufacturer I can check that the SCIP protocol is 1.0, but it does not work. Any suggestions please? Thanks in advance for your time. > > > If you are using ARIA, then the readings are available in mostly the same > way as > with the SICK, via methods from the ArLaser class (via ArRangeDevice > parent > class) such as getCurrentBuffer(). ArUrg does not provide "raw" readings > however, I don't think. > > To get ArLaser objects that ArLaserConnector created, use the new > findLaser() or > getLaserMap() methods of ArRobot. E.g. findLaser(0) or findLaser(1). > (These may > return NULL if there is no such laser). > > > > > evbacca at univalle.edu.co wrote: >> Hi everybody, >> >> I'm trying to write a program to extract the URG laser readings, but I >> don't know how to do it. For the SICK laser is easy, but for the URG >> just >> I don't know. >> >> Please, someone could help me with this? i.e. if I'm using the >> ArLaserConnector how can I get the laser readings?. >> >> thanks in advance for your time. >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> Visit http://robots.mobilerobots.com for information including >> documentation, FAQ, tips, manuals, and software, firmware and driver >> downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > From zhossain.kuet at yahoo.com Thu Jul 15 04:45:50 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Thu, 15 Jul 2010 01:45:50 -0700 (PDT) Subject: [Aria-users] Sick laser readings In-Reply-To: <4C3DC7F0.4030807@mobilerobots.com> References: <62097.192.168.20.33.1279099064.squirrel@swebse47.univalle.edu.co> <4C3DC7F0.4030807@mobilerobots.com> Message-ID: <446649.18142.qm@web46415.mail.sp1.yahoo.com> Hi all, I am trying to save laser reading using ArNetworking client program but failed. I can store if i run program from onboard pc. but i've to use ArNetworking client. Any guideline? Please help. I'm very worried, getting no way from here. thanks in advance hossain ________________________________ From: Reed Hedges To: "Help, discussion and announcements for MobileRobots' Advanced Robot Interface for Applications (ARIA) " Sent: Thu, July 15, 2010 2:21:36 AM Subject: Re: [Aria-users] URG laser readings If you are using ARIA, then the readings are available in mostly the same way as with the SICK, via methods from the ArLaser class (via ArRangeDevice parent class) such as getCurrentBuffer(). ArUrg does not provide "raw" readings however, I don't think. To get ArLaser objects that ArLaserConnector created, use the new findLaser() or getLaserMap() methods of ArRobot. E.g. findLaser(0) or findLaser(1). (These may return NULL if there is no such laser). evbacca at univalle.edu.co wrote: > Hi everybody, > > I'm trying to write a program to extract the URG laser readings, but I > don't know how to do it. For the SICK laser is easy, but for the URG just > I don't know. > > Please, someone could help me with this? i.e. if I'm using the > ArLaserConnector how can I get the laser readings?. > > thanks in advance for your time. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, >FAQ, tips, manuals, and software, firmware and driver downloads. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100715/656fe000/attachment.html From saleh1.ahmad at ryerson.ca Thu Jul 15 15:13:31 2010 From: saleh1.ahmad at ryerson.ca (Saleh) Date: Thu, 15 Jul 2010 15:13:31 -0400 Subject: [Aria-users] Following a predefined path Message-ID: <4C3F5DDB.40908@ryerson.ca> Hello, I have PowerBot robot that I would like to program using Aria to follow a predefined path constructed as a set of (x,y,th)'s. This information is calculated offline using a custom path planner program and can be given to the robot as a file or a matrix. My problem is that I don't know how to start and what commands that I should use. Any help or example code will be appreciated Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100715/4ccb17e8/attachment-0001.html From James.Neilan at tema.toyota.com Thu Jul 15 16:34:57 2010 From: James.Neilan at tema.toyota.com (James.Neilan at tema.toyota.com) Date: Thu, 15 Jul 2010 16:34:57 -0400 Subject: [Aria-users] James Neilan is out of the office. Message-ID: I will be out of the office starting 07/15/2010 and will not return until 07/27/2010. I will have access to email, however my responses will be in the evening. From evbacca at univalle.edu.co Fri Jul 16 04:29:37 2010 From: evbacca at univalle.edu.co (evbacca at univalle.edu.co) Date: Fri, 16 Jul 2010 03:29:37 -0500 (COT) Subject: [Aria-users] URG laser readings Message-ID: <53396.192.168.20.33.1279268977.squirrel@swebse47.univalle.edu.co> Hi, Thanks for your answer, I was wandering about two things: 1. If I would get the raw laser readings using a different interface of Aria, how can I adjust these readings in order to keep in mind the robot movement like Aria does? ArLaserFilter could be useful? 2. I don't know if the Mobile Robots Team is working in that, but Hokuyo provides a programming interface which can be downloaded in http://www.hokuyo-aut.jp/02sensor/07scanner/download/urg_programs_en/. I think it could be useful to really support Hokuyo devices in the MobileRobots platforms. thanks in advance for any advice about point 1. My best, > > > If you are using ARIA, then the readings are available in mostly the same > way as > with the SICK, via methods from the ArLaser class (via ArRangeDevice > parent > class) such as getCurrentBuffer(). ArUrg does not provide "raw" readings > however, I don't think. > > To get ArLaser objects that ArLaserConnector created, use the new > findLaser() or > getLaserMap() methods of ArRobot. E.g. findLaser(0) or findLaser(1). > (These may > return NULL if there is no such laser). > > > > > evbacca at univalle.edu.co wrote: >> Hi everybody, >> >> I'm trying to write a program to extract the URG laser readings, but I >> don't know how to do it. For the SICK laser is easy, but for the URG >> just >> I don't know. >> >> Please, someone could help me with this? i.e. if I'm using the >> ArLaserConnector how can I get the laser readings?. >> >> thanks in advance for your time. >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> Visit http://robots.mobilerobots.com for information including >> documentation, FAQ, tips, manuals, and software, firmware and driver >> downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > From reed at mobilerobots.com Sat Jul 17 10:24:56 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Sat, 17 Jul 2010 10:24:56 -0400 Subject: [Aria-users] URG laser readings In-Reply-To: <53396.192.168.20.33.1279268977.squirrel@swebse47.univalle.edu.co> References: <53396.192.168.20.33.1279268977.squirrel@swebse47.univalle.edu.co> Message-ID: <4C41BD38.50305@mobilerobots.com> On 07/16/2010 04:29 AM, evbacca at univalle.edu.co wrote: > Hi, > > Thanks for your answer, I was wandering about two things: > > 1. If I would get the raw laser readings using a different interface of > Aria, how can I adjust these readings in order to keep in mind the robot > movement like Aria does? ArLaserFilter could be useful? I'm not sure I understand what you mean? Can you be more specific, or give an example of what you would like to do? ArRangeDevice places the laser readings in the same absolute coordinate system that the robot odometry is in - readings are (X,Y) locations that remain fixed as the robot continues to move. > > 2. I don't know if the Mobile Robots Team is working in that, but Hokuyo > provides a programming interface which can be downloaded in > http://www.hokuyo-aut.jp/02sensor/07scanner/download/urg_programs_en/. I > think it could be useful to really support Hokuyo devices in the > MobileRobots platforms. Support for the URG is integrated into ARIA via the urg laser type for the laser connector and the ArUrg class, which implements the ArRangeDevice and ArLaser interfaces for the URG. It is probably possible to use Hokuyo's API at the same time as ARIA, as long as ARIA is not connecting to the URG, however, so you could try that if you want. I have never tested that. Reed From reed at mobilerobots.com Sat Jul 17 10:30:16 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Sat, 17 Jul 2010 10:30:16 -0400 Subject: [Aria-users] Following a predefined path In-Reply-To: <4C3F5DDB.40908@ryerson.ca> References: <4C3F5DDB.40908@ryerson.ca> Message-ID: <4C41BE78.4020403@mobilerobots.com> The ARIA reference manual (Aria-Reference.html) describes two levels of robot motion control, discreet direct motion commands and continuous ArActions. An ArAction may be a good way to do this. The action would determine how the robot should move in order to drive towards or along the path, and return to the action resolver the appropriate translational and rotational velocities to achieve that. It could be combined with other actions if you want (such as stopping if it is too close to obstacles, etc.) or you could even separate different aspects or components of the motion into different ArAction objects if you want. There is an example examples/gotoActionExample.cpp that drives the robot in a square, this shows how an action can follow a series of waypoints, but in a very simplified way. Let us know if you have any questions or if anything in the Aria reference manual is unclear. Reed On 07/15/2010 03:13 PM, Saleh wrote: > Hello, > I have PowerBot robot that I would like to program using Aria to follow > a predefined path constructed as a set of (x,y,th)'s. This information > is calculated offline using a custom path planner program and can be > given to the robot as a file or a matrix. > My problem is that I don't know how to start and what commands that I > should use. > Any help or example code will be appreciated > Thanks > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From reed at mobilerobots.com Sat Jul 17 10:37:45 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Sat, 17 Jul 2010 10:37:45 -0400 Subject: [Aria-users] Aria python on windows In-Reply-To: References: Message-ID: <4C41C039.6080701@mobilerobots.com> Hello, What did you compile? You should recompile Aria AriaPython and the AriaPy wrapper by running make clean make cleanPython make make python On 07/14/2010 12:16 PM, Shai Kaplan wrote: > Hello, > > I am using the Aria python on windows with python 2.6. > Compilation worked succesfuly and I can run ARIA python scripts that > control the robot. > > I am experiencing a wierd error. Every function of the the ArRobot > instance in python that is expected to return a double type (python > float) return > non relevant very small or large numbers or exceptions for example: > robot.getVel() return -2.41785360162e-159 > robot.getX() return 3.20869118999e-289 > > > I get exception on > robot.getRobotRadius() and some other functions of robot properties > > I think it might be related to type conversion in the python wrapper. > > Any idea what might be the case and how to solve this? > > Thanks > Shai > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From reed at mobilerobots.com Sat Jul 17 15:05:19 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Sat, 17 Jul 2010 15:05:19 -0400 Subject: [Aria-users] Robot is losting itself In-Reply-To: References: <4C3C91FB.4050906@mobilerobots.com> Message-ID: <4C41FEEF.7070102@mobilerobots.com> On 07/13/2010 12:21 PM, Bruno Maeda wrote: > hi reed, > > yes, i'm using SonARNL for localization, and it seems do be working > fine, but after a while the robot start getting some "localization > failure"... When you reset to do another trial, do you use the ArRobot::moveTo() method as well as moving the robot in the simulator? Watch the localization score. You can get this from ArSonarLocalizationTask or see it if you enable View->Details and View->Custom Details in MobileEyes. Is it gradually dropping or suddenly dropping? You can also use that to see if there is a particular location in your map where localization score drops. Compare it to the localization threshold set in the localization parameters. There are a few things you can do to help SONARNL localize better. First is you can modify the environment a bit. If it's just simulation, this is worth doing. SONARNL performs best when in a more tightly enclosed space with continuous walls or series of sensable objects within a meter or two of the robot on more than one side (e.g. a corridor where the sonar can see walls on both the left and right). Sections of clean straight lines are helpful, as well as occasional larger objects that can match in another axis than parallel walls and place the robot along any corridors of parallel walls. You can increase the number of samples used to test localization, and can increase the spread of their distribution around the robot. (NumSamples and MinNumSamples, StdX/Y/Z). You can also lower the threshold that determines whether the localization task is in the "Lost" state or not. Let us know if you have any questions about this, or want me to look at your map. > > tohy maeda > > On Tue, Jul 13, 2010 at 1:19 PM, Reed Hedges > wrote: > > > Hi Toshy, > > What do you mean by getting lost? Are you using ARNL or SONARNL for > localization, and it's entering its lost state? Or something else? > > Thanks > > Reed > > > On 07/13/2010 09:26 AM, Bruno Maeda wrote: > > Hi there, > > > > I'm having some problems with my simulations, and would like some > help. > > The thing is: My robot, on MobileSim, start at some local point, move > > around (following a policy control) and, when it reaches a goal, > restart > > all over again.... and it does that for about 100 times. > > The problem is that at some point (usually not at the first "tryout") > > the robot start to get lost... and I don't know why is that > happening... > > Do anyone have a clue? I'm guessing the problem is that when the > robot > > get stalled, it "drives back" a little so it can continue... but I > > couldn't figure out yet. > > > > thanks. > > > > -- > > ???? :: toshy maeda :: > > > > > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > > > -- > ???? :: toshy maeda :: > > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From shai.kaplan at gmail.com Sun Jul 18 03:10:19 2010 From: shai.kaplan at gmail.com (Shai Kaplan) Date: Sun, 18 Jul 2010 10:10:19 +0300 Subject: [Aria-users] Aria python on windows In-Reply-To: <4C41C039.6080701@mobilerobots.com> References: <4C41C039.6080701@mobilerobots.com> Message-ID: Hello Reed, I have recompiled the Aria on my windows with the microsoftt VS 2008 and it works well. I can modify the code and test that functions such as robot.MoveTo robot.getX and robot.getRobotRadius function correctly. I have then run the swig and got the AriaPy.cpp file and recompiled it with the microsoft VS 2008. Compilation works OK and all I have todo is to change the file name of AriaPy.dll into AriaPy.pyd as required by python 2.6. I can use the resulting python module to connect the robot and drive it using both Action and direct drive however there are several functionalities that do not function well. Specifically the following are very problematic as they are part of the most basic functions. MoveTo can be executed but has no influence on the robot.getPose() or robot getX() results which are either 0 or very wierd small numbers. the only position function that works is the getRawEncoderPose() the function getRobotRadius() causes an exception. I have looked into the code and found that the function refers to an internal ArRobotParams object which hold the radius and other parameters. when I get this object in python and quiry the radius or other double parameter I still get "garbage" non-relevant results. It seems to me that there is a major problem in the SWIG conversion to python in python 2.6. I suspect (but not sure) that it might relates to the ArConfigArg_double as the problem seems to be mostly with double arguments and I can see that the SWIG has a specific extension (wrapper_Extra_Classes.i) which relates to this parameters. I don't think that it is a major compilation or linking problem as this will lead to a much less functioning results. Only some of the robot parameters are problematic and other function well. for example there is no problem with: robot.getStateOfChargeLow() robot.setStateOfChargeLow(0.5) which refers to the same robot object in python and is setting a regular double property of the CPP object. I will be happy if you can help solve this problem as the rest of my code which include many other python modules requires that I use python 2.6 which is the current active version of python. Thanks for any help or advice. Shai On Sat, Jul 17, 2010 at 5:37 PM, Reed Hedges wrote: > > Hello, > > What did you compile? > > You should recompile > > Aria > AriaPython and the AriaPy wrapper > > by running > > make clean > make cleanPython > make > make python > > > On 07/14/2010 12:16 PM, Shai Kaplan wrote: > > Hello, > > > > I am using the Aria python on windows with python 2.6. > > Compilation worked succesfuly and I can run ARIA python scripts that > > control the robot. > > > > I am experiencing a wierd error. Every function of the the ArRobot > > instance in python that is expected to return a double type (python > > float) return > > non relevant very small or large numbers or exceptions for example: > > robot.getVel() return -2.41785360162e-159 > > robot.getX() return 3.20869118999e-289 > > > > > > I get exception on > > robot.getRobotRadius() and some other functions of robot properties > > > > I think it might be related to type conversion in the python wrapper. > > > > Any idea what might be the case and how to solve this? > > > > Thanks > > Shai > > > > > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100718/47ed2e4a/attachment-0001.html From toshy.maeda at gmail.com Mon Jul 19 09:00:54 2010 From: toshy.maeda at gmail.com (Bruno Maeda) Date: Mon, 19 Jul 2010 10:00:54 -0300 Subject: [Aria-users] Robot is losting itself In-Reply-To: <4C41FEEF.7070102@mobilerobots.com> References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> Message-ID: yes.... so that the robot sometimes do it everything alright... but most of time it fails on localizing itself... here is part of the reset method: // Set robot's internal variables robot->lock(); robot->moveTo(*initialPose); robot->unlock(); ArUtil::sleep(500); // Set initial localization locManager->lock(); locManager->setRobotPose(*initialPose); locManager->unlock(); ArUtil::sleep(500); about the localization score, i'm not sure, but i thing it's getting worst as the robot hits the walls... about the environment, i'm testing on a small map, closed room 6x6 meters, and the corridors are 2 meters width. i'm gonna try to increse the number of samples used to the localization tests and see what happens... thanks. toshy maeda 2010/7/17 Reed Hedges > On 07/13/2010 12:21 PM, Bruno Maeda wrote: > > hi reed, > > > > yes, i'm using SonARNL for localization, and it seems do be working > > fine, but after a while the robot start getting some "localization > > failure"... > > When you reset to do another trial, do you use the ArRobot::moveTo() > method as well as moving the robot in the simulator? > > Watch the localization score. You can get this from > ArSonarLocalizationTask or see it if you enable View->Details and > View->Custom Details in MobileEyes. Is it gradually dropping or > suddenly dropping? You can also use that to see if there is a > particular location in your map where localization score drops. Compare > it to the localization threshold set in the localization parameters. > > There are a few things you can do to help SONARNL localize better. First > is you can modify the environment a bit. If it's just simulation, this > is worth doing. SONARNL performs best when in a more tightly enclosed > space with continuous walls or series of sensable objects within a meter > or two of the robot on more than one side (e.g. a corridor where the > sonar can see walls on both the left and right). Sections of clean > straight lines are helpful, as well as occasional larger objects that > can match in another axis than parallel walls and place the robot along > any corridors of parallel walls. > > You can increase the number of samples used to test localization, and > can increase the spread of their distribution around the robot. > (NumSamples and MinNumSamples, StdX/Y/Z). You can also lower the > threshold that determines whether the localization task is in the "Lost" > state or not. > > Let us know if you have any questions about this, or want me to look at > your map. > > > > > tohy maeda > > > > On Tue, Jul 13, 2010 at 1:19 PM, Reed Hedges > > wrote: > > > > > > Hi Toshy, > > > > What do you mean by getting lost? Are you using ARNL or SONARNL for > > localization, and it's entering its lost state? Or something else? > > > > Thanks > > > > Reed > > > > > > On 07/13/2010 09:26 AM, Bruno Maeda wrote: > > > Hi there, > > > > > > I'm having some problems with my simulations, and would like some > > help. > > > The thing is: My robot, on MobileSim, start at some local point, > move > > > around (following a policy control) and, when it reaches a goal, > > restart > > > all over again.... and it does that for about 100 times. > > > The problem is that at some point (usually not at the first > "tryout") > > > the robot start to get lost... and I don't know why is that > > happening... > > > Do anyone have a clue? I'm guessing the problem is that when the > > robot > > > get stalled, it "drives back" a little so it can continue... but I > > > couldn't figure out yet. > > > > > > thanks. > > > > > > -- > > > ???? :: toshy maeda :: > > > > > > > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > > Visit http://robots.mobilerobots.com for information including > > documentation, FAQ, tips, manuals, and software, firmware and driver > > downloads. > > > > > > > > > > -- > > ???? :: toshy maeda :: > > > > > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > -- ???? :: toshy maeda :: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100719/2c8eab49/attachment.html From saleh1.ahmad at ryerson.ca Mon Jul 19 16:19:31 2010 From: saleh1.ahmad at ryerson.ca (Saleh) Date: Mon, 19 Jul 2010 16:19:31 -0400 Subject: [Aria-users] Following a predefined path In-Reply-To: <4C41BE78.4020403@mobilerobots.com> References: <4C3F5DDB.40908@ryerson.ca> <4C41BE78.4020403@mobilerobots.com> Message-ID: <4C44B353.3070807@ryerson.ca> Thanks Reed for you reply. I still have a problem finding a command that accept x, y, and theta as parameters. I only found the following command gotoPoseAction.setGoal (ArPose (2500, 0)); that accept x and y but not theta. Please help. Regards, Saleh On 17/07/2010 10:30 AM, Reed Hedges wrote: > The ARIA reference manual (Aria-Reference.html) describes two levels of > robot motion control, discreet direct motion commands and continuous > ArActions. An ArAction may be a good way to do this. The action would > determine how the robot should move in order to drive towards or along > the path, and return to the action resolver the appropriate > translational and rotational velocities to achieve that. It could be > combined with other actions if you want (such as stopping if it is too > close to obstacles, etc.) or you could even separate different aspects > or components of the motion into different ArAction objects if you want. > > There is an example examples/gotoActionExample.cpp that drives the robot > in a square, this shows how an action can follow a series of waypoints, > but in a very simplified way. > > Let us know if you have any questions or if anything in the Aria > reference manual is unclear. > > Reed > > > On 07/15/2010 03:13 PM, Saleh wrote: > >> Hello, >> I have PowerBot robot that I would like to program using Aria to follow >> a predefined path constructed as a set of (x,y,th)'s. This information >> is calculated offline using a custom path planner program and can be >> given to the robot as a file or a matrix. >> My problem is that I don't know how to start and what commands that I >> should use. >> Any help or example code will be appreciated >> Thanks >> >> >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. >> > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100719/77c89b9f/attachment-0003.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100719/77c89b9f/attachment-0004.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100719/77c89b9f/attachment-0005.html From reed at mobilerobots.com Mon Jul 19 16:34:03 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Mon, 19 Jul 2010 16:34:03 -0400 Subject: [Aria-users] Following a predefined path In-Reply-To: <4C44B353.3070807@ryerson.ca> References: <4C3F5DDB.40908@ryerson.ca> <4C41BE78.4020403@mobilerobots.com> <4C44B353.3070807@ryerson.ca> Message-ID: <4C44B6BB.1060307@mobilerobots.com> Theta (degrees) is an optional third argument to the ArPose constructor, so you can use gotoPoseAction.setGoal(ArPose(2500, 0, 90)); Saleh wrote: > > > Thanks Reed for you reply. I still have a problem finding a command that > accept x, y, and theta as parameters. I only found the following command > > gotoPoseAction.setGoal (ArPose (2500, 0)); that accept x and y but not theta. Please help. > > Regards, > > Saleh > > > On 17/07/2010 10:30 AM, Reed Hedges wrote: >> The ARIA reference manual (Aria-Reference.html) describes two levels of >> robot motion control, discreet direct motion commands and continuous >> ArActions. An ArAction may be a good way to do this. The action would >> determine how the robot should move in order to drive towards or along >> the path, and return to the action resolver the appropriate >> translational and rotational velocities to achieve that. It could be >> combined with other actions if you want (such as stopping if it is too >> close to obstacles, etc.) or you could even separate different aspects >> or components of the motion into different ArAction objects if you want. >> >> There is an example examples/gotoActionExample.cpp that drives the robot >> in a square, this shows how an action can follow a series of waypoints, >> but in a very simplified way. >> >> Let us know if you have any questions or if anything in the Aria >> reference manual is unclear. >> >> Reed >> >> >> On 07/15/2010 03:13 PM, Saleh wrote: >> >>> Hello, >>> I have PowerBot robot that I would like to program using Aria to follow >>> a predefined path constructed as a set of (x,y,th)'s. This information >>> is calculated offline using a custom path planner program and can be >>> given to the robot as a file or a matrix. >>> My problem is that I don't know how to start and what commands that I >>> should use. >>> Any help or example code will be appreciated >>> Thanks >>> >>> >>> >>> _______________________________________________ >>> Aria-users mailing list >>> Aria-users at lists.mobilerobots.com >>> http://lists.mobilerobots.com/mailman/listinfo/aria-users >>> >>> To unsubscribe visit the above webpage or send an e-mail to: >>> >>> aria-users-leave at lists.mobilerobots.com >>> >>> Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. >>> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. >> > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From zhossain.kuet at yahoo.com Tue Jul 20 08:06:37 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Tue, 20 Jul 2010 05:06:37 -0700 (PDT) Subject: [Aria-users] help to get more accurate global position of robot Message-ID: <755906.13147.qm@web46412.mail.sp1.yahoo.com> Hi all, I am using ArRobot::getX() & ArRobot::getY() to save robot's global position and getting very poor result. Is there anyone who can help me to improve mapping. Actually I am driving robot from one place to another using setHeading() and moveDistance() and each time i am saving laser data and robot global position using getX() & getY() functions. Then transforming laser data based on global position, i'm trying to get a map, but it's not working. Any advice of yours are greatly appreciated. Thanks in advance hossain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100720/fea02fc8/attachment.html From reed at mobilerobots.com Tue Jul 20 21:51:47 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Tue, 20 Jul 2010 21:51:47 -0400 Subject: [Aria-users] Failed to get laser data In-Reply-To: <348507.53442.qm@web46416.mail.sp1.yahoo.com> References: <348507.53442.qm@web46416.mail.sp1.yahoo.com> Message-ID: <4C4652B3.1020503@mobilerobots.com> I had a chance to look at your program, and realized the problem: It is (contains) an ArNetworking client which it connects to a server, but it also has an ArSick object, which is for direct connection to the laser device on the same host, not for receiving laser data from an ArNetworking server. If the server has an ArServerInfoSensor object, however, your client can request sensor data from that. It handles three requests: getSensorList to get a list of sensor names, and getSensorCurrent and getSensorCumulative which when given a sensor name, return lists of sensor readings. See the ArNetworking API reference documentation for ArServerInfoSensor, or let me know if you want me to explain it in more detail. From zhossain.kuet at yahoo.com Tue Jul 20 22:05:45 2010 From: zhossain.kuet at yahoo.com (Hossain, Md.Z) Date: Tue, 20 Jul 2010 19:05:45 -0700 (PDT) Subject: [Aria-users] Failed to get laser data In-Reply-To: <4C4652B3.1020503@mobilerobots.com> References: <348507.53442.qm@web46416.mail.sp1.yahoo.com> <4C4652B3.1020503@mobilerobots.com> Message-ID: <758152.22494.qm@web46403.mail.sp1.yahoo.com> Hi Reed, Thank you very much for your reply. I'll try and if failed i'll let you know. I've another query. Would you have a look below? I am using ArRobot::getX() & ArRobot::getY() to save robot's global position and getting very poor result. Is there anyone who can help me to improve mapping. Actually I am driving robot from one place to another using setHeading() and moveDistance() and each time i am saving laser data and robot global position using getX() & getY() functions. Then transforming laser data based on global position, i'm trying to get a map, but it's not working. Any advice of yours are greatly appreciated. best regards Hossain ________________________________ From: Reed Hedges To: "Help, discussion and announcements for MobileRobots' Advanced Robot Interface for Applications (ARIA) " Sent: Wed, July 21, 2010 1:51:47 PM Subject: Re: [Aria-users] Failed to get laser data I had a chance to look at your program, and realized the problem: It is (contains) an ArNetworking client which it connects to a server, but it also has an ArSick object, which is for direct connection to the laser device on the same host, not for receiving laser data from an ArNetworking server. If the server has an ArServerInfoSensor object, however, your client can request sensor data from that. It handles three requests: getSensorList to get a list of sensor names, and getSensorCurrent and getSensorCumulative which when given a sensor name, return lists of sensor readings. See the ArNetworking API reference documentation for ArServerInfoSensor, or let me know if you want me to explain it in more detail. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100720/d755cf5f/attachment.html From toshy.maeda at gmail.com Wed Jul 21 08:42:04 2010 From: toshy.maeda at gmail.com (Bruno Maeda) Date: Wed, 21 Jul 2010 09:42:04 -0300 Subject: [Aria-users] Robot is losting itself In-Reply-To: References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> Message-ID: so... i tested it here and increased the number of samples of the localization tests. Although the localization has gotten better, each time the robot hit a wall, its localization precision get worst and worst... is there a way i can fix that? thanks toshy maeda 2010/7/19 Bruno Maeda > yes.... so that the robot sometimes do it everything alright... but most > of time it fails on localizing itself... here is part of the reset method: > > // Set robot's internal variables > robot->lock(); > robot->moveTo(*initialPose); > robot->unlock(); > ArUtil::sleep(500); > > // Set initial localization > locManager->lock(); > locManager->setRobotPose(*initialPose); > locManager->unlock(); > ArUtil::sleep(500); > > about the localization score, i'm not sure, but i thing it's getting worst > as the robot hits the walls... > > about the environment, i'm testing on a small map, closed room 6x6 meters, > and the corridors are 2 meters width. > > i'm gonna try to increse the number of samples used to the localization > tests and see what happens... > > thanks. > toshy maeda > > > 2010/7/17 Reed Hedges > > On 07/13/2010 12:21 PM, Bruno Maeda wrote: >> > hi reed, >> > >> > yes, i'm using SonARNL for localization, and it seems do be working >> > fine, but after a while the robot start getting some "localization >> > failure"... >> >> When you reset to do another trial, do you use the ArRobot::moveTo() >> method as well as moving the robot in the simulator? >> >> Watch the localization score. You can get this from >> ArSonarLocalizationTask or see it if you enable View->Details and >> View->Custom Details in MobileEyes. Is it gradually dropping or >> suddenly dropping? You can also use that to see if there is a >> particular location in your map where localization score drops. Compare >> it to the localization threshold set in the localization parameters. >> >> There are a few things you can do to help SONARNL localize better. First >> is you can modify the environment a bit. If it's just simulation, this >> is worth doing. SONARNL performs best when in a more tightly enclosed >> space with continuous walls or series of sensable objects within a meter >> or two of the robot on more than one side (e.g. a corridor where the >> sonar can see walls on both the left and right). Sections of clean >> straight lines are helpful, as well as occasional larger objects that >> can match in another axis than parallel walls and place the robot along >> any corridors of parallel walls. >> >> You can increase the number of samples used to test localization, and >> can increase the spread of their distribution around the robot. >> (NumSamples and MinNumSamples, StdX/Y/Z). You can also lower the >> threshold that determines whether the localization task is in the "Lost" >> state or not. >> >> Let us know if you have any questions about this, or want me to look at >> your map. >> >> > >> > tohy maeda >> > >> > On Tue, Jul 13, 2010 at 1:19 PM, Reed Hedges > > > wrote: >> > >> > >> > Hi Toshy, >> > >> > What do you mean by getting lost? Are you using ARNL or SONARNL for >> > localization, and it's entering its lost state? Or something else? >> > >> > Thanks >> > >> > Reed >> > >> > >> > On 07/13/2010 09:26 AM, Bruno Maeda wrote: >> > > Hi there, >> > > >> > > I'm having some problems with my simulations, and would like some >> > help. >> > > The thing is: My robot, on MobileSim, start at some local point, >> move >> > > around (following a policy control) and, when it reaches a goal, >> > restart >> > > all over again.... and it does that for about 100 times. >> > > The problem is that at some point (usually not at the first >> "tryout") >> > > the robot start to get lost... and I don't know why is that >> > happening... >> > > Do anyone have a clue? I'm guessing the problem is that when the >> > robot >> > > get stalled, it "drives back" a little so it can continue... but >> I >> > > couldn't figure out yet. >> > > >> > > thanks. >> > > >> > > -- >> > > ???? :: toshy maeda :: >> > > >> > > >> > > >> > > _______________________________________________ >> > > Aria-users mailing list >> > > Aria-users at lists.mobilerobots.com >> > >> > > http://lists.mobilerobots.com/mailman/listinfo/aria-users >> > > >> > > To unsubscribe visit the above webpage or send an e-mail to: >> > > >> > > aria-users-leave at lists.mobilerobots.com >> > >> > > >> > > Visit http://robots.mobilerobots.com for information including >> > documentation, FAQ, tips, manuals, and software, firmware and driver >> > downloads. >> > >> > _______________________________________________ >> > Aria-users mailing list >> > Aria-users at lists.mobilerobots.com >> > >> > http://lists.mobilerobots.com/mailman/listinfo/aria-users >> > >> > To unsubscribe visit the above webpage or send an e-mail to: >> > >> > aria-users-leave at lists.mobilerobots.com >> > >> > >> > Visit http://robots.mobilerobots.com for information including >> > documentation, FAQ, tips, manuals, and software, firmware and driver >> > downloads. >> > >> > >> > >> > >> > -- >> > ???? :: toshy maeda :: >> > >> > >> > >> > _______________________________________________ >> > Aria-users mailing list >> > Aria-users at lists.mobilerobots.com >> > http://lists.mobilerobots.com/mailman/listinfo/aria-users >> > >> > To unsubscribe visit the above webpage or send an e-mail to: >> > >> > aria-users-leave at lists.mobilerobots.com >> > >> > Visit http://robots.mobilerobots.com for information including >> documentation, FAQ, tips, manuals, and software, firmware and driver >> downloads. >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> Visit http://robots.mobilerobots.com for information including >> documentation, FAQ, tips, manuals, and software, firmware and driver >> downloads. >> > > > > -- > ???? :: toshy maeda :: > -- ???? :: toshy maeda :: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100721/72c04dd9/attachment-0001.html From toshy.maeda at gmail.com Wed Jul 21 12:28:57 2010 From: toshy.maeda at gmail.com (Bruno Maeda) Date: Wed, 21 Jul 2010 13:28:57 -0300 Subject: [Aria-users] Robot is losting itself In-Reply-To: References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> Message-ID: Hi reed, How can I stop robot movements when the motors are stalled, so that the internal pose variables don't mess up so much for these cases? My problem of bad localization seems to be happening when the robot try to keep moving when stalled.... the physical robot is stalled, but the internal position variables of it keeps changing as if the robot was moving yet.... I'm trying this but seems wrong.... // sets the velocity this->robot->lock(); this->robot->setVel(this->vel); this->robot->unlock(); // sets the duration of the movement ArUtil::sleep(this->time); if(this->robot->isRightMotorStalled() || this->robot->isRightMotorStalled()) { // stops all movements this->robot->lock(); this->robot->stop(); this->robot->unlock(); ArUtil::sleep(1000); } // stops all movements this->robot->lock(); this->robot->stop(); this->robot->unlock(); ArUtil::sleep(1000); thanks toshy maeda 2010/7/21 Bruno Maeda > so... i tested it here and increased the number of samples of the > localization tests. Although the localization has gotten better, each time > the robot hit a wall, its localization precision get worst and worst... is > there a way i can fix that? > > thanks > toshy maeda > > 2010/7/19 Bruno Maeda > > yes.... so that the robot sometimes do it everything alright... but most >> of time it fails on localizing itself... here is part of the reset method: >> >> // Set robot's internal variables >> robot->lock(); >> robot->moveTo(*initialPose); >> robot->unlock(); >> ArUtil::sleep(500); >> >> // Set initial localization >> locManager->lock(); >> locManager->setRobotPose(*initialPose); >> locManager->unlock(); >> ArUtil::sleep(500); >> >> about the localization score, i'm not sure, but i thing it's getting worst >> as the robot hits the walls... >> >> about the environment, i'm testing on a small map, closed room 6x6 meters, >> and the corridors are 2 meters width. >> >> i'm gonna try to increse the number of samples used to the localization >> tests and see what happens... >> >> thanks. >> toshy maeda >> >> >> 2010/7/17 Reed Hedges >> >> On 07/13/2010 12:21 PM, Bruno Maeda wrote: >>> > hi reed, >>> > >>> > yes, i'm using SonARNL for localization, and it seems do be working >>> > fine, but after a while the robot start getting some "localization >>> > failure"... >>> >>> When you reset to do another trial, do you use the ArRobot::moveTo() >>> method as well as moving the robot in the simulator? >>> >>> Watch the localization score. You can get this from >>> ArSonarLocalizationTask or see it if you enable View->Details and >>> View->Custom Details in MobileEyes. Is it gradually dropping or >>> suddenly dropping? You can also use that to see if there is a >>> particular location in your map where localization score drops. Compare >>> it to the localization threshold set in the localization parameters. >>> >>> There are a few things you can do to help SONARNL localize better. First >>> is you can modify the environment a bit. If it's just simulation, this >>> is worth doing. SONARNL performs best when in a more tightly enclosed >>> space with continuous walls or series of sensable objects within a meter >>> or two of the robot on more than one side (e.g. a corridor where the >>> sonar can see walls on both the left and right). Sections of clean >>> straight lines are helpful, as well as occasional larger objects that >>> can match in another axis than parallel walls and place the robot along >>> any corridors of parallel walls. >>> >>> You can increase the number of samples used to test localization, and >>> can increase the spread of their distribution around the robot. >>> (NumSamples and MinNumSamples, StdX/Y/Z). You can also lower the >>> threshold that determines whether the localization task is in the "Lost" >>> state or not. >>> >>> Let us know if you have any questions about this, or want me to look at >>> your map. >>> >>> > >>> > tohy maeda >>> > >>> > On Tue, Jul 13, 2010 at 1:19 PM, Reed Hedges >> > > wrote: >>> > >>> > >>> > Hi Toshy, >>> > >>> > What do you mean by getting lost? Are you using ARNL or SONARNL for >>> > localization, and it's entering its lost state? Or something else? >>> > >>> > Thanks >>> > >>> > Reed >>> > >>> > >>> > On 07/13/2010 09:26 AM, Bruno Maeda wrote: >>> > > Hi there, >>> > > >>> > > I'm having some problems with my simulations, and would like >>> some >>> > help. >>> > > The thing is: My robot, on MobileSim, start at some local point, >>> move >>> > > around (following a policy control) and, when it reaches a goal, >>> > restart >>> > > all over again.... and it does that for about 100 times. >>> > > The problem is that at some point (usually not at the first >>> "tryout") >>> > > the robot start to get lost... and I don't know why is that >>> > happening... >>> > > Do anyone have a clue? I'm guessing the problem is that when the >>> > robot >>> > > get stalled, it "drives back" a little so it can continue... but >>> I >>> > > couldn't figure out yet. >>> > > >>> > > thanks. >>> > > >>> > > -- >>> > > ???? :: toshy maeda :: >>> > > >>> > > >>> > > >>> > > _______________________________________________ >>> > > Aria-users mailing list >>> > > Aria-users at lists.mobilerobots.com >>> > >>> > > http://lists.mobilerobots.com/mailman/listinfo/aria-users >>> > > >>> > > To unsubscribe visit the above webpage or send an e-mail to: >>> > > >>> > > aria-users-leave at lists.mobilerobots.com >>> > >>> > > >>> > > Visit http://robots.mobilerobots.com for information including >>> > documentation, FAQ, tips, manuals, and software, firmware and >>> driver >>> > downloads. >>> > >>> > _______________________________________________ >>> > Aria-users mailing list >>> > Aria-users at lists.mobilerobots.com >>> > >>> > http://lists.mobilerobots.com/mailman/listinfo/aria-users >>> > >>> > To unsubscribe visit the above webpage or send an e-mail to: >>> > >>> > aria-users-leave at lists.mobilerobots.com >>> > >>> > >>> > Visit http://robots.mobilerobots.com for information including >>> > documentation, FAQ, tips, manuals, and software, firmware and >>> driver >>> > downloads. >>> > >>> > >>> > >>> > >>> > -- >>> > ???? :: toshy maeda :: >>> > >>> > >>> > >>> > _______________________________________________ >>> > Aria-users mailing list >>> > Aria-users at lists.mobilerobots.com >>> > http://lists.mobilerobots.com/mailman/listinfo/aria-users >>> > >>> > To unsubscribe visit the above webpage or send an e-mail to: >>> > >>> > aria-users-leave at lists.mobilerobots.com >>> > >>> > Visit http://robots.mobilerobots.com for information including >>> documentation, FAQ, tips, manuals, and software, firmware and driver >>> downloads. >>> >>> _______________________________________________ >>> Aria-users mailing list >>> Aria-users at lists.mobilerobots.com >>> http://lists.mobilerobots.com/mailman/listinfo/aria-users >>> >>> To unsubscribe visit the above webpage or send an e-mail to: >>> >>> aria-users-leave at lists.mobilerobots.com >>> >>> Visit http://robots.mobilerobots.com for information including >>> documentation, FAQ, tips, manuals, and software, firmware and driver >>> downloads. >>> >> >> >> >> -- >> ???? :: toshy maeda :: >> > > > > -- > ???? :: toshy maeda :: > -- ???? :: toshy maeda :: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100721/4fedd3ab/attachment.html From reed at mobilerobots.com Wed Jul 21 16:02:35 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Wed, 21 Jul 2010 16:02:35 -0400 Subject: [Aria-users] Robot is losting itself In-Reply-To: References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> Message-ID: <4C47525B.5030506@mobilerobots.com> What particular values keep changing? Robot position (x, y, theta) come from the simulator, and should not be changing if the robot is actually stopped, except to reflect localization corrections. It does take some time after a stop() call, since the command has to be sent, and the robot (simulator) has to decelerate from its current velocity. You can send an estop to stop immediately. When the robot hits a wall in the simulator though, it should stop immediately and no longer be sending changed position values to ARIA. One thing that may be causing the robot to become lost when it hits a wall is this: when localizing, SONARNL will disregard potential robot positions that are occupied by map obstacles, or which are very close to map obstacles. If all of the good potential locations (samples) are in or next to a wall, then SONARNL won't find one with a good enough match. You can relax this restriction by increasing OccDist in the Localization settings, try 1.0. Also, SONARNL considers samples and obstacles to be colocated based on its localization grid, so you could change that too. This situation may happen a bit more in the simulator, since it's possible for the edge of the robot to actually intersect with a wall in the sim if the robot is moving fast enough (so the center of the robot, where many of the localization samples will be if the robot has been well localized, may fall in a map obstacles grid cell or close enough that OccDist makes SONARNL disqualify those samples). Reed Bruno Maeda wrote: > Hi reed, > > How can I stop robot movements when the motors are stalled, so that the > internal pose variables don't mess up so much for these cases? My > problem of bad localization seems to be happening when the robot try to > keep moving when stalled.... the physical robot is stalled, but the > internal position variables of it keeps changing as if the robot was > moving yet.... > I'm trying this but seems wrong.... > > // sets the velocity > this->robot->lock(); > this->robot->setVel(this->vel); > this->robot->unlock(); > // sets the duration of the movement > ArUtil::sleep(this->time); > > if(this->robot->isRightMotorStalled() || this->robot->isRightMotorStalled()) > { > // stops all movements > this->robot->lock(); > this->robot->stop(); > this->robot->unlock(); > ArUtil::sleep(1000); > } > // stops all movements > this->robot->lock(); > this->robot->stop(); > this->robot->unlock(); > ArUtil::sleep(1000); > > thanks > toshy maeda > > 2010/7/21 Bruno Maeda > > > so... i tested it here and increased the number of samples of the > localization tests. Although the localization has gotten better, > each time the robot hit a wall, its localization precision get worst > and worst... is there a way i can fix that? > > thanks > toshy maeda > > 2010/7/19 Bruno Maeda > > > yes.... so that the robot sometimes do it everything alright... > but most of time it fails on localizing itself... here is part > of the reset method: > > // Set robot's internal variables > robot->lock(); > robot->moveTo(*initialPose); > robot->unlock(); > ArUtil::sleep(500); > > // Set initial localization > locManager->lock(); > locManager->setRobotPose(*initialPose); > locManager->unlock(); > ArUtil::sleep(500); > > about the localization score, i'm not sure, but i thing it's > getting worst as the robot hits the walls... > > about the environment, i'm testing on a small map, closed room > 6x6 meters, and the corridors are 2 meters width. > > i'm gonna try to increse the number of samples used to the > localization tests and see what happens... > > thanks. > toshy maeda > > > 2010/7/17 Reed Hedges > > > On 07/13/2010 12:21 PM, Bruno Maeda wrote: > > hi reed, > > > > yes, i'm using SonARNL for localization, and it seems do > be working > > fine, but after a while the robot start getting some > "localization > > failure"... > > When you reset to do another trial, do you use the > ArRobot::moveTo() > method as well as moving the robot in the simulator? > > Watch the localization score. You can get this from > ArSonarLocalizationTask or see it if you enable > View->Details and > View->Custom Details in MobileEyes. Is it gradually dropping or > suddenly dropping? You can also use that to see if there is a > particular location in your map where localization score > drops. Compare > it to the localization threshold set in the localization > parameters. > > There are a few things you can do to help SONARNL localize > better. First > is you can modify the environment a bit. If it's just > simulation, this > is worth doing. SONARNL performs best when in a more tightly > enclosed > space with continuous walls or series of sensable objects > within a meter > or two of the robot on more than one side (e.g. a corridor > where the > sonar can see walls on both the left and right). Sections > of clean > straight lines are helpful, as well as occasional larger > objects that > can match in another axis than parallel walls and place the > robot along > any corridors of parallel walls. > > You can increase the number of samples used to test > localization, and > can increase the spread of their distribution around the robot. > (NumSamples and MinNumSamples, StdX/Y/Z). You can also > lower the > threshold that determines whether the localization task is > in the "Lost" > state or not. > > Let us know if you have any questions about this, or want me > to look at > your map. > > > > > tohy maeda > > > > On Tue, Jul 13, 2010 at 1:19 PM, Reed Hedges > > > >> wrote: > > > > > > Hi Toshy, > > > > What do you mean by getting lost? Are you using ARNL > or SONARNL for > > localization, and it's entering its lost state? Or > something else? > > > > Thanks > > > > Reed > > > > > > On 07/13/2010 09:26 AM, Bruno Maeda wrote: > > > Hi there, > > > > > > I'm having some problems with my simulations, and > would like some > > help. > > > The thing is: My robot, on MobileSim, start at > some local point, move > > > around (following a policy control) and, when it > reaches a goal, > > restart > > > all over again.... and it does that for about 100 > times. > > > The problem is that at some point (usually not at > the first "tryout") > > > the robot start to get lost... and I don't know > why is that > > happening... > > > Do anyone have a clue? I'm guessing the problem is > that when the > > robot > > > get stalled, it "drives back" a little so it can > continue... but I > > > couldn't figure out yet. > > > > > > thanks. > > > > > > -- > > > ???? :: toshy maeda :: > > > > > > > > > > > > _______________________________________________ > > > Aria-users mailing list > > > Aria-users at lists.mobilerobots.com > > > > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > > > To unsubscribe visit the above webpage or send an > e-mail to: > > > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > > > Visit http://robots.mobilerobots.com for > information including > > documentation, FAQ, tips, manuals, and software, > firmware and driver > > downloads. > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an > e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > > > > Visit http://robots.mobilerobots.com for information > including > > documentation, FAQ, tips, manuals, and software, > firmware and driver > > downloads. > > > > > > > > > > -- > > ???? :: toshy maeda :: > > > > > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > > Visit http://robots.mobilerobots.com for information > including documentation, FAQ, tips, manuals, and software, > firmware and driver downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information > including documentation, FAQ, tips, manuals, and software, > firmware and driver downloads. > > > > > -- > ???? :: toshy maeda :: > > > > > -- > ???? :: toshy maeda :: > > > > > -- > ???? :: toshy maeda :: > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From reed at mobilerobots.com Wed Jul 21 16:27:14 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Wed, 21 Jul 2010 16:27:14 -0400 Subject: [Aria-users] Robot is losting itself In-Reply-To: <4C47525B.5030506@mobilerobots.com> References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> <4C47525B.5030506@mobilerobots.com> Message-ID: <4C475822.90005@mobilerobots.com> Oops, this parameter is called DiscardThreshold, not "OccDist". > One thing that may be causing the robot to become lost when it hits a wall is > this: when localizing, SONARNL will disregard potential robot positions that > are occupied by map obstacles, or which are very close to map obstacles. If all > of the good potential locations (samples) are in or next to a wall, then SONARNL > won't find one with a good enough match. You can relax this restriction by > increasing OccDist in the Localization settings, try 1.0. Also, SONARNL > considers samples and obstacles to be colocated based on its localization grid, > so you could change that too. This situation may happen a bit more in the > simulator, since it's possible for the edge of the robot to actually intersect > with a wall in the sim if the robot is moving fast enough (so the center of the > robot, where many of the localization samples will be if the robot has been well > localized, may fall in a map obstacles grid cell or close enough that OccDist > makes SONARNL disqualify those samples). > From dibujante at gmail.com Thu Jul 22 03:53:55 2010 From: dibujante at gmail.com (Peter Dowdy) Date: Thu, 22 Jul 2010 01:53:55 -0600 Subject: [Aria-users] Client disconnected during SYNC0 Message-ID: I'm getting a strange problem when trying to connect to the simulator. I'm using LibAriaJava - here's my init: ---------------------------------------------------------------------------------------------- public void initialize() { Aria.init(); robby = new ArRobot(); conn = new ArTcpConnection(); conn.open(connect_address,8101); setDeviceConnection(conn); ArSonarDevice sonarDev = new ArSonarDevice(); ArKeyHandler keyHandler = new ArKeyHandler(); Aria.setKeyHandler(keyHandler); robby.attachKeyHandler(keyHandler); System.out.println("You may press escape to exit"); robby.addRangeDevice(sonarDev); robby.runAsync(true); robby.lock(); ArModeTeleop teleop = new ArModeTeleop(robby, "teleop", 't', 'T'); ArModeIO io = new ArModeIO(robby, "io", 'i', 'I'); ArModeActs actsMode = new ArModeActs(robby, "acts", 'a', 'A'); ArModeCommand command = new ArModeCommand(robby, "command", 'd', 'D'); teleop.activate(); robby.enableMotors(); robby.unlock(); robby.waitForRunExit(); } ---------------------------------------------------------------------------------------------- Whenever I connect to the simulator, I get this message: Client disconnected during SYNC0, followed by a quit. The TCP connection is successful - I'm connecting to 127.0.0.1 in any case. All of the other code behaves as expected, it's just that something happens during the connection. Is there an important step I'm missing? Thanks, Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100722/0f984b31/attachment.html From toshy.maeda at gmail.com Thu Jul 22 07:51:55 2010 From: toshy.maeda at gmail.com (Bruno Maeda) Date: Thu, 22 Jul 2010 08:51:55 -0300 Subject: [Aria-users] Robot is losting itself In-Reply-To: <4C475822.90005@mobilerobots.com> References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> <4C47525B.5030506@mobilerobots.com> <4C475822.90005@mobilerobots.com> Message-ID: is there a way i can change this parameter on my code and not on the file params?? I couldn't find DiscardThreshold inside my LocalizationTask object... On Wed, Jul 21, 2010 at 5:27 PM, Reed Hedges wrote: > > > Oops, this parameter is called DiscardThreshold, not "OccDist". > > > One thing that may be causing the robot to become lost when it hits a > wall is > > this: when localizing, SONARNL will disregard potential robot positions > that > > are occupied by map obstacles, or which are very close to map obstacles. > If all > > of the good potential locations (samples) are in or next to a wall, then > SONARNL > > won't find one with a good enough match. You can relax this restriction > by > > increasing OccDist in the Localization settings, try 1.0. Also, SONARNL > > considers samples and obstacles to be colocated based on its localization > grid, > > so you could change that too. This situation may happen a bit more in > the > > simulator, since it's possible for the edge of the robot to actually > intersect > > with a wall in the sim if the robot is moving fast enough (so the center > of the > > robot, where many of the localization samples will be if the robot has > been well > > localized, may fall in a map obstacles grid cell or close enough that > OccDist > > makes SONARNL disqualify those samples). > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > -- ???? :: toshy maeda :: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100722/63aa2fcb/attachment.html From reed at mobilerobots.com Thu Jul 22 09:12:25 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Thu, 22 Jul 2010 09:12:25 -0400 Subject: [Aria-users] Robot is losting itself In-Reply-To: References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> <4C47525B.5030506@mobilerobots.com> <4C475822.90005@mobilerobots.com> Message-ID: <4C4843B9.8060600@mobilerobots.com> Hmm, actually I don't see this parameter being actually used by ArSonarLocalizationTask. Maybe SONARNL doesn't do this behavior? I'll find out more. Bruno Maeda wrote: > is there a way i can change this parameter on my code and not on the > file params?? I couldn't find DiscardThreshold inside my > LocalizationTask object... > > On Wed, Jul 21, 2010 at 5:27 PM, Reed Hedges > wrote: > > > > Oops, this parameter is called DiscardThreshold, not "OccDist". > > > One thing that may be causing the robot to become lost when it > hits a wall is > > this: when localizing, SONARNL will disregard potential robot > positions that > > are occupied by map obstacles, or which are very close to map > obstacles. If all > > of the good potential locations (samples) are in or next to a > wall, then SONARNL > > won't find one with a good enough match. You can relax this > restriction by > > increasing OccDist in the Localization settings, try 1.0. Also, > SONARNL > > considers samples and obstacles to be colocated based on its > localization grid, > > so you could change that too. This situation may happen a bit > more in the > > simulator, since it's possible for the edge of the robot to > actually intersect > > with a wall in the sim if the robot is moving fast enough (so the > center of the > > robot, where many of the localization samples will be if the > robot has been well > > localized, may fall in a map obstacles grid cell or close enough > that OccDist > > makes SONARNL disqualify those samples). > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > > > -- > ???? :: toshy maeda :: > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From reed at mobilerobots.com Thu Jul 22 11:23:16 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Thu, 22 Jul 2010 11:23:16 -0400 Subject: [Aria-users] Robot is losting itself In-Reply-To: <4C4843B9.8060600@mobilerobots.com> References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> <4C47525B.5030506@mobilerobots.com> <4C475822.90005@mobilerobots.com> <4C4843B9.8060600@mobilerobots.com> Message-ID: <4C486264.4030100@mobilerobots.com> Yes, I guess this parameter only applies to laser localization. Did you try increasing the StdX/Y/Th? Or turning RecoverOnFail to true and increasing FailedX/Y/Th if needed? Can you also describe in more detail exactly when localization fails and what is happening to the robot position when you hit the wall? In what manner is it hitting the wall? (Also, would it also be useful to try to tune path planning so that it doesn't hit the wall?) Reed Reed Hedges wrote: > Hmm, actually I don't see this parameter being actually used by > ArSonarLocalizationTask. Maybe SONARNL doesn't do this behavior? I'll find out > more. > > > > Bruno Maeda wrote: >> is there a way i can change this parameter on my code and not on the >> file params?? I couldn't find DiscardThreshold inside my >> LocalizationTask object... >> >> On Wed, Jul 21, 2010 at 5:27 PM, Reed Hedges > > wrote: >> >> >> >> Oops, this parameter is called DiscardThreshold, not "OccDist". >> >> > One thing that may be causing the robot to become lost when it >> hits a wall is >> > this: when localizing, SONARNL will disregard potential robot >> positions that >> > are occupied by map obstacles, or which are very close to map >> obstacles. If all >> > of the good potential locations (samples) are in or next to a >> wall, then SONARNL >> > won't find one with a good enough match. You can relax this >> restriction by >> > increasing OccDist in the Localization settings, try 1.0. Also, >> SONARNL >> > considers samples and obstacles to be colocated based on its >> localization grid, >> > so you could change that too. This situation may happen a bit >> more in the >> > simulator, since it's possible for the edge of the robot to >> actually intersect >> > with a wall in the sim if the robot is moving fast enough (so the >> center of the >> > robot, where many of the localization samples will be if the >> robot has been well >> > localized, may fall in a map obstacles grid cell or close enough >> that OccDist >> > makes SONARNL disqualify those samples). >> > >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> >> Visit http://robots.mobilerobots.com for information including >> documentation, FAQ, tips, manuals, and software, firmware and driver >> downloads. >> >> >> >> >> -- >> ???? :: toshy maeda :: >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From j.hdez.alvarez at gmail.com Thu Jul 22 18:44:10 2010 From: j.hdez.alvarez at gmail.com (=?ISO-8859-1?Q?Jacqueline_Hern=E1ndez_Alvarez?=) Date: Thu, 22 Jul 2010 17:44:10 -0500 Subject: [Aria-users] Cannon VC-C50i camera, OpenCV and NTSC In-Reply-To: References: Message-ID: Hi, I am trying to use the Cannon VC-C50i camera with OpenCV libraries, my code is the following: #include #include #include #include #include using namespace std; int main( ){ CvCapture* capture = cvCaptureFromCAM(0); IplImage* frame = 0; if (!capture){ printf("Error: capture = NULL"); return -1; } cvNamedWindow("cvImageFromCAM", CV_WINDOW_AUTOSIZE); frame = cvQueryFrame(capture); cvShowImage("cvImageFromCAM", frame); cvWaitKey(0); cvDestroyWindow("cvImageFromCAM"); cvReleaseCapture(&capture); return 0; } but, when I run the program, the frame I capture is distorted. If I use XawTV viewer before running the program, adjusting to NTSC mode, the frame I get is a normal image. I need to know, how can I use the camera in NTSC mode with OpenCV? Do you have any idea? Thanks in advance. -- Jacqueline Hern?ndez Alvarez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100722/69f4a2e1/attachment-0001.html From zhaohaopku at gmail.com Fri Jul 23 11:06:01 2010 From: zhaohaopku at gmail.com (hao zhao) Date: Fri, 23 Jul 2010 23:06:01 +0800 Subject: [Aria-users] Cannon VC-C50i camera, OpenCV and NTSC In-Reply-To: References: Message-ID: Hi, Do you have frame grabber? Normally it use frame grabber SDK and transfer frame data format to OpenCV. PeopleBot I use just like this. 2010/7/9 Jacqueline Hern?ndez Alvarez > Hi, > I am trying to use the Cannon VC-C50i camera with OpenCV libraries, my code > is the following: > > #include > #include > #include > #include > #include > > using namespace std; > > int main( ){ > > CvCapture* capture = cvCaptureFromCAM(0); > IplImage* frame = 0; > > if (!capture){ > printf("Error: capture = NULL"); > return -1; > } > cvNamedWindow("cvImageFromCAM", CV_WINDOW_AUTOSIZE); > frame = cvQueryFrame(capture); > cvShowImage("cvImageFromCAM", frame); > cvWaitKey(0); > cvDestroyWindow("cvImageFromCAM"); > cvReleaseCapture(&capture); > return 0; > } > > but, when I run the program, the frame I capture is distorted. If I use > XawTV viewer before running the program, adjusting to NTSC mode, the frame I > get is a normal image. I need to know, how can I use the camera in NTSC mode > with OpenCV? > Do you have any idea? > > Thanks in advance. > -- > Jacqueline Hern?ndez Alvarez > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > -- -- Zhao Hao ShenZhen Graduate School of Peking University Phone: +86 13560724546 MSN: zhaohaopku at hotmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100723/ead1364e/attachment.html From j.hdez.alvarez at gmail.com Fri Jul 23 12:40:58 2010 From: j.hdez.alvarez at gmail.com (=?ISO-8859-1?Q?Jacqueline_Hern=E1ndez_Alvarez?=) Date: Fri, 23 Jul 2010 11:40:58 -0500 Subject: [Aria-users] Cannon VC-C50i camera, OpenCV and NTSC In-Reply-To: References: Message-ID: Yes, I have a frame grabber added to the pioneerP3AT's onboard computer On 23 July 2010 10:06, hao zhao wrote: > Hi, > Do you have frame grabber? Normally it use frame grabber SDK and > transfer frame data format to OpenCV. PeopleBot I use just like this. > > > > 2010/7/9 Jacqueline Hern?ndez Alvarez > >> Hi, >> I am trying to use the Cannon VC-C50i camera with OpenCV libraries, my >> code is the following: >> >> #include >> #include >> #include >> #include >> #include >> >> using namespace std; >> >> int main( ){ >> >> CvCapture* capture = cvCaptureFromCAM(0); >> IplImage* frame = 0; >> >> if (!capture){ >> printf("Error: capture = NULL"); >> return -1; >> } >> cvNamedWindow("cvImageFromCAM", CV_WINDOW_AUTOSIZE); >> frame = cvQueryFrame(capture); >> cvShowImage("cvImageFromCAM", frame); >> cvWaitKey(0); >> cvDestroyWindow("cvImageFromCAM"); >> cvReleaseCapture(&capture); >> return 0; >> } >> >> but, when I run the program, the frame I capture is distorted. If I use >> XawTV viewer before running the program, adjusting to NTSC mode, the frame I >> get is a normal image. I need to know, how can I use the camera in NTSC mode >> with OpenCV? >> Do you have any idea? >> >> Thanks in advance. >> -- >> Jacqueline Hern?ndez Alvarez >> >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> Visit http://robots.mobilerobots.com for information including >> documentation, FAQ, tips, manuals, and software, firmware and driver >> downloads. >> >> > > > -- > -- > Zhao Hao > ShenZhen Graduate School of Peking University > Phone: +86 13560724546 > MSN: zhaohaopku at hotmail.com > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > -- Jacqueline Hern?ndez Alvarez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100723/563f52a3/attachment.html From reed at mobilerobots.com Fri Jul 23 13:59:55 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Fri, 23 Jul 2010 13:59:55 -0400 Subject: [Aria-users] Cannon VC-C50i camera, OpenCV and NTSC In-Reply-To: References: Message-ID: <4C49D89B.4000501@mobilerobots.com> I don't know too much about OpenCV, but I know there is a Linux V4L ioctl call for setting the video standard: based on example code from http://linuxtv.org/downloads/v4l-dvb-apis/ch01s07.html struct v4l2_input input; v4l2_std_id std_id; memset (&input, 0, sizeof (input)); if (-1 == ioctl (fd, VIDIOC_G_INPUT, &input.index)) { perror ("VIDIOC_G_INPUT"); exit (EXIT_FAILURE); } if (-1 == ioctl (fd, VIDIOC_ENUMINPUT, &input)) { perror ("VIDIOC_ENUM_INPUT"); exit (EXIT_FAILURE); } if (0 == (input.std & V4L2_STD_NTSC_)) { fprintf (stderr, "Oops. NTSC is not supported.\n"); exit (EXIT_FAILURE); } std_id = V4L2_STD_NTSC_; if (-1 == ioctl (fd, VIDIOC_S_STD, &std_id)) { perror ("VIDIOC_S_STD"); exit (EXIT_FAILURE); } ... You can also modify cvcap_v4l.cpp in OpenCV to always set NTSC or PAL. Is the OpenCV display window rescaling the video at all? That could be another problem, if the window is not resizing correctly and is scaling the image to fit. Jacqueline Hern?ndez Alvarez wrote: > Yes, I have a frame grabber added to the pioneerP3AT's onboard computer > > On 23 July 2010 10:06, hao zhao > wrote: > > Hi, > Do you have frame grabber? Normally it use frame grabber SDK and > transfer frame data format to OpenCV. PeopleBot I use just like this. > > > > 2010/7/9 Jacqueline Hern?ndez Alvarez > > > Hi, > I am trying to use the Cannon VC-C50i camera with OpenCV > libraries, my code is the following: > > #include > #include > #include > #include > #include > > using namespace std; > > int main( ){ > > CvCapture* capture = cvCaptureFromCAM(0); > IplImage* frame = 0; > > if (!capture){ > printf("Error: capture = NULL"); > return -1; > } > cvNamedWindow("cvImageFromCAM", CV_WINDOW_AUTOSIZE); > frame = cvQueryFrame(capture); > cvShowImage("cvImageFromCAM", frame); > cvWaitKey(0); > cvDestroyWindow("cvImageFromCAM"); > cvReleaseCapture(&capture); > return 0; > } > > but, when I run the program, the frame I capture is distorted. > If I use XawTV viewer before running the program, adjusting to > NTSC mode, the frame I get is a normal image. I need to know, > how can I use the camera in NTSC mode with OpenCV? > Do you have any idea? > > Thanks in advance. > -- > Jacqueline Hern?ndez Alvarez > > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com > for information including > documentation, FAQ, tips, manuals, and software, firmware and > driver downloads. > > > > > -- > -- > Zhao Hao > ShenZhen Graduate School of Peking University > Phone: +86 13560724546 > MSN: zhaohaopku at hotmail.com > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > > > -- > Jacqueline Hern?ndez Alvarez > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From reed at mobilerobots.com Fri Jul 23 14:05:14 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Fri, 23 Jul 2010 14:05:14 -0400 Subject: [Aria-users] Cannon VC-C50i camera, OpenCV and NTSC In-Reply-To: <4C49D89B.4000501@mobilerobots.com> References: <4C49D89B.4000501@mobilerobots.com> Message-ID: <4C49D9DA.6080406@mobilerobots.com> Here's another way to set the mode directly, I don't know which one is correct. I think internally OpenCV uses this API. fd = open("/dev/video0", O_RDONLY); assert(fd > 0); struct video_capability cap ; int r = ioctl(fd, VIDIOCGCAP, &cap); assert(r >= 0); /* Get the current settings for channel 1 (replace with 0 to try 0) */ struct video_channel chan; chan.channel = 1 ; r = ioctl(fd, VIDIOCGCHAN, &chan); assert(r >= 0); /* Set the settings to no audio or tuner, ntsc: */ chan.type = VIDEO_TYPE_CAMERA; chan.flags = 0; chan.norm = VIDEO_MODE_NTSC; r = ioctl(fd, VIDIOCSCHAN, &chan); assert(r >= 0); close(fd); Reed Hedges wrote: > I don't know too much about OpenCV, but I know there is a Linux V4L ioctl call > for setting the video standard: > > based on example code from http://linuxtv.org/downloads/v4l-dvb-apis/ch01s07.html > > struct v4l2_input input; > v4l2_std_id std_id; > > memset (&input, 0, sizeof (input)); > > if (-1 == ioctl (fd, VIDIOC_G_INPUT, &input.index)) { > perror ("VIDIOC_G_INPUT"); > exit (EXIT_FAILURE); > } > > if (-1 == ioctl (fd, VIDIOC_ENUMINPUT, &input)) { > perror ("VIDIOC_ENUM_INPUT"); > exit (EXIT_FAILURE); > } > > if (0 == (input.std & V4L2_STD_NTSC_)) { > fprintf (stderr, "Oops. NTSC is not supported.\n"); > exit (EXIT_FAILURE); > } > > std_id = V4L2_STD_NTSC_; > > if (-1 == ioctl (fd, VIDIOC_S_STD, &std_id)) { > perror ("VIDIOC_S_STD"); > exit (EXIT_FAILURE); > } > > > > ... > You can also modify cvcap_v4l.cpp in OpenCV to always set NTSC or PAL. > > Is the OpenCV display window rescaling the video at all? That could be another > problem, if the window is not resizing correctly and is scaling the image to fit. > > > Jacqueline Hern?ndez Alvarez wrote: >> Yes, I have a frame grabber added to the pioneerP3AT's onboard computer >> >> On 23 July 2010 10:06, hao zhao > > wrote: >> >> Hi, >> Do you have frame grabber? Normally it use frame grabber SDK and >> transfer frame data format to OpenCV. PeopleBot I use just like this. >> >> >> >> 2010/7/9 Jacqueline Hern?ndez Alvarez > > >> >> Hi, >> I am trying to use the Cannon VC-C50i camera with OpenCV >> libraries, my code is the following: >> >> #include >> #include >> #include >> #include >> #include >> >> using namespace std; >> >> int main( ){ >> >> CvCapture* capture = cvCaptureFromCAM(0); >> IplImage* frame = 0; >> >> if (!capture){ >> printf("Error: capture = NULL"); >> return -1; >> } >> cvNamedWindow("cvImageFromCAM", CV_WINDOW_AUTOSIZE); >> frame = cvQueryFrame(capture); >> cvShowImage("cvImageFromCAM", frame); >> cvWaitKey(0); >> cvDestroyWindow("cvImageFromCAM"); >> cvReleaseCapture(&capture); >> return 0; >> } >> >> but, when I run the program, the frame I capture is distorted. >> If I use XawTV viewer before running the program, adjusting to >> NTSC mode, the frame I get is a normal image. I need to know, >> how can I use the camera in NTSC mode with OpenCV? >> Do you have any idea? >> >> Thanks in advance. >> -- >> Jacqueline Hern?ndez Alvarez >> >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> >> Visit http://robots.mobilerobots.com >> for information including >> documentation, FAQ, tips, manuals, and software, firmware and >> driver downloads. >> >> >> >> >> -- >> -- >> Zhao Hao >> ShenZhen Graduate School of Peking University >> Phone: +86 13560724546 >> MSN: zhaohaopku at hotmail.com >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> >> Visit http://robots.mobilerobots.com for information including >> documentation, FAQ, tips, manuals, and software, firmware and driver >> downloads. >> >> >> >> >> -- >> Jacqueline Hern?ndez Alvarez >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Aria-users mailing list >> Aria-users at lists.mobilerobots.com >> http://lists.mobilerobots.com/mailman/listinfo/aria-users >> >> To unsubscribe visit the above webpage or send an e-mail to: >> >> aria-users-leave at lists.mobilerobots.com >> >> Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From saleh1.ahmad at ryerson.ca Sat Jul 24 20:04:53 2010 From: saleh1.ahmad at ryerson.ca (Saleh) Date: Sat, 24 Jul 2010 20:04:53 -0400 Subject: [Aria-users] Need help on AriaNetworking Message-ID: <4C4B7FA5.5000502@ryerson.ca> Hello, 1. Regarding the clientdemo example: a) Clientdemo example does not compile correctly. What do I need to change in the "clientdemo.cpp"? And how can I give the server information (like the onboard PC IP address, hostname and/or password)? b) I have written a code that make the robot track a predefined path and tested it on mobileSim. I would like to run this code on an off-board laptop. How can I do that and what programs need to be running in both, the on-board and the off-board PC? 2. General questions: a) Do I need to install visual c++ on the onboard PC b) Should I install antivirus software? c) I have not received the windows embedded installation CD with my robot. d) How can I restore my system in case if went wrong? Thank you in advance for your help. Regards, Saleh. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100724/6dd78d7d/attachment-0001.html From j.hdez.alvarez at gmail.com Mon Jul 26 14:20:48 2010 From: j.hdez.alvarez at gmail.com (=?ISO-8859-1?Q?Jacqueline_Hern=E1ndez_Alvarez?=) Date: Mon, 26 Jul 2010 13:20:48 -0500 Subject: [Aria-users] Cannon VC-C50i camera, OpenCV and NTSC In-Reply-To: <4C49D9DA.6080406@mobilerobots.com> References: <4C49D89B.4000501@mobilerobots.com> <4C49D9DA.6080406@mobilerobots.com> Message-ID: Hi again, I have used the second code and the camera has functioned in the NTSC mode, I just have added the libraries #include , #include , #include and I have changed chan.channel=1 to chan.channel=0. But, when I capture a set of frames, after a random time my program ends and I get the following output: VIDIOC_DQBUF error 5, Input/output error I have searched for a solution and I found this link http://robolab.tek.sdu.dk/mediawiki/index.php/Using_OpenCV_on_live_video, in which says I have to revert my kernel to a 2.6.18 version for solving the problem. I have the 2.6.26-2-686 kernel version and I don't want to reverting it. Do you have any idea? Thank you very much. On 23 July 2010 13:05, Reed Hedges wrote: > > Here's another way to set the mode directly, I don't know which one is > correct. > I think internally OpenCV uses this API. > > fd = open("/dev/video0", O_RDONLY); > assert(fd > 0); > struct video_capability cap ; > int r = ioctl(fd, VIDIOCGCAP, &cap); > assert(r >= 0); > > /* Get the current settings for channel 1 (replace with 0 to try 0) */ > struct video_channel chan; > chan.channel = 1 ; > r = ioctl(fd, VIDIOCGCHAN, &chan); > assert(r >= 0); > > /* Set the settings to no audio or tuner, ntsc: */ > chan.type = VIDEO_TYPE_CAMERA; > chan.flags = 0; > chan.norm = VIDEO_MODE_NTSC; > r = ioctl(fd, VIDIOCSCHAN, &chan); > assert(r >= 0); > > close(fd); > > > Reed Hedges wrote: > > I don't know too much about OpenCV, but I know there is a Linux V4L ioctl > call > > for setting the video standard: > > > > based on example code from > http://linuxtv.org/downloads/v4l-dvb-apis/ch01s07.html > > > > struct v4l2_input input; > > v4l2_std_id std_id; > > > > memset (&input, 0, sizeof (input)); > > > > if (-1 == ioctl (fd, VIDIOC_G_INPUT, &input.index)) { > > perror ("VIDIOC_G_INPUT"); > > exit (EXIT_FAILURE); > > } > > > > if (-1 == ioctl (fd, VIDIOC_ENUMINPUT, &input)) { > > perror ("VIDIOC_ENUM_INPUT"); > > exit (EXIT_FAILURE); > > } > > > > if (0 == (input.std & V4L2_STD_NTSC_)) { > > fprintf (stderr, "Oops. NTSC is not supported.\n"); > > exit (EXIT_FAILURE); > > } > > > > std_id = V4L2_STD_NTSC_; > > > > if (-1 == ioctl (fd, VIDIOC_S_STD, &std_id)) { > > perror ("VIDIOC_S_STD"); > > exit (EXIT_FAILURE); > > } > > > > > > > > ... > > You can also modify cvcap_v4l.cpp in OpenCV to always set NTSC or PAL. > > > > Is the OpenCV display window rescaling the video at all? That could be > another > > problem, if the window is not resizing correctly and is scaling the image > to fit. > > > > > > Jacqueline Hern?ndez Alvarez wrote: > >> Yes, I have a frame grabber added to the pioneerP3AT's onboard computer > >> > >> On 23 July 2010 10:06, hao zhao >> > wrote: > >> > >> Hi, > >> Do you have frame grabber? Normally it use frame grabber SDK and > >> transfer frame data format to OpenCV. PeopleBot I use just like > this. > >> > >> > >> > >> 2010/7/9 Jacqueline Hern?ndez Alvarez >> > > >> > >> Hi, > >> I am trying to use the Cannon VC-C50i camera with OpenCV > >> libraries, my code is the following: > >> > >> #include > >> #include > >> #include > >> #include > >> #include > >> > >> using namespace std; > >> > >> int main( ){ > >> > >> CvCapture* capture = cvCaptureFromCAM(0); > >> IplImage* frame = 0; > >> > >> if (!capture){ > >> printf("Error: capture = NULL"); > >> return -1; > >> } > >> cvNamedWindow("cvImageFromCAM", CV_WINDOW_AUTOSIZE); > >> frame = cvQueryFrame(capture); > >> cvShowImage("cvImageFromCAM", frame); > >> cvWaitKey(0); > >> cvDestroyWindow("cvImageFromCAM"); > >> cvReleaseCapture(&capture); > >> return 0; > >> } > >> > >> but, when I run the program, the frame I capture is distorted. > >> If I use XawTV viewer before running the program, adjusting to > >> NTSC mode, the frame I get is a normal image. I need to know, > >> how can I use the camera in NTSC mode with OpenCV? > >> Do you have any idea? > >> > >> Thanks in advance. > >> -- > >> Jacqueline Hern?ndez Alvarez > >> > >> > >> _______________________________________________ > >> Aria-users mailing list > >> Aria-users at lists.mobilerobots.com > >> > >> http://lists.mobilerobots.com/mailman/listinfo/aria-users > >> > >> To unsubscribe visit the above webpage or send an e-mail to: > >> > >> aria-users-leave at lists.mobilerobots.com > >> > >> > >> Visit http://robots.mobilerobots.com > >> for information including > >> documentation, FAQ, tips, manuals, and software, firmware and > >> driver downloads. > >> > >> > >> > >> > >> -- > >> -- > >> Zhao Hao > >> ShenZhen Graduate School of Peking University > >> Phone: +86 13560724546 > >> MSN: zhaohaopku at hotmail.com > >> > >> _______________________________________________ > >> Aria-users mailing list > >> Aria-users at lists.mobilerobots.com > >> > >> http://lists.mobilerobots.com/mailman/listinfo/aria-users > >> > >> To unsubscribe visit the above webpage or send an e-mail to: > >> > >> aria-users-leave at lists.mobilerobots.com > >> > >> > >> Visit http://robots.mobilerobots.com for information including > >> documentation, FAQ, tips, manuals, and software, firmware and driver > >> downloads. > >> > >> > >> > >> > >> -- > >> Jacqueline Hern?ndez Alvarez > >> > >> > >> ------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> Aria-users mailing list > >> Aria-users at lists.mobilerobots.com > >> http://lists.mobilerobots.com/mailman/listinfo/aria-users > >> > >> To unsubscribe visit the above webpage or send an e-mail to: > >> > >> aria-users-leave at lists.mobilerobots.com > >> > >> Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > > > _______________________________________________ > > Aria-users mailing list > > Aria-users at lists.mobilerobots.com > > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > > > To unsubscribe visit the above webpage or send an e-mail to: > > > > aria-users-leave at lists.mobilerobots.com > > > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including > documentation, FAQ, tips, manuals, and software, firmware and driver > downloads. > -- Jacqueline Hern?ndez Alvarez Autonomous University of Mexico State Bachelor Student -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100726/29e2026f/attachment.html From toshy.maeda at gmail.com Mon Jul 26 15:36:58 2010 From: toshy.maeda at gmail.com (Bruno Maeda) Date: Mon, 26 Jul 2010 16:36:58 -0300 Subject: [Aria-users] Robot is losting itself In-Reply-To: <4C486264.4030100@mobilerobots.com> References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> <4C47525B.5030506@mobilerobots.com> <4C475822.90005@mobilerobots.com> <4C4843B9.8060600@mobilerobots.com> <4C486264.4030100@mobilerobots.com> Message-ID: here.. this is what is happening... it seems the problem is because the localization don't consider the heading, and this measure accumulates until it reaches this abnormal difference between the real position of the robot and the one that the robot thinks it is... [image: Untitled.jpg] thanks. -- ???? :: toshy maeda :: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100726/ba6abc57/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 151323 bytes Desc: not available Url : http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100726/ba6abc57/attachment-0001.jpe -------------- next part -------------- A non-text attachment was scrubbed... Name: Untitled.jpg Type: image/jpeg Size: 151323 bytes Desc: not available Url : http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100726/ba6abc57/attachment-0001.jpg From reed at mobilerobots.com Mon Jul 26 15:56:53 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Mon, 26 Jul 2010 15:56:53 -0400 Subject: [Aria-users] Robot is losting itself In-Reply-To: References: <4C3C91FB.4050906@mobilerobots.com> <4C41FEEF.7070102@mobilerobots.com> <4C47525B.5030506@mobilerobots.com> <4C475822.90005@mobilerobots.com> <4C4843B9.8060600@mobilerobots.com> <4C486264.4030100@mobilerobots.com> Message-ID: <4C4DE885.3030005@mobilerobots.com> If you send your map and parameters (arnl.p plus any values you are explicitly setting in the code) and describe where I should try driving the robot to get it to fail, I can give it a try and see if I notice anything that might help. You can also turn on "localization" in the "map" menu in MobileEyes to show localization samples. In the second screenshot, what did MobileEyes show for "Status" (it's behind MobileSim in that screenshot). It seems to still have a localization score of 0.2, which is above the default threshold of 0.1 for lost. (The default 0.1 threshold value is fairly low, since SONARNL can sometimes drop down pretty low if the sonar is only matching in a few places; if this is temporary then it lets things continue, but if it really is badly localized as in your screenshot then you see it ends up stuck without entering an actual lost state. So if this is the case, one thing you could do is to increase PassThreshold, then if RecoverOnFail is true it will try localizing using the FailedX/Y/Th settings for area to test.) Bruno Maeda wrote: > here.. this is what is happening... it seems the problem is because the > localization don't consider the heading, and this measure accumulates > until it reaches this abnormal difference between the real position of > the robot and the one that the robot thinks it is... > > Untitled.jpg > > > thanks. > -- > ???? :: toshy maeda :: > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Aria-users mailing list > Aria-users at lists.mobilerobots.com > http://lists.mobilerobots.com/mailman/listinfo/aria-users > > To unsubscribe visit the above webpage or send an e-mail to: > > aria-users-leave at lists.mobilerobots.com > > Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. From dhaval.deshpandey at gmail.com Tue Jul 27 13:30:40 2010 From: dhaval.deshpandey at gmail.com (dhaval deshpandey) Date: Tue, 27 Jul 2010 11:30:40 -0600 Subject: [Aria-users] MobilSim 0.4.0 on Ubuntu Message-ID: Hi, I was trying to install the MobilSim 0.4.0 and I just ran "make" from the MobileSim folder and it gave this error - main.cc:1320: error: invalid conversion from ?const char*? to ?char*? Have any one have encountered the same error before? And also has anyone have any idea about this? Thanks, Dhaval. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100727/c7535951/attachment.html From dibujante at gmail.com Tue Jul 27 13:49:30 2010 From: dibujante at gmail.com (Peter Dowdy) Date: Tue, 27 Jul 2010 13:49:30 -0400 Subject: [Aria-users] MobilSim 0.4.0 on Ubuntu In-Reply-To: References: Message-ID: I had that issue. I changed the offending line, I think, so that they were both char*. Totally bogus, I know, but it compiled and ran anyways. On Jul 27, 2010 1:30 PM, "dhaval deshpandey" wrote: Hi, I was trying to install the MobilSim 0.4.0 and I just ran "make" from the MobileSim folder and it gave this error - main.cc:1320: error: invalid conversion from ?const char*? to ?char*? Have any one have encountered the same error before? And also has anyone have any idea about this? Thanks, Dhaval. _______________________________________________ Aria-users mailing list Aria-users at lists.mobilerobots.com http://lists.mobilerobots.com/mailman/listinfo/aria-users To unsubscribe visit the above webpage or send an e-mail to: aria-users-leave at lists.mobilerobots.com Visit http://robots.mobilerobots.com for information including documentation, FAQ, tips, manuals, and software, firmware and driver downloads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100727/c9c36b3f/attachment.html