Differences

This shows you the differences between two versions of the page.

Link to this comparison view

luabot [2009/03/04 14:11]
hadrien created
luabot [2009/03/24 18:05] (current)
hadrien
Line 54: Line 54:
 ===== Dynamic control ===== ===== Dynamic control =====
  
-Some specific ​functions ​are available, ​mostly related to an existing object. They propose control on objects.+Some specific ​methods ​are available, ​that propose control on objects. The methods are noted with their class names, you should use them on the object instead (e.g.
  
-  * ''​connect''​ has been seen previously, it does the connection of a signal HObject and a slot HObject for a given event name +  * ''​HObject:connect(string, HObject)''​ has been seen previously, it does the connection of a signal HObject and a slot HObject for a given event name; note that a global version of this function exists 
-  * ''​rotate''​ and ''​translate''​ are basic moves; they take a RobotMove as first argument, and an amount as second ​argument (rotate takes a rotation amount in degrees, translate takes a translation amount in mm) +  * ''​RobotMove:rotate(number)''​ and ''​RobotMove:translate(number)''​ are basic moves; they take an amount as argument (rotate takes a rotation amount in degrees, translate takes a translation amount in mm) 
-  * ''​move''​ is a free move; it takes a FreeMove first, then a translation speed and a rotation speed; note that in some cases you cannot have non-null translation and rotation +  * ''​FreeMove:move(number, number)''​ is a free move; it takes a translation speed and a rotation speed; note that in some cases you cannot have non-null translation and rotation 
-  * ''​goto''​ is a waypoint move; it takes a MovementPlanning first, then x and y coordinates +  * ''​MovementPlanning:​goto(int, int)''​ is a waypoint move; it takes a MovementPlanning first, then x and y coordinates 
-  * ''​scan''​ does a scan on a SensorControl ​given as first parameter +  * ''​SensorControl:​scan()''​ does a scan on a SensorControl 
-  * ''​launchDiscovery'' ​on a Discovery, ​with a limit parameter, starts a discovery loop +  * ''​Discovery:launchDiscovery(int)''​ with a limit parameter, starts a discovery loop 
-  * ''​padloop''​ starts a loop reading events on a gamepad; free move events are emitted when stick #1 is used; a "​sensor request"​ is emitted when any button is pressed; check that you have connected these events to a FreeMove and a SensorControl before starting padloop. +  * ''​PadCtl:​loop()''​ starts a loop reading events on a gamepad; free move events are emitted when stick #1 is used; a "​sensor request"​ is emitted when any button is pressed; check that you have connected these events to a FreeMove and a SensorControl before starting padloop. 
-  * ''​kbdloop''​ acts the same as padloop; free moves are commanded with i/k (forward, backward), j/l (turn left, turn right), v sends a sensor request, any other key send a stop free move. +  * ''​KbdCtl:​loop()''​ acts the same as padloop; free moves are commanded with i/k (forward, backward), j/l (turn left, turn right), v sends a sensor request, any other key send a stop free move
-  * ''​interactive''​ reads lua command on the standard input; you can call interactive at any point of the lua script, and stop the interpreter with ctrl+d + 
-  * ''​socketloop'' ​ takes a TCP port number as first parameter; it acts the same as ''​interactive'',​ except it listens to a TCP socket (localhost, given port number) for connections and lua commands; it notifies updates from the map given as second parameter to the client of the socket (with a message "MAP [URL]"​)+There are also global functions available:​ 
 + 
 +  * ''​connect(HObject,​ string, HObject)''​ behaves the same than the connect method, it connects two objects with an event (given in string)
 +  * ''​interactive()''​ reads lua command on the standard input; you can call interactive at any point of the lua script, and stop the interpreter with ctrl+d 
 +  * ''​socketloop(int)'' ​ takes a TCP port number as first parameter; it acts the same as ''​interactive'',​ except it listens to a TCP socket (localhost, given port number) for connections and lua commands; it notifies updates from the map given as second parameter to the client of the socket (with a message "MAP [URL]"​)
  
  
 
luabot.txt · Last modified: 2009/03/24 18:05 by hadrien
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS La rache Driven by DokuWiki