lejos behaviour robot

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

lejos behaviour robot

Postby tamasu » Sat Jan 26, 2013 11:16 pm

Hi,

I am considering using behaviour control for my robot.

The robot is presently executed two simple behaviours, one to move forward and the other to take action when the ultrasonar detects an obstacle.

Since the avoid behaviour will suppress the forward behaviour I have set a loop while (!suppressed) so that the forward behaviour will stop when a suppresion signal is received.

Would you kindly confirm that since there are no more behaviours which can suppress the avoid, the action part of the avoid behaviour do not need to have the while loop.

Thanks
tamasu
New User
 
Posts: 7
Joined: Sun Nov 25, 2012 12:14 am

Re: lejos behaviour robot

Postby roger » Sun Jan 27, 2013 7:55 am

True, the behavior that has the highest priority will never respond to the suppress() method. If you are sure that you will never add a behavior of higher priority than avoid, there is no need to for its action method to test the suppressed flag. But you might want to code your robot to allow for future additional behaviors.
Roger
roger
Moderator
 
Posts: 308
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff