Re: Question regarding printing to terminal e.g. variable values etc.
"Rich Mattes" <[email protected]>
| Newsgroups | gmane.science.robotics.playerstage |
|---|---|
| Message-ID | <000f01cbb1ac$ded58ea0$9c80abe0$@com> |
> -----Original Message----- > From: Lana Eliason [mailto:[email protected]] > Sent: Tuesday, January 11, 2011 9:56 AM > To: [email protected] > Subject: Re: [Playerstage-developers] Question regarding printing to > terminal e.g. variable values etc. > > I apologise, I couldn't work out how to reply to the thread on > sourceforge so had to create a new one (If anyone could tell me how I > reply to threads, that'd be great). > I'm not sure how to do it from the sourceforge site, I think most of us subscribe to the mailing list and just reply via email messages. > Thank you so far Rich and Richard who helped on the previous thread. > > Rich: 'First off, are you trying to write a Player client to control > your > robots, or are you trying to write a Stage controller?' > > I don't completely understand the question but I think the former. > Basically I have a model of a UAV that I am trying to get to wander > around an environment (and also follow another wandering one). I am > coding it in emacs in c++ and then compiling it using 'g++ -o Brian > `pkg-config --cflags playerc++` Brian.cc `pkg-config --libs > playerc++`'. Then I use 'player sim.cfg' to run the simulation, and > click on the created file 'Brian' to start executing the code I have > compiled for my model robot. I don't know if that will help you. > So you're writing a Player client. This looks fine. Though, you'll have to add the -g flag to your call to g++ if you ever try to use gdb. > 'Also, are you getting any error messages or other output?' > > The code all compiles fine, there are no errors flagging up on either > the printf command (I have included all the necessary .h files as far > as I can see) in the terminal, or on any other line of code. All the > other code in the same function is executing fine - it loops through > and continues to execute all the other code, so the code isn't > erroring or halting. It just doesn't 'see' the printf line. I have > tried the fflush command also, but to no avail. > When you click on the program, does it open a new terminal and run? If not, can you try opening two terminal windows, running Player in the first one like you're currently doing, and running "./Brian" from the second one? When you write a Player client, output from the client won't go to the terminal that Player is running in. Client programs that come bundled with Player like playerv, playerprint, playerjoy, etc. all work the same way: you need to launch them in a second terminal to interact with them. > > Richard: I have also tried adding '\n' but that hasn't changed > anything either :( > > > If there is anything else anyone can suggest, I am currently grasping > at straws so any help would be great :) > > Thanks, > > Lana Rich ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl