From reed at mobilerobots.com Thu Apr 1 17:12:00 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Thu, 01 Apr 2010 17:12:00 -0400 Subject: [Aria-users] [Pioneer-users] Plz Give me Sol for this In-Reply-To: References: Message-ID: <4BB50C20.406@mobilerobots.com> raghu dasara wrote: > ------ Build started: Project: wander, Configuration: Debug Win32 ------ > > Compiling... > > wander.cpp > > Linking... > > LINK : fatal error LNK1104: cannot open file 'C:\Program > Files\MobileRobots\Aria\bin' Can you verify that this directory exists, and that you are able to save files there (e.g. copy something in there from your documents or desktop)? > > Creating browse information file... > > Microsoft Browse Information Maintenance Utility Version 9.00.30729 > > Copyright (C) Microsoft Corporation. All rights reserved. > > BSCMAKE: warning BK4501 : ignoring unknown option '/wander.bsc' Can you send wanderBuildLog.htm and also look at the properties for the wander project, expand the Browse Information category, and click on Command Line and send what it shows the bscmake command line it's using is? Visual Studio is supposed to be OK with either \ or / as a directory separator, but maybe it's not working on your system for some reason. From nmukanov at uwaterloo.ca Thu Apr 8 15:39:43 2010 From: nmukanov at uwaterloo.ca (Nurlan Mukanov) Date: Thu, 08 Apr 2010 15:39:43 -0400 Subject: [Aria-users] reading from the file and do action Message-ID: <20100408153943.33953vo2bg1gaccg@www.nexusmail.uwaterloo.ca> Hello, aria-users. Could you help me with the task. I need to make robot read the text file and according to commands there do some actions. For example, if text says:"move forward 1 meter", the robot should move one meter. Also, the program should constantly scan the file. if the text file(command inside file) changes, the robot right away should do the action according to the command. Actually, I did something like that. I created several execut. files. The main application reads from the file constantly and executes other executable files. The problem is that the main application executes other ones everytime. I want to run everything(motors and connection) and then wait for the change inside the text file and do just the action(not start everything again: turn on the motors, sonars, laser etc.). the whole this process is needed for speech recognitiion program that will send output text files to the robot and the robot will do the action(speech recognition will be installed on the base(laptop)). I appreciate your help. Best Regards, Nurlan Mukanov. From H.Miri at 2007.hull.ac.uk Sat Apr 10 16:10:44 2010 From: H.Miri at 2007.hull.ac.uk (Hossein Miri) Date: Sat, 10 Apr 2010 21:10:44 +0100 Subject: [Aria-users] Access violation reading location 0x0000000c Message-ID: <445800D8FD5D3D43878FD7D2842A3047D3D580@EXCL2VS2.adir.hull.ac.uk> Does anyone in this forum know why including a term such as: t = PL_new_term_ref(); would cause an Unhandled Exception error message: 0xC0000005: Access violation reading location 0x0000000c. in Visual Studio 2008 C++ I have a header file: class UserTaskProlog : public ArAction { public: UserTaskProlog( const char* name = " sth " ); ~UserTaskProlog( ); AREXPORT virtual ArActionDesired *fire( ArActionDesired currentDesired ); private: term_t t; }; and a cpp file: UserTaskProlog::UserTaskProlog( const char* name ) : ArAction( name, " sth " ) { char** argv; argv[ 0 ] = "libpl.dll"; PL_initialise( 1, argv ); PlCall( "consult( 'myProg.pl' )" ); } UserTaskProlog::~UserTaskProlog( ) { } ArActionDesired *UserTaskProlog::fire( ArActionDesired currentDesired ) { cout << " something " << endl; tf= PL_new_term_ref( ); return NULL; } Without t=PL_new_term_ref() everything works fine, but when I start adding my Prolog code (declarations first, such as t=PL_new_term_ref), I get this Access Violation error message. Obviously, return NULL should be there, as this class does not control robot's movement. I have also tried commenting it out, which has caused a crash. So there is no dispute in return NULL. But what else could be interfering with the inclusion of such a simple Prolog term? I'd appreciate any help. Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100410/1f40a2b0/attachment-0001.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100410/1f40a2b0/attachment-0001.ksh From H.Miri at 2007.hull.ac.uk Tue Apr 13 14:03:05 2010 From: H.Miri at 2007.hull.ac.uk (Hossein Miri) Date: Tue, 13 Apr 2010 19:03:05 +0100 Subject: [Aria-users] User Task layout Message-ID: <445800D8FD5D3D43878FD7D2842A3047D3D588@EXCL2VS2.adir.hull.ac.uk> Hello Reed/Matt, Is the following structure correct for adding a user-defined task? #include files... MyUserTask::MyUserTask( const char* name ) : ArAction( name, "something" ) { aria_cycles = 0; // other initializations perhaps... } MyUserTask::~ MyUserTask( ) { } AREXPORT ArActionDesired * MyUserTask::fire( ArActionDesired currentDesired ) { // do something, e.g. print some sonar readings... // aria_cycles++ return NULL; } int main( int argc, char** argv ) { Aria::init(); ArRobot robot; ArArgumentParser argParser( &argc, argv ); argParser.loadDefaultArguments( ); ArRobotConnector robotConnector( &argParser, &robot ); ArLaserConnector laserConnector( &argParser, &robot, &robotConnector ); argParser.addDefaultArgument( "-connectLaser" ); // Connect to the robot. If failed, warn: if( !robotConnector.connectRobot( ) ) { ArLog::log( ArLog::Terse, "Could not connect to Cerno... Exiting!" ); if( argParser.checkHelpAndWarnUnparsed( ) ) { Aria::logOptions( ); Aria::exit( 1 ); } } // Do this after connecting to the robot: if ( !Aria::parseArgs( ) || !argParser.checkHelpAndWarnUnparsed( ) ) { Aria::logOptions( ); Aria::exit( 1 ); } printf( "This program will do ..." ); ArKeyHandler keyHandler; Aria::setKeyHandler( &keyHandler ); robot.attachKeyHandler( &keyHandler ); ArSonarDevice sonar; ArBumpers bumpers; ArIRs ir; robot.addRangeDevice( &sonar ); robot.addRangeDevice( &bumpers ); robot.addRangeDevice( &ir ); // Try to connect to the laser. If failed, warn but continue, using sonar only: if( !laserConnector.connectLasers( ) ) { ArLog::log( ArLog::Normal, "Warning: Unable to connect to requested lasers ... Will wander using robot sonar only." ); } MyUserTask talk; ArActionStallRecover recoverAct; ArActionBumpers bumpAct; ArActionAvoidFront avoidFrontNearAct( "Avoid Front Near", 225, 0 ); ArActionAvoidFront avoidFrontFarAct; ArActionConstantVelocity constantVelocityAct( "Constant Velocity", 400 ); robot.addAction( &talk, 100 ); robot.addAction( &recoverAct, 90 ); robot.addAction( &bumpAct, 70 ); robot.addAction( &avoidFrontNearAct, 50 ); robot.addAction( &avoidFrontFarAct, 30 ); robot.addAction( &constantVelocityAct, 20 ); // Enable the motors and start the robot running: robot.enableMotors( ); robot.runAsync( true ); // Wait for the robot task loop to end before exiting the program: robot.waitForRunExit( ); // Now, exit: Aria::exit( 0 ); } Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100413/45deec12/attachment.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100413/45deec12/attachment.ksh From reed at mobilerobots.com Wed Apr 14 16:21:46 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Wed, 14 Apr 2010 16:21:46 -0400 Subject: [Aria-users] reading from the file and do action In-Reply-To: <20100408153943.33953vo2bg1gaccg@www.nexusmail.uwaterloo.ca> References: <20100408153943.33953vo2bg1gaccg@www.nexusmail.uwaterloo.ca> Message-ID: <4BC623DA.8030902@mobilerobots.com> Hi Nurlan, I find the standard C file API easiest to use (fopen/fclose, fscanf or fread, etc.) but there are others (in Windows for example). You can use a robot action object (ArAction) to check the file and request robot action. (Or, use a user task callback.) This gets invoked 10 times a second. If this is too frequent, you can use a counter or an ArTime object to track when to do the work. Important note: a robot action or task callback must not run for too long, or other actions/tasks as well as the actual sending and receiving data to/from the robot will be impacted. The total task cycle (all robot tasks) should be less than 100ms. If it takes more than that to check the input, you will have to do it in a separate asynchronous thread. See the ARIA reference manual for a discussion of ArAction, user tasks, and threads. As I mentioned before, you might find using direct network communications to perform better and have less hidden problems rather than file transfer, and you can use ArNetServer to do this if you want. Reed Nurlan Mukanov wrote: > Hello, aria-users. > > Could you help me with the task. > > I need to make robot read the text file and according to commands > there do some actions. For example, if text says:"move forward 1 > meter", the robot should move one meter. Also, the program should > constantly scan the file. if the text file(command inside file) > changes, the robot right away should do the action according to the > command. Actually, I did something like that. I created several > execut. files. The main application reads from the file constantly and > executes other executable files. The problem is that the main > application executes other ones everytime. I want to run > everything(motors and connection) and then wait for the change inside > the text file and do just the action(not start everything again: turn > on the motors, sonars, laser etc.). the whole this process is needed > for speech recognitiion program that will send output text files to > the robot and the robot will do the action(speech recognition will be > installed on the base(laptop)). > > I appreciate your help. > > Best Regards, > Nurlan Mukanov. > > > From reed at mobilerobots.com Wed Apr 14 16:35:54 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Wed, 14 Apr 2010 16:35:54 -0400 Subject: [Aria-users] User Task layout In-Reply-To: <445800D8FD5D3D43878FD7D2842A3047D3D588@EXCL2VS2.adir.hull.ac.uk> References: <445800D8FD5D3D43878FD7D2842A3047D3D588@EXCL2VS2.adir.hull.ac.uk> Message-ID: <4BC6272A.2030300@mobilerobots.com> Yes, this looks correct at first glance. Hovever, if this task is never going to control the robot motion, then it does not have to be an ArAction object, you can use a user task or sensor interpretation task callback in ArRobot. You supply a user task to ArRobot as a functor which can invoke an object method or any function (use one of the subclasses of ArFunctor, see ARIA reference manual for discussion of functors). Though it will work as an ArAction OK. Is the code working or is there a problem? Hossein Miri wrote: > Hello Reed/Matt, > > Is the following structure correct for adding a user-defined task? > > > #include files... > > > MyUserTask::MyUserTask( const char* name ) : ArAction( name, "something" ) > { > aria_cycles = 0; > // other initializations perhaps... > } > > > MyUserTask::~ MyUserTask( ) > { > } > > > AREXPORT ArActionDesired * MyUserTask::fire( ArActionDesired > currentDesired ) > { > // do something, e.g. print some sonar readings... > // aria_cycles++ > > return NULL; > } > > > int main( int argc, char** argv ) > { > Aria::init(); > ArRobot robot; > ArArgumentParser argParser( &argc, argv ); > argParser.loadDefaultArguments( ); > ArRobotConnector robotConnector( &argParser, &robot ); > ArLaserConnector laserConnector( &argParser, &robot, > &robotConnector ); > argParser.addDefaultArgument( "-connectLaser" ); > > > // Connect to the robot. If failed, warn: > if( !robotConnector.connectRobot( ) ) > { > ArLog::log( ArLog::Terse, "Could not connect to Cerno... > Exiting!" ); > if( argParser.checkHelpAndWarnUnparsed( ) ) > { > Aria::logOptions( ); > Aria::exit( 1 ); > } > } > > > // Do this after connecting to the robot: > if ( !Aria::parseArgs( ) || !argParser.checkHelpAndWarnUnparsed( ) ) > { > Aria::logOptions( ); > Aria::exit( 1 ); > } > > > printf( "This program will do ..." ); > > > ArKeyHandler keyHandler; > Aria::setKeyHandler( &keyHandler ); > robot.attachKeyHandler( &keyHandler ); > ArSonarDevice sonar; > ArBumpers bumpers; > ArIRs ir; > > > robot.addRangeDevice( &sonar ); > robot.addRangeDevice( &bumpers ); > robot.addRangeDevice( &ir ); > > > // Try to connect to the laser. If failed, warn but continue, > using sonar only: > if( !laserConnector.connectLasers( ) ) > { > ArLog::log( ArLog::Normal, "Warning: Unable to connect > to requested lasers ... Will wander using robot sonar only." ); > } > > > MyUserTask talk; > ArActionStallRecover recoverAct; > ArActionBumpers bumpAct; > ArActionAvoidFront avoidFrontNearAct( "Avoid Front Near", 225, 0 ); > ArActionAvoidFront avoidFrontFarAct; > ArActionConstantVelocity constantVelocityAct( "Constant > Velocity", 400 ); > > > robot.addAction( &talk, 100 ); > robot.addAction( &recoverAct, 90 ); > robot.addAction( &bumpAct, 70 ); > robot.addAction( &avoidFrontNearAct, 50 ); > robot.addAction( &avoidFrontFarAct, 30 ); > robot.addAction( &constantVelocityAct, 20 ); > > > // Enable the motors and start the robot running: > robot.enableMotors( ); > robot.runAsync( true ); > > > // Wait for the robot task loop to end before exiting the program: > robot.waitForRunExit( ); > > > // Now, exit: > Aria::exit( 0 ); > } > > > Thanks, > > > ------------------------------------------------------------------------ > > ***************************************************************************************** > To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html > ***************************************************************************************** > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 Apr 14 16:40:33 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Wed, 14 Apr 2010 16:40:33 -0400 Subject: [Aria-users] Access violation reading location 0x0000000c In-Reply-To: <445800D8FD5D3D43878FD7D2842A3047D3D580@EXCL2VS2.adir.hull.ac.uk> References: <445800D8FD5D3D43878FD7D2842A3047D3D580@EXCL2VS2.adir.hull.ac.uk> Message-ID: <4BC62841.5010905@mobilerobots.com> I don't know exactly why this would happen, I don't know anything about the Prolog library, but it seems like the exception is occuring inside the call to PL_new_term_ref()? Can you see a stack trace if you run in the debugger? One thing I notice is that you don't seem to allocate any memory for the argv char* array. I would make argv a member of the class, and use new or malloc in the constructor and delete[] or free in the destructor; or make it a fixed size array (e.g. char* argv[1]). You might also want to make the destructor virtual, this is usually what you want in a class with virtual inheritance. Hossein Miri wrote: > > Does anyone in this forum know why including a term such as: > > t = PL_new_term_ref(); > > would cause an Unhandled Exception error message: > > 0xC0000005: Access violation reading location 0x0000000c. > > in Visual Studio 2008 C++ > > > I have a header file: > > class UserTaskProlog : public ArAction > { > public: > UserTaskProlog( const char* name = " sth " ); > ~UserTaskProlog( ); > AREXPORT virtual ArActionDesired *fire( ArActionDesired > currentDesired ); > > private: > term_t t; > }; > > > and a cpp file: > > UserTaskProlog::UserTaskProlog( const char* name ) : ArAction( name, > " sth " ) > { > char** argv; > argv[ 0 ] = "libpl.dll"; > PL_initialise( 1, argv ); > PlCall( "consult( 'myProg.pl' )" ); > } > > UserTaskProlog::~UserTaskProlog( ) > { > } > > ArActionDesired *UserTaskProlog::fire( ArActionDesired currentDesired ) > { > cout << " something " << endl; > tf= PL_new_term_ref( ); > return NULL; > } > > > Without t=PL_new_term_ref() everything works fine, but when I start > adding my Prolog code (declarations first, such as t=PL_new_term_ref), I > get this Access Violation error message. > > Obviously, return NULL should be there, as this class does not control > robot's movement. I have also tried commenting it out, which has caused > a crash. So there is no dispute in return NULL. But what else could be > interfering with the inclusion of such a simple Prolog term? > > I'd appreciate any help. > > Thanks, > > From nmukanov at uwaterloo.ca Wed Apr 14 19:27:10 2010 From: nmukanov at uwaterloo.ca (Nurlan Mukanov) Date: Wed, 14 Apr 2010 19:27:10 -0400 Subject: [Aria-users] Move and do other actions simultaneously. Message-ID: <20100414192710.928215pm5n04aoo0@www.nexusmail.uwaterloo.ca> Hello, Reed. Thanks a lot for previous response. Now I have another problem. I should create different executable files where each file is some action. I created them. Using gripper is easy. Gripper can open paddles and lift up simultaneously. However, robot can not move and open gripper at the same time, because when executing "move forward 1"(means move forward for one meter). The program will be running until it accomplishes the action and then program closes. Also, I can not interrupt the movement, what is not flexible either. What I need is when I run movement, in the middle of this movement I want to execute another file that is responsible for turning right for example. To sum up, I need to create executable files(each one is a different action) and play with them in a different way. Also, I should be able interrupt actions differently. I attached these .cpp files. Thanks a lot, Nurlan Mukanov -------------- next part -------------- A non-text attachment was scrubbed... Name: gripper.cpp Type: text/x-c++src Size: 2040 bytes Desc: not available Url : http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100414/dfecfe8b/attachment-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: move.cpp Type: text/x-c++src Size: 6101 bytes Desc: not available Url : http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100414/dfecfe8b/attachment-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: turn.cpp Type: text/x-c++src Size: 5356 bytes Desc: not available Url : http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100414/dfecfe8b/attachment-0005.bin From James.Neilan at tema.toyota.com Wed Apr 14 22:01:30 2010 From: James.Neilan at tema.toyota.com (James.Neilan at tema.toyota.com) Date: Wed, 14 Apr 2010 22:01:30 -0400 Subject: [Aria-users] James Neilan is out of the office. Message-ID: I will be out of the office starting 04/13/2010 and will not return until 04/19/2010. I will have access to email, however my responses will be in the evening. From Sanjin.Budak at fer.hr Fri Apr 16 15:43:53 2010 From: Sanjin.Budak at fer.hr (Sanjin Budak) Date: Fri, 16 Apr 2010 21:43:53 +0200 Subject: [Aria-users] Simulation with 2 lasers Message-ID: I'm working on a localization and mapping project. I would like to add a second laser to the (simulated) p3dx. When I change the MobileSim 'PioneerRobotModels.world.inc' to include another laser in the p3dx model, and run the simulator I can see it appearing in the 'View' dropdown menu but when I run Aria Demo and go into laser mode it just finds which ever laser was first defined in the MobileSim p3dx model ('PioneerRobotModels.world.inc'). I've also changed Aria's p3dx parameter file to include a second laser, but I'm not sure to which COM port to set it (maybe this could be part of the problem?) because there is no laser COM port setting in MobileSim or it's models file. I would appreciate any help. Sanjin Budak -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100416/40366970/attachment.html From reed at mobilerobots.com Fri Apr 16 16:14:29 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Fri, 16 Apr 2010 16:14:29 -0400 Subject: [Aria-users] Simulation with 2 lasers In-Reply-To: References: Message-ID: <4BC8C525.5090101@mobilerobots.com> Hi Sanjin. Unfortunately MobileSim can only simulate 2 lasers right now. While the simulated robot can have two lasers defined, MobileSim and ARIA only know how to use one simulated laser. We'd like to fix this at some point but I don't know when that will happen. If you are interested in adding support for more than one laser let me know and I'll be happy to help you understand where and how to modify MobileSim and ARIA. Reed Sanjin Budak wrote: > > I'm working on a localization and mapping project. I would like to add a > second laser to the (simulated) p3dx. When I change the MobileSim > 'PioneerRobotModels.world.inc' to include another laser in the p3dx > model, and run the simulator I can see it appearing in the 'View' > dropdown menu but when I run Aria Demo and go into laser mode it just > finds which ever laser was first defined in the MobileSim p3dx model > ('PioneerRobotModels.world.inc'). > I've also changed Aria's p3dx parameter file to include a second laser, > but I'm not sure to which COM port to set it (maybe this could be part > of the problem?) because there is no laser COM port setting in MobileSim > or it's models file. > > I would appreciate any help. > > Sanjin Budak > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 Apr 16 16:25:31 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Fri, 16 Apr 2010 16:25:31 -0400 Subject: [Aria-users] Simulation with 2 lasers In-Reply-To: <4BC8C525.5090101@mobilerobots.com> References: <4BC8C525.5090101@mobilerobots.com> Message-ID: <4BC8C7BB.50803@mobilerobots.com> Reed Hedges wrote: > Hi Sanjin. Unfortunately MobileSim can only simulate 2 lasers right now. I meant of course, it can only simulate 1 laser right now. From H.Miri at 2007.hull.ac.uk Fri Apr 16 17:38:27 2010 From: H.Miri at 2007.hull.ac.uk (Hossein Miri) Date: Fri, 16 Apr 2010 22:38:27 +0100 Subject: [Aria-users] Access violation reading location 0x0000000c References: <445800D8FD5D3D43878FD7D2842A3047D3D580@EXCL2VS2.adir.hull.ac.uk> <4BC62841.5010905@mobilerobots.com> Message-ID: <445800D8FD5D3D43878FD7D2842A3047D3D590@EXCL2VS2.adir.hull.ac.uk> I don't know exactly why this would happen, I don't know anything about the Prolog library, but it seems like the exception is occurring inside the call to PL_new_term_ref()? Can you see a stack trace if you run in the debugger? One thing I notice is that you don't seem to allocate any memory for the argv char* array. I would make argv a member of the class, and use new or malloc in the constructor and delete[] or free in the destructor; or make it a fixed size array (e.g. char* argv[1]). You might also want to make the destructor virtual, this is usually what you want in a class with virtual inheritance. ---------------------------------------------------------- Thanks Reed. That was actually quite a valid point. So I made it a fixed size array of characters. However, there is a problem. If I could ask you to take a look at the following *without* worrying about my Prolog terms: Here is my header file: #include stuff... class UserTaskProlog : public ArAction { public: AREXPORT UserTaskProlog( const char* name = "Prolog" ); AREXPORT virtual ~UserTaskProlog( ); AREXPORT virtual ArActionDesired *fire( ArActionDesired currentDesired ); protected: ArActionDesired myDesired; int aria_cycles; term_t t; }; And here is my main code: #include stuff... AREXPORT UserTaskProlog::UserTaskProlog( const char* name ) : ArAction( name, "Prolog" ) { char* argv[ 1 ]; argv[ 0 ] = "libpl.dll"; PL_initialise( 1, argv ); if ( !PL_initialise( 1, argv ) ) PL_halt( 1 ); PlCall( "consult( 'myPrologFile.pl' )" ); aria_cycles = 0; } AREXPORT UserTaskProlog::~UserTaskProlog( ) { } AREXPORT ArActionDesired *UserTaskProlog::fire( ArActionDesired currentDesired ) { double sonar_dist, angle; sonar_dist = ( myRobot->checkRangeDevicesCurrentPolar( -70, 70, &angle ) - myRobot->getRobotRadius( ) ); cout << sonar_dist << " " << angle << " "; aria_cycles++; cout << aria_cycles << endl; // t = PL_new_term_ref( ); return NULL; } int main( int argc, char** argv ) { Aria::init(); ArRobot robot; ArArgumentParser argParser( &argc, argv ); argParser.loadDefaultArguments( ); ArRobotConnector robotConnector( &argParser, &robot ); ArLaserConnector laserConnector( &argParser, &robot, &robotConnector ); argParser.addDefaultArgument( "-connectLaser" ); if( !robotConnector.connectRobot( ) ) { ArLog::log( ArLog::Terse, "Could not connect to Cerno... Exiting!" ); if( argParser.checkHelpAndWarnUnparsed( ) ) { Aria::logOptions( ); Aria::exit( 1 ); } } if ( !Aria::parseArgs( ) || !argParser.checkHelpAndWarnUnparsed( ) ) { Aria::logOptions( ); Aria::exit( 1 ); } ArKeyHandler keyHandler; Aria::setKeyHandler( &keyHandler ); robot.attachKeyHandler( &keyHandler ); ArSonarDevice sonar; ArBumpers bumpers; ArIRs ir; robot.addRangeDevice( &sonar ); robot.addRangeDevice( &bumpers ); robot.addRangeDevice( &ir ); if( !laserConnector.connectLasers( ) ) { ArLog::log( ArLog::Normal, "Warning: Unable to connect to requested lasers ... Will wander using robot sonar only." ); } UserTaskProlog talk; ArActionStallRecover recoverAct; ArActionBumpers bumpAct; ArActionAvoidFront avoidFrontNearAct( "Avoid Front Near", 225, 0 ); ArActionAvoidFront avoidFrontFarAct; ArActionConstantVelocity constantVelocityAct( "Constant Velocity", 400 ); robot.addAction( &talk, 100 ); robot.addAction( &recoverAct, 90 ); robot.addAction( &bumpAct, 70 ); robot.addAction( &avoidFrontNearAct, 50 ); robot.addAction( &avoidFrontFarAct, 30 ); robot.addAction( &constantVelocityAct, 20 ); robot.enableMotors( ); robot.runAsync( true ); robot.waitForRunExit( ); Aria::exit( 0 ); } The protected Prolog declation in my header file doesn't cause any problems. Also, with PL_new_term_ref commented out, I press F5 (in VS2008) and MobileSim runs smoothly, with aria_cycles printing out and incrementing. So it works and as my virtual P3DX goes around, increments and prints out the aria_cycles, showing that my Prolog action (talk) is implemented. But as soon as I uncomment PL_new_term_ref, I get that Access Violation error message. The reason I am asking this question here is because I believe this has nothing to do with my Prolog stuff. So I thought perhaps I am doing something C++/ARIA related that is causing the problem. I would be grateful if you would have a think about it. Many thanks Reed, ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100416/c05d88c1/attachment-0001.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100416/c05d88c1/attachment-0001.ksh From nmukanov at uwaterloo.ca Fri Apr 16 18:46:47 2010 From: nmukanov at uwaterloo.ca (Nurlan Mukanov) Date: Fri, 16 Apr 2010 18:46:47 -0400 Subject: [Aria-users] ArRobotPacketReceiver Message-ID: <20100416184647.12963soqy0k8jo4k@www.nexusmail.uwaterloo.ca> Hello, Reed. Could you take a look at another problem. After running my executable files like move or turn(I attached them in a previous message Robot does the action, but at the end of the program a line appears: "ArRobotPacketReceiver::receivePacket: bad packet, bad checksum" What does that mean and how can I fix it? Thanks, Nurlan. From Sanjin.Budak at fer.hr Fri Apr 16 19:20:37 2010 From: Sanjin.Budak at fer.hr (Sanjin Budak) Date: Sat, 17 Apr 2010 01:20:37 +0200 Subject: [Aria-users] Simulation with 2 lasers References: <4BC8C525.5090101@mobilerobots.com> Message-ID: Hello Reed! First of all I would like to thank you for replying so quickly. I am interested in adding support for more lasers, and would appreciate your help on the subject. Sanjin ________________________________________________________________________ ________________________________________________________________________ -----Original Message----- From: aria-users-bounces at lists.mobilerobots.com on behalf of Reed Hedges Sent: Fri 4/16/2010 10:14 PM To: Help,discussion and announcements for MobileRobots' Advanced Robot Interfacefor Applications (ARIA) Subject: Re: [Aria-users] Simulation with 2 lasers Hi Sanjin. Unfortunately MobileSim can only simulate 2 lasers right now. While the simulated robot can have two lasers defined, MobileSim and ARIA only know how to use one simulated laser. We'd like to fix this at some point but I don't know when that will happen. If you are interested in adding support for more than one laser let me know and I'll be happy to help you understand where and how to modify MobileSim and ARIA. Reed Sanjin Budak wrote: > > I'm working on a localization and mapping project. I would like to add a > second laser to the (simulated) p3dx. When I change the MobileSim > 'PioneerRobotModels.world.inc' to include another laser in the p3dx > model, and run the simulator I can see it appearing in the 'View' > dropdown menu but when I run Aria Demo and go into laser mode it just > finds which ever laser was first defined in the MobileSim p3dx model > ('PioneerRobotModels.world.inc'). > I've also changed Aria's p3dx parameter file to include a second laser, > but I'm not sure to which COM port to set it (maybe this could be part > of the problem?) because there is no laser COM port setting in MobileSim > or it's models file. > > I would appreciate any help. > > Sanjin Budak > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3922 bytes Desc: not available Url : http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100417/ed9bbb2c/attachment.bin From reed at mobilerobots.com Sun Apr 18 18:23:40 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Sun, 18 Apr 2010 18:23:40 -0400 Subject: [Aria-users] Access violation reading location 0x0000000c In-Reply-To: <445800D8FD5D3D43878FD7D2842A3047D3D590@EXCL2VS2.adir.hull.ac.uk> References: <445800D8FD5D3D43878FD7D2842A3047D3D580@EXCL2VS2.adir.hull.ac.uk> <4BC62841.5010905@mobilerobots.com> <445800D8FD5D3D43878FD7D2842A3047D3D590@EXCL2VS2.adir.hull.ac.uk> Message-ID: <4BCB866C.70104@mobilerobots.com> Since argv is declared inside the method, it should not be used outside of that method (it's on the program stack which is later reused for other function calls). However, my guess is that PL_new_term_ref() is trying to use it (PL_initialize() having stored the pointer to it somewhere in the prolog library). Try making it a class member variable instead. Reed Hossein Miri wrote: > I don't know exactly why this would happen, I don't know anything about the > Prolog library, but it seems like the exception is occurring inside the > call to > PL_new_term_ref()? Can you see a stack trace if you run in the debugger? > > > > One thing I notice is that you don't seem to allocate any memory for the > argv > char* array. I would make argv a member of the class, and use new or > malloc in > the constructor and delete[] or free in the destructor; or make it a > fixed size > array (e.g. char* argv[1]). > > > > You might also want to make the destructor virtual, this is usually what you > want in a class with virtual inheritance. > > > > ---------------------------------------------------------- > > > > Thanks Reed. That was actually quite a valid point. So I made it a > fixed size array of characters. However, there is a problem. If I > could ask you to take a look at the following *without* worrying about > my Prolog terms: > > > > Here is my header file: > > > > #include stuff... > > > > class UserTaskProlog : public ArAction > { > public: > AREXPORT UserTaskProlog( const char* name = "Prolog" ); > AREXPORT virtual ~UserTaskProlog( ); > AREXPORT virtual ArActionDesired *fire( ArActionDesired > currentDesired ); > > > > protected: > ArActionDesired myDesired; > int aria_cycles; > term_t t; > }; > > > > And here is my main code: > > > #include stuff... > > > > AREXPORT UserTaskProlog::UserTaskProlog( const char* name ) : > ArAction( name, "Prolog" ) > { > char* argv[ 1 ]; > argv[ 0 ] = "libpl.dll"; > PL_initialise( 1, argv ); > if ( !PL_initialise( 1, argv ) ) > PL_halt( 1 ); > PlCall( "consult( 'myPrologFile.pl' )" ); > aria_cycles = 0; > } > > > > AREXPORT UserTaskProlog::~UserTaskProlog( ) > { > } > > > > AREXPORT ArActionDesired *UserTaskProlog::fire( ArActionDesired > currentDesired ) > { > double sonar_dist, angle; > sonar_dist = ( myRobot->checkRangeDevicesCurrentPolar( -70, 70, > &angle ) - myRobot->getRobotRadius( ) ); > cout << sonar_dist << " " << angle << " "; > aria_cycles++; > cout << aria_cycles << endl; > // t = PL_new_term_ref( ); > return NULL; > } > > > > int main( int argc, char** argv ) > { > Aria::init(); > ArRobot robot; > ArArgumentParser argParser( &argc, argv ); > argParser.loadDefaultArguments( ); > ArRobotConnector robotConnector( &argParser, &robot ); > ArLaserConnector laserConnector( &argParser, &robot, > &robotConnector ); > argParser.addDefaultArgument( "-connectLaser" ); > > > > if( !robotConnector.connectRobot( ) ) > { > ArLog::log( ArLog::Terse, "Could not connect to Cerno... > Exiting!" ); > if( argParser.checkHelpAndWarnUnparsed( ) ) > { > Aria::logOptions( ); > Aria::exit( 1 ); > } > } > > > > if ( !Aria::parseArgs( ) || !argParser.checkHelpAndWarnUnparsed( ) ) > { > Aria::logOptions( ); > Aria::exit( 1 ); > } > > > > ArKeyHandler keyHandler; > Aria::setKeyHandler( &keyHandler ); > robot.attachKeyHandler( &keyHandler ); > ArSonarDevice sonar; > ArBumpers bumpers; > ArIRs ir; > robot.addRangeDevice( &sonar ); > robot.addRangeDevice( &bumpers ); > robot.addRangeDevice( &ir ); > > > > if( !laserConnector.connectLasers( ) ) > { > ArLog::log( ArLog::Normal, "Warning: Unable to connect to > requested lasers ... Will wander using robot sonar only." ); > } > > UserTaskProlog talk; > ArActionStallRecover recoverAct; > ArActionBumpers bumpAct; > ArActionAvoidFront avoidFrontNearAct( "Avoid Front Near", 225, 0 ); > ArActionAvoidFront avoidFrontFarAct; > ArActionConstantVelocity constantVelocityAct( "Constant > Velocity", 400 ); > > robot.addAction( &talk, 100 ); > robot.addAction( &recoverAct, 90 ); > robot.addAction( &bumpAct, 70 ); > robot.addAction( &avoidFrontNearAct, 50 ); > robot.addAction( &avoidFrontFarAct, 30 ); > robot.addAction( &constantVelocityAct, 20 ); > > robot.enableMotors( ); > robot.runAsync( true ); > > robot.waitForRunExit( ); > Aria::exit( 0 ); > } > > > > The protected Prolog declation in my header file doesn't cause any > problems. Also, with PL_new_term_ref commented out, I press F5 (in > VS2008) and MobileSim runs smoothly, with aria_cycles printing out and > incrementing. So it works and as my virtual P3DX goes around, > increments and prints out the aria_cycles, showing that my Prolog action > (talk) is implemented. But as soon as I uncomment PL_new_term_ref, I > get that Access Violation error message. The reason I am asking this > question here is because I believe this has nothing to do with my Prolog > stuff. So I thought perhaps I am doing something C++/ARIA related that > is causing the problem. I would be grateful if you would have a think > about it. Many thanks Reed, > > > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > ***************************************************************************************** > To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html > ***************************************************************************************** > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 H.Miri at 2007.hull.ac.uk Wed Apr 21 17:25:33 2010 From: H.Miri at 2007.hull.ac.uk (Hossein Miri) Date: Wed, 21 Apr 2010 22:25:33 +0100 Subject: [Aria-users] Access violation reading location 0x0000000c References: <445800D8FD5D3D43878FD7D2842A3047D3D580@EXCL2VS2.adir.hull.ac.uk> <4BC62841.5010905@mobilerobots.com> <445800D8FD5D3D43878FD7D2842A3047D3D590@EXCL2VS2.adir.hull.ac.uk> <4BCB866C.70104@mobilerobots.com> Message-ID: <445800D8FD5D3D43878FD7D2842A3047D3D59B@EXCL2VS2.adir.hull.ac.uk> -----Original Message----- Since argv is declared inside the method, it should not be used outside of that method (it's on the program stack which is later reused for other function calls). However, my guess is that PL_new_term_ref() is trying to use it (PL_initialize() having stored the pointer to it somewhere in the prolog library). Try making it a class member variable instead. Reed ----- Thanks Reed. That resolved a few things. I did, however, switched to a simpler UserTask class: class UserTaskProlog { public: UserTaskProlog( ArRobot* r ); ~UserTaskProlog( ); protected: int aria_cycles; char* argv[1]; ArRobot* robot; ArTime lastLogTime; ArFunctorC robotTaskFunc; void logTask( ); }; So far, so good, right? OK, now, my main: UserTaskProlog::UserTaskProlog(ArRobot* r) : robot(r), robotTaskFunc(this, &UserTaskProlog::logTask) { aria_cycles = 0; argv[0] = "libpl.dll"; PlEngine e(argv[0]); PlCall("consult('myPrologFile.pl')"); robot->addSensorInterpTask("UserTaskProlog", 50, &robotTaskFunc); } UserTaskProlog::~UserTaskProlog() { robot->remSensorInterpTask(&robotTaskFunc); } void UserTaskProlog::logTask() { if (lastLogTime.mSecSince() >= 1000) { aria_cycles++; cout << aria_cycles; lastLogTime.setToNow(); { PlFrame fr; PlTermv av(2); av[0] = PlCompound("john"); PlQuery q("likes", av); while (q.next_solution()) { cout << (char*)av[1] << endl; } } } } int main(int argc, char** argv) { Aria::init(); ArRobot robot; ArArgumentParser argParser(&argc, argv); argParser.loadDefaultArguments(); ArRobotConnector robotConnector(&argParser, &robot); ArLaserConnector laserConnector(&argParser, &robot, &robotConnector); argParser.addDefaultArgument("-connectLaser"); if(!robotConnector.connectRobot()) { ArLog::log(ArLog::Terse, "Could not connect to Cerno... Exiting!"); if(argParser.checkHelpAndWarnUnparsed()) { Aria::logOptions(); Aria::exit(1); } } if (!Aria::parseArgs() || !argParser.checkHelpAndWarnUnparsed()) { Aria::logOptions(); Aria::exit(1); } ArKeyHandler keyHandler; Aria::setKeyHandler(&keyHandler); robot.attachKeyHandler(&keyHandler); ArSonarDevice sonar; ArBumpers bumpers; ArIRs ir; robot.addRangeDevice(&sonar); robot.addRangeDevice(&bumpers); robot.addRangeDevice(&ir); ArActionStallRecover recoverAct; ArActionBumpers bumpAct; ArActionAvoidFront avoidFrontNearAct("Avoid Front Near", 225, 0); ArActionAvoidFront avoidFrontFarAct; ArActionConstantVelocity constantVelocityAct("Constant Velocity", 400); UserTaskProlog talk(&robot); robot.addAction(&recoverAct, 90); robot.addAction(&bumpAct, 70); robot.addAction(&avoidFrontNearAct, 50); robot.addAction(&avoidFrontFarAct, 30); robot.addAction(&constantVelocityAct, 20); robot.enableMotors(); robot.runAsync(true); robot.waitForRunExit(); Aria::exit(0); } As you can see, aria_cycles increments and prints out every second. I have also tried including other sonar readings etc... It shows that I have the structure right. But again as soon as I introduce this bulk: { PlFrame fr; PlTermv av(2); av[0] = PlCompound("john"); PlQuery q("likes", av); while (q.next_solution()) { cout << (char*)av[1] << endl; } } which simply consults my Prolog file and prints out the backtracking results of: likes(john, mary). likes(john, emma). likes(john, sara). I get that Unhandled Exception error message: Access Violation reading location 0x0000001c. Obviously, I am only asking you to kindly check my Aria program. I don't wanna annoy you with any of the Prology stuff! Any ideas, I would be grateful Reed. Thanks, . -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100421/efed262f/attachment-0001.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100421/efed262f/attachment-0001.ksh From James.Neilan at tema.toyota.com Wed Apr 21 22:01:27 2010 From: James.Neilan at tema.toyota.com (James.Neilan at tema.toyota.com) Date: Wed, 21 Apr 2010 22:01:27 -0400 Subject: [Aria-users] James Neilan is out of the office. Message-ID: I will be out of the office starting 04/20/2010 and will not return until 04/22/2010. I will have access to email, however my responses will be in the evening. From Sanjin.Budak at fer.hr Thu Apr 22 05:12:05 2010 From: Sanjin.Budak at fer.hr (Sanjin Budak) Date: Thu, 22 Apr 2010 11:12:05 +0200 Subject: [Aria-users] Simulation with 2 lasers References: <4BC8C525.5090101@mobilerobots.com> Message-ID: Hi Reed. Please help me understand where and how to modify MobileSim and ARIA, so the simulation can be done with 2 lasers. The physical robot which I will use to implement the SLAM algorithm will probably be equiped with one SICK, and one URG laser. But for the sake of simulation, I would be satisfied if both were SICK (presuming that it's to much trouble to implement the URG in MobileSim). Sanjin _______________________________________________________________________ _______________________________________________________________________ -----Original Message----- From: aria-users-bounces at lists.mobilerobots.com on behalf of Sanjin Budak Sent: Sat 4/17/2010 1:20 AM To: Help,discussion and announcements for MobileRobots' Advanced Robot Interfacefor Applications (ARIA) Subject: RE: [Aria-users] Simulation with 2 lasers Hello Reed! First of all I would like to thank you for replying so quickly. I am interested in adding support for more lasers, and would appreciate your help on the subject. Sanjin ________________________________________________________________________ ________________________________________________________________________ -----Original Message----- From: aria-users-bounces at lists.mobilerobots.com on behalf of Reed Hedges Sent: Fri 4/16/2010 10:14 PM To: Help,discussion and announcements for MobileRobots' Advanced Robot Interfacefor Applications (ARIA) Subject: Re: [Aria-users] Simulation with 2 lasers Hi Sanjin. Unfortunately MobileSim can only simulate 2 lasers right now. While the simulated robot can have two lasers defined, MobileSim and ARIA only know how to use one simulated laser. We'd like to fix this at some point but I don't know when that will happen. If you are interested in adding support for more than one laser let me know and I'll be happy to help you understand where and how to modify MobileSim and ARIA. Reed Sanjin Budak wrote: > > I'm working on a localization and mapping project. I would like to add a > second laser to the (simulated) p3dx. When I change the MobileSim > 'PioneerRobotModels.world.inc' to include another laser in the p3dx > model, and run the simulator I can see it appearing in the 'View' > dropdown menu but when I run Aria Demo and go into laser mode it just > finds which ever laser was first defined in the MobileSim p3dx model > ('PioneerRobotModels.world.inc'). > I've also changed Aria's p3dx parameter file to include a second laser, > but I'm not sure to which COM port to set it (maybe this could be part > of the problem?) because there is no laser COM port setting in MobileSim > or it's models file. > > I would appreciate any help. > > Sanjin Budak > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 4270 bytes Desc: not available Url : http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100422/1d773f70/attachment.bin From gabbo9lli at yahoo.it Thu Apr 22 08:44:41 2010 From: gabbo9lli at yahoo.it (gabbo9lli at yahoo.it) Date: Thu, 22 Apr 2010 14:44:41 +0200 Subject: [Aria-users] laser scanner driver... Message-ID: <4BD044B9.1030400@yahoo.it> hello. I'm trying to develop a driver for laser scanner S3xx, a safety laser scanner. I'm able to receive data from laser scanner via RS422, continuos data output. I develop this driver using Aria framework. I'm started from LMS1xx implementation. So my driver is public ArLaser. But, after some exchange of data, I have this error from gdb: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb6fdfb70 (LWP 10699)] 0x002b0480 in ArThread::getRunning() const () from /usr/lib/libAria.so any suggests? thanks. From lakamper at temple.edu Thu Apr 22 12:26:31 2010 From: lakamper at temple.edu (ROLF LAKAEMPER) Date: Thu, 22 Apr 2010 12:26:31 -0400 Subject: [Aria-users] windows7 64bit AriaJava.dll Message-ID: Hello! Did anyone compile the AriaJava.dll for 64bit wondows 7? The current 32 bit version (of course) won't run on W7-64. Thanks! Rolf From H.Miri at 2007.hull.ac.uk Sun Apr 25 06:38:46 2010 From: H.Miri at 2007.hull.ac.uk (Hossein Miri) Date: Sun, 25 Apr 2010 11:38:46 +0100 Subject: [Aria-users] User Task and Robot Cycle References: <445800D8FD5D3D43878FD7D2842A3047D3D59D@EXCL2VS2.adir.hull.ac.uk> <124896942887785489941015965146250901114-Webmail@me.com> <445800D8FD5D3D43878FD7D2842A3047D3D59E@EXCL2VS2.adir.hull.ac.uk> <107876329908976468816644366910327278763-Webmail@me.com> <445800D8FD5D3D43878FD7D2842A3047D3D5A0@EXCL2VS2.adir.hull.ac.uk> <44392488426611384748269493246868680692-Webmail@me.com> <445800D8FD5D3D43878FD7D2842A3047D3D5A1@EXCL2VS2.adir.hull.ac.uk> <13513333549283295862861358840198575188-Webmail@me.com> Message-ID: <445800D8FD5D3D43878FD7D2842A3047D3D5A2@EXCL2VS2.adir.hull.ac.uk> Hi everyone, I am connecting a cognitive architecture written in Prolog (as the deliberative layer) to a virtual P3DX in MobileSim (as the reactive layer) for which I have to interface Prolog and ARIA. I have used a simple User Task Cycle (similar to http://robots.mobilerobots.com/wiki/ARIA_Example:_Use_a_robot_task_to_log_or_print_robot_pose_or_other_information_periodically ) which works fine: It prints out robot's cycles and pose and whatever readings I want, every robot cycle or every second. I have dubbed the method Talk, as it will eventually facilitate the talking of Aria and Prolog. So far, so good... Here is my h file: class UserTask { public: UserTask(ArRobot* r); ~UserTask( ); void Talk( ); protected: int aria_cycles; ArRobot* robot; ArTime lastLogTime; ArFunctorC robotTaskFunc; }; And here is my cpp file: UserTask::UserTask(ArRobot* r) : robot(r), robotTaskFunc(this, &UserTask::Talk) { aria_cycles = 0; robot->addSensorInterpTask("UserTask", 50, &robotTaskFunc); } UserTask::~UserTask( ) { robot->remSensorInterpTask(&robotTaskFunc); } void UserTask::Talk( ) { if (lastLogTime.mSecSince( ) >= 1000) { aria_cycles++; cout << aria_cycles; cout << " X= " << robot->getX( ) << " Y= " << robot->getY( ) << " Th= " << robot->getTh( ); lastLogTime.setToNow( ); } } The problem is that, for some reason, it wouldn't let me include a Prolog call after printing out cycle and sonar info (before lastLogTime.setToNow). It would let me request any info on the robot such as sonar readings, and then print them out every second, but not a Prolog call. Don't be put off by the "Prolog" stuff. I have explained and outlined the problem very simply and neatly below, using an easy example: Suppose we have a little knowledge base: likes(john, sara). likes(john, emma). likes(john, ashley). The code snippet below opens a foreign frame and then backtracks over the possible solutions of our knowledge base. Meaning, if you stick this in VS2008 and configure it to use the Prolog libs and dlls, you will get: sara, emma, ashley! { PlFrame fr; PlTermv av(2); av[0] = "john"; PlQuery q("likes", av); while (q.next_solution( )) { cout << (char*)av[1] << endl; } } This uncomplicated piece of code works on its own, it works as a function call, it works when included in a class, etc... but for some reason, it would crash my void UserTask method (giving an Unhandled Exception error message 0xC0000005: Access violation reading location 0x0000000c). If you go back up ad check my code again, you will probably agree with me that the below should work fine: void UserTask::Talk() { if (lastLogTime.mSecSince() >= 1000) { aria_cycles++; cout << aria_cycles; cout << " X= " << robot->getX() << " Y= " << robot->getY() << " Th= " << robot->getTh(); { PlFrame fr; PlTermv av(2); av[0] = "john"; PlQuery q("likes", av); while (q.next_solution()) { cout << (char*)av[1] << endl; } } lastLogTime.setToNow(); } } All I am doing is to request another piece of information during the robot cycle (after getting X and Y and Th, and before lastLogTime.setToNow). It must be something that goes on inside the robot call back. Because it works as a simple function or a class method call, but not when I call UserTask talk(&robot) in my main program. You might be thinking: If it works fine in a simple loop or a class, why don't you call it that way then?! The answer is: I don't want to, because that wouldn't be of any use. I want it to talk to Prolog once every robot cycle, not for a pre-determined number of times. I want it to be incorporated into my robot call back so that as long as the MobileSim is running, I get my desired info every second. What is it about this Robot Synchronization Cycle or Robot Task Cycle that would let me include any info computation and displaying, but would not let me include this dead simple Prolog call? I would appreciate any hint or work-around. H . -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100425/4365e001/attachment-0001.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100425/4365e001/attachment-0001.ksh From reed at mobilerobots.com Mon Apr 26 08:30:14 2010 From: reed at mobilerobots.com (Reed Hedges) Date: Mon, 26 Apr 2010 08:30:14 -0400 Subject: [Aria-users] User Task layout In-Reply-To: <4BC6272A.2030300@mobilerobots.com> References: <445800D8FD5D3D43878FD7D2842A3047D3D588@EXCL2VS2.adir.hull.ac.uk> <4BC6272A.2030300@mobilerobots.com> Message-ID: <4BD58756.2020006@mobilerobots.com> One thing that may have an effect is that the robot task cycle runs in a separate thread than main() if you used robot.runAsync(). I have in the past encountered libraries that did not work right if used from different threads, even if not simultaneously (e.g. you initialize it in main() and use it from the robot thread) for some reason. I don't know if this is causing the problem but it is one difference between the plain Prolog test loop and using ARIA. You can use robot.run() to run in the main() thread, or you could move your Prolog code into the main function in a while loop as in your simplified Prolog example if you wanted to test this. (Also include a call to ArUtil::sleep() there as well.) From oussema.benneji.am at hotmail.fr Mon Apr 26 14:24:45 2010 From: oussema.benneji.am at hotmail.fr (Oussema Benneji) Date: Mon, 26 Apr 2010 19:24:45 +0100 Subject: [Aria-users] (no subject) Message-ID: Hello please may you send me some exemples of programing with aria for mobile robots Pionner 3AT thank you for your help _________________________________________________________________ Hotmail : une messagerie fiable avec la protection anti-spam performante de Microsoft https://signup.live.com/signup.aspx?id=60969 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mobilerobots.com/pipermail/aria-users/attachments/20100426/82f8e838/attachment.html From riccardo.cassinis at unibs.it Thu Apr 29 12:43:36 2010 From: riccardo.cassinis at unibs.it (Riccardo Cassinis) Date: Thu, 29 Apr 2010 18:43:36 +0200 Subject: [Aria-users] A question that probably has already been asked... In-Reply-To: <4BD58756.2020006@mobilerobots.com> References: <445800D8FD5D3D43878FD7D2842A3047D3D588@EXCL2VS2.adir.hull.ac.uk> <4BC6272A.2030300@mobilerobots.com> <4BD58756.2020006@mobilerobots.com> Message-ID: <4F85AAA7-F0F4-4B6E-A0D9-4E37AE83FB38@unibs.it> Is there any technical reason why URG lasers are only supported with SCIP 1.x or was it just a lack of time for developing the SCIP 2.0 interface? Thank you Riccardo -- Prof. Riccardo Cassinis Dept. of Electronics for Automation - University of Brescia Phone: (+39) 030 371 5453 Cell: (+39) 328 075 0952 Fax: (+39) 030 380014 Secr.: (+39) 030 371 5469 http://bsing.ing.unibs.it/~cassinis