Re: Action to manually drive the robot ** Re: Keyboard input.

原创 2005年04月28日 09:47:00

Re: Action to manually drive the robot

You can just use ArActionKeydrive, it already does exactly these
things... ArKeyHandler does the keyboard input too, if you want to
just use that straight up or see how to do it... basically getc is a
blocking command or waits for enter or something along those
lines... so you have to do some termios stuff to set it up right in
Linux and check 'kbhit' in Windows.

You should upgrae to the latest version for this... I only put this in
in release like 1.0.2 or so.

Matt LaFary
ActivMedia Robotics

On Thu, Mar 21, 2002 at 12:23:50PM -0500, Laurel D. Riek wrote:
> Hi,
>          So, I wrote an action to manually drive the robot via the
> keyboard, using getchar. However,
> I noticed 1) there was a lot of lag, 2) my actions were not always
> immediately accepted by the program, and 3) the entire system would often
> lock up
>          Should this be a user task instead of an action? Is there
> something I should use instead of getchar?
> Thanks,
> Laurel

2 Re: Keyboard input.

If you set this up right you shouldn't have any problems... check out
the demo that comes with the latest ARIA, it'll control gripper,
camera, everthing (one mode at once though)... 

I'm taking a stab at how you're using things here... if this isn't how
you're using things then just describe how you're using them and we'll
sort it out.  Since you're using a user task I gather you're calling
getKey, which you're right in saying you shouldn't mix with an
ArActionKeyDrive...  The right way to do this is to give some functors
to the ArKeyHandler that is already set up by ArActionKeyDrive, or to
make a key handler and populate it with your own functors before you
addAction your keydrive action.  To add functors make or use an
existing key handler like so:

ArKeyHandler *keyHandler;
if ((keyHandler = Aria::getKeyHandler()) == NULL)
    keyHandler = new ArKeyHandler;
    if (myRobot != NULL)
      ArLog::log(ArLog::Terse, "ArMode: No robot to attach a keyHandler to");
keyHandler->addKeyHandler('z', someFunctor);

I have just modified the comments about getKey a little, so that if
the docs note its internal and what functions to use... I didn't make
getKeys protected because I can see cases where someone would want to
take care of the keyhandling and such themselves... but I added
comments (documentation) clarifying.

And again, if I described a method you aren't using and you are
already using this method describe in a little more detail what you're
doing and we'll sort out the trouble.

Matt LaFary
ActivMedia Robotics

PIC WARNING: Interrupts disabled during call to prevent re-entrancy

source: click here & here   The 'warning', about 'condition always true', is just that, a 'war...

5 Tips To Speed Up Linux Software Raid Rebuilding And Re-syncing

t is no secret that I am a pretty big fan of excellent Linux Software RAID. Creating, assembling ...

Error building Player: CommandInvokationFailure: Failed to re-package resources

在eclipse中接第三方sdk后再unity中报如下错误: Error building Player: CommandInvokationFailure: Failed to re-package...

Re-installation failed due to different application signatures.Please execute 'adb uninstall com.and

今天在运行androidSDK中提供samples例子时候,出现如下调试错误: 意思是说:你运行的该项目中存在不同的应用签名,即:该项目中存在两个或者两个以上的应用签名。 解决办法如下: 1.在键...

Re: How to use values of properties file in selenium code - msg#02103

Great points Mark, thanks. That will be a good reasoning of disadvantages to the approach. Also w...
  • aerchi
  • aerchi
  • 2012年10月18日 10:39
  • 1959

SQLiteHelper类||java.lang.IllegalStateException: attempt to re-open an already-closed object


Re-installation failed due to different application signatures 解决办法


So You’re Coming to a Career Fair

from: here chinese version: here I went to a career fair at Big Ivy University recently, a...
您举报文章:Re: Action to manually drive the robot ** Re: Keyboard input.