Home

MarXbot User Manual Version 1.1 - MOBOTS

image

Contents

1. Clear Figure 2 2 ASEBA Studio e rab2 Range and bearing module e led rgb Power RGB LED 2 3 Your First Scripts This section will provide you some basic examples for your first ASEBA scripts 2 3 1 Light On the RGB LED Select the led rgb tab and enter the following piece of code call led rgb 500 0 0 The compilation into bytecodes is done on the fly Now you just need to press the Load and Run buttons on your left The power RGB LED will turn red If you prefer green write instead call led rgb 0 500 0 Load run and the LED is now green This powerful LED turns out to heat quite a lot This is why a built in thermal protection has been added You can measure the LED s temperature by enabling the sensor 16 led temperature period 100 call led rgb 0 500 0 Load run and press the Refresh button You will see the measured value in the led temperature variable According to the documentation of Sec 6 2 8 the unit is 0 1 C If you increase the intensity or enable several colors at the same time you will see this value increasing each time you press the Refresh button 2 3 2 Your First Local Event Following up the first example we will slightly increase the complexity in order to make the LED blink at a frequency of 0 5 Hz using a local event Still using the led rgb tab copy the Listing 2 1 Declare variables var time 0 var state 0 var value Se
2. Start the RF network rf stop Stop the RF network Settings 0 77 Horizontal IR sensors first stage gain saturation values 8 15 Horizontal IR sensors second stage gain saturation values 16 23 Horizontal IR sensors third stage gain saturation values 24 71 Calibration values 72 The default RAB ID 73 The default network size 74 The default slot time 75 The RF frequency to use Hidden Variables rx dist mm The estimated source distance on each horizontal IR sensors in millimeters 46 6 2 12 Magnetic Gripper Main This section describes the Magnetic Gripper Main node of the Marxbot This node lies in the base of the general module called Magnetic Gripper It is bound with the Magnetic Gripper Front node which contains the gripper some sensors and the RFID tag system In the Magnetic Gripper Main node you will find three motors called mot_lift mot_rot and mot_tilt which are responsible respectively of the gripper lifting the turret rotation and the gripper tilting around its central axis The motors are controlled through the standard motor module see 6 2 3 Beside the motors this node has one strain gauge measuring the lateral bending of the arms Variables Most of this node s variables concern the motors For a description of each of these variable see 6 2 3 gauge_bend value This is the value read by the strain gauge measuring the lateral bending of the gripper s arms This value can give a re
3. 09 04 08 616 no_obstacle CIN gt Line 19 Col 1 Compilation success Clear Figure 2 3 ASEBA Studio during third example You can then catch those events from the led rgb node for example to light on the LED Copy the script of Listing 2 3 in the corresponding tab onevent obstacle call led rgb 300 0 0 onevent no_obstacle call led rgb 0 0 0 Listing 2 3 Third example proximity sensors rgb led node 18 2 4 Advanced Aseba Topics FIXME 2 5 Other Aseba Tools ASEBA is not limited to ASEBA Studio There are several other command line tools which can be useful in several situations We will give a brief summary in this section Please refer to the output of the help switch for detailed help on each command 2 5 1 Dashel Targets The following commands use so called dashel targets which are strings describing the interface to connect to They are to be written between quotation marks summary is given in Table 2 2 If you want to connect to several dashel targets at the same time you can separate them with with a white space like asebaswitch ser device dev ttyUSBO tcp 10 0 0 154 Table 2 2 Dashel targets Target type Dashel string Serial ser device dev ttyXX fc hard baud 921600 TCP IP cp 10 0 0 1XX port 33333 The IP can be replaced by localhost for example when connecting to asebaswitch or asebame
4. 1 5 3 SSH Session An SSH Secure Shell session will provide you with a remote console established through a secured tunnel Even if this security is not mandatory for common applications it is a well standardized way The following commands are given for a Linux or Mac OS host system On Windows you can use PuTTY as a graphical replacement Once the TCP IP link is established you can run a remote shell with the command ssh rootQmarxbot_ip It will ask you for the password which is empty just press the return key If you don t want to be asked for the password each time you can use public key authentication The public key is already registered on the robot you need to register the private key on your computer to be done at each boot The private key mobots ssh key is available on our website Run the command ssh add ssh mobots ssh key Copying files to the marXbot is easily achieved with the scp command scp path to file root marxbot ip optional path Don t forget the when specifying the remote target even if you omit the remote path otherwise it will get copied locally If you omit the path it will copy the file in the working directory of the user root in this case 1 6 Establishing a Console Session If no network is available for example when experimenting with the Linux kernel or updating the marXbot you will have to fall back on a console session You will need an
5. 2D force sensor base module RFID reader 3D accelerometer 3 axis gyroscope e 8 ground IR sensors e ring of 24 IR proximity sensors 4 ground sensors under the chassis between the tracks e treels a combination of tracks and wheels 38 Wh hot swappable battery Figure 1 1 Overview of the marXbot robot source 1 1 2 Electronics of the Modules The electronics of the modules is briefly described in Fig microcontrollers a complete marXbot having a total of 10 microcontrollers They are interconnected through a CAN bus An I2C bus also exists and is used by the i MX 31 to perform the power management tasks energy The CAN architecture is shown is Fig 1 3 a This is a decentralized network without any router The embedded computer is also connected to this CAN network through a CAN translator not pictured as the iMX31 has no built in CAN interface This embedded computer is connected to the outside world 1 2 Each module has up to 3 dsPIC33 Wifi speaker microphone 3 mp camera dsPIC33 RGB beacon Scanner rotating platform distance sensor rotation motor dsPIC33 induction induction nge and bearing emitters dsPIC33 receivers Gripper module rotating platform rotation motor dsPIC33 grip
6. ar9170 phy2 assoc Wi Fi dongle color ar9170 phy2 tx Wi Fi dongle color coreboard led 0 red running iMX processor board heart beat coreboard led 1 red iMX processor board coreboard led 2 red iMX processor board coreboard led 3 red iMX processor board coreboard led 4 red Front camera RGB gt R coreboard led 4 green Front camera RGB gt G coreboard led 4 blue Front camera RGB gt B coreboard led 5 red MX processor board RGB gt R coreboard led 5 green iMX processor board RGB gt G coreboard led 5 blue iMX processor board RGB gt B 3 3 Power Management You can read the battery voltage on the marXbot using the command adbus system ch epfl mobots power battery ch epfl mobots power battery GetVoltage 23 3 4 Accessing the Root Filesystem and Flash The files on the marXbot are stored either on the micro SD card root filesystem or in the embedded NOR memory Linux kernel The way to access those files is highly depend on the storage media 3 4 1 Micro SD memory The filesystem on the micro SD card can be easily accessed either through the network Sec 1 5 or directly by removing the SD card halt the robot before proceeding and combined with a card reader 3 4 2 NOR memory The embedded NOR memory has the following layout Table 3 3 Typical NOR layout may change Node Name Size kB Read only mtdblockO RedBoot 256 No mtdblock1 kernel 2048 No mtdblock2
7. First download the script located here http mobots epf1 ch mx31moboard create_sd sh Change the permissions to allow its execution This script assume that your SD card is already properly formatted Insert the SD card into your computer The following commands executed from the directory where you have downloaded create_sd sh will help you to download the latest available root filesystem The tarball must be renamed to img tar bz2 for the script to work wget http mobots epfl ch mx31moboard latest_rootfs wget i latest_rootfs FILE ls Angstrom mv FILE img tar bz2 install d mnt sudo create sd footbot MARXBOT NUMBER dev partition of the sd card replacing MARXBOT NUMBER by the two digits number of the marXbot yellow sticker and dev par tition_of the sd_card by the device of the SD card usually something like FIXME This will format the SD card copy the image and then do some configuration stuff A few important points e Keep the marXbot number correct This is important to keep track of each robot and to assign the correct IP address e You must use the first partition of the SD card like FIXME the SD cards on the robots are already correctly partitioned for this not the whole device FIXME Updating the Kernel To update the kernel boot it with e The new SD card e A charged battery e The Bluetooth module on the X11 connector see Sec 1 6 Plug the battery in the robot connect t
8. access to the camera using the Video4Linux2 API The documentation of this API is unfortunately quite messy The camera viewer application is a good start ask us for the source 3 1 4 Advanced As said earlier two connectors are available for connecting up to two cameras at the same time However there is only one acquisition bus shared between the two cameras Thus we strongly recommended to use only one camera at the same time With some tricks it is however possible to access both alternatively but this is strongly discouraged and won t be supported Now stop joking it is really really really discouraged To do so you will need to write your own acquisition program previous section in order to synchronize the operations Follow the following steps 1 Select the first camera 2 Wait at least 100 us Open and configure the node Select the other camera Wait at least 100 ps Close Open and configure the node with the same configuration D NI D Oo A Q Now you should be able to alternate the acquisition on both cameras by changing the GPIO and waiting between each acquisition Don t change the GPIO in the middle of an acquisition really 3 2 GPIOs and LEDs On the marXbot GPIOs General Purpose Input Output and LEDs are exported by the kernel This is a convenient way to interact with the hardware level 3 2 1 GPIOs GPIOs can be accessed on the marXbot through the sys class gpio ps
9. available which unit is the thenth milimeter Please refer to section 6 2 3 for detailed documentation of this module 37 Variables motor enc period The period in ms of the virtual encoder Maximum is 400ms 0 mean disabled motor enc delta pulse The number of motor pulse raw unit since the last virtual encoder event motor enc delta dist The traveled distance in mm since the last virtual encoder event ground period The update period of the ground sensors and the capacitor charge Maximum is 400ms minimum is 10ms O mean disabled ground corrected The calibration corrected value of the two ground sensors The calibration should produce a value of 1000 when the robot is on a white paper sheet ground ambiant The ambiant infrared value This value is read just before switching on the infrared LED of the sensor ground reflected The reflected infrared value This value is read 300us after the infrared LED of the sensor has been switched on ground delta This is strictly equal to ground reflected minus ground ambiant battery capacitor The charge voltage of the supercapacitors The unit is the mV timers period The period of six general purpose timers 0 mean disabled Maximum period is 400ms The timerX event expire each time the period timeout interaxis 1 The distance between the two wheel of the robot in To 0 mm Events motor enc timer This event is trigged each time the virtual encoder timer exp
10. awe ee much ed pu Jad Simple Update sesa eo ge ee ea ks AR oe AA au 30 2 The Hard Way 24 iau sa 0040 4e04R49 08 204 bo do BA al Introduction to iMX Programming Ad Ue SDK 22 en Ae RS AR oe H PRE SR SO OE a dar Mee e A BEE A Metal ta SDE s s i a hog dee ea Skee a a Be a ee ee Re eB es 41 2 Using the Toolchain i iii 404 4 api 244084440844 bu DE da de ee ae 42 Remote Debugging s za sa 44 oe es ins Seed ue ERA eee Control Architecture Aseba API Dll ACAMDELTION a saa ra amp 4 Se ee ae ead Be RNA M DER Boe a Los 6 2 ASEBA 6 3 1 6 2 2 6 2 3 6 2 4 6 2 5 6 2 6 6 2 7 6 2 8 Application Programmer Interface Inbroduetion a s se acm Se die da ie den Don A a a Visible and Hidden APT e de Sur 4 4a hi ae we BE iis idee CONVENTIONS s 2 2 a a dus Lab ee Abd o ee ate A Ra EE dus SEDDS Lie sent A ANUS Lo eee FERRER RAM Common APL eii s ema EN we M AS A dad aa iaa Variables sossa s doe toh eee SE LR A a ea Ra RAR es Hidden variables se 4 4 date ss medal Din a dede a aude EVENTS a CSN i NS rs A ir Does Natives Puncti ns sais de data da id A ed a 4 Hidden Natives Functions o s 4 4 s accoa a du LR 4 a da L abus das jo E ae LS bleed Be Bara Standard Motor Mod le saas 243328 an deb bare meta Se ERA RS Principle of Operation 2443 05 du ba ee D OU de amp 4 8 A Werte bles ss loe LL a a ee MEN SAME ee ape Be ane Hidden Variables s 5 34 s are Haute das eee Dake a
11. controller must be positive M pid kd_s The Kd term of the speed controller must be positive M pid _scaler_s The scaler term of the speed controller must be gt 0 M pid _speed_max_pulse The maximum speed in raw units This value is automatically overwritten each time M pid speed max is changed M pid _kp_p The Kp term of the position controller must be positive M pid _kd_p The Kd term of the position controller must be positive 33 M pid _scaler_p The scaler term of the position controller must be gt 0 M pid _target_position_pulse The target position in raw units M pid nominal current The nominal current of the motor in milliampere M pid _time_cst The thermal time constant of the motor in millisecond M pid _override Set to one allow the motor to exceed the software defined bounds M enc _pulse The motor s position in raw units M _raw_current The motor s current in raw units Events M pid timer This event is triggered at the end of execution of every speed controller Note Even if the motor controller is set to current mode the event will be triggered at the rate of the speed controller M overcurrent This event is triggered when the mean current of the motor is higher than its nominal current This implies that the maximum current of the motor is reduced to the nominal current of the motor M overcurrent cleared This event is triggered after M overcurrent when the mea
12. dongle In our group we use the Linksys E3000 dual band router with the 2 4GHz band disabled Table 1 3 WPA configuration SSID mobots Key type WPA PSK Key Ask us Please don t publish the WPA key as it would compromise the security of the entire EPFL network Thank you for your kind comprehension A Table 1 4 IP configuration Router IP 10 0 0 1 Mask 255 255 255 0 24 MarXbot IP range 10 0 0 100 199 DHCP range 10 0 0 200 249 13 Chapter 2 Introduction to Aseba Studio As you saw in the introduction the microcontrollers on the marXbot can load and execute ASEBA scripts It is really easy to get started you only need to install the tools on your computer and start playing The main page of the ASEBA project is hosted on our website at the address http mobots epf1 ch aseba html ASEBA is fully cross platform and has been tested on Windows Linux and MacOS This chapter is not about the ASEBA language Please refer to the introductory material available on the official website as well as to the APT documentation in Chap 6 An online documentation is also available in the Help menu of ASEBA Studio 2 1 Getting Aseba You first have to install ASEBA either by installing the binaries or compile the sources We recommend you to compile the sources downloaded from SVN so you will be able to keep the most up to date version 2 1 1 Getting the Binaries You can download Windows binaries on the ASEBA webs
13. gives you the orientation of the pin number 1 It should match the corresponding mark on the marXbot s side y C Be sure not to invert the orientation ys O O You first have to pair with the Bluetooth device before being able to use it hcitool scan resulting for example in Scanning 00 26 68 0C C2 6E Nokia 5000d 2 10 00 E8 6C F0 52 LSRO1_LMX9838_D001 00 21 AA 78 4C FB Nokia 6500s 1 08 00 17 2D 09 B2 e puck_0012 Copy the 12 digit in front of the device LSRO1_LMX9838_D001 in this example Then sudo rfcomm bind 0 10 00 E8 6C F0 52 Don t forget to replace 10 00 E8 6C F0 52 with your current device A new block device called dev rfcomm0 should appear Figure 1 6 Bluetooth dongle Enter the configuration screen of minicom exactly as for the FTDI dongle of the previous section but using the parameters of Table 1 2 Save the configuration under the name rfcomm0 for example You can then connect using minicom rfcomm0 The file is usually saved in etc minirc ftdi 12 Table 1 2 Minicom configuration for Bluetooth A Serial Device dev rfcomm0 E Bps Par Bits 115200 8N1 F Hardware Flow Control No G Software Flow Control No 1 7 Bonus 1 7 1 Configuration for the Mobots Network The mobots wireless network is using only the 5 GHz band to avoid the jam on the 2 4 GHz band So be sure to use an appropriate access point and Wi Fi
14. learn how to start with the marXbot Please read carefully what follows 1 4 1 1 10 11 12 1 4 2 2 3 4 5 6 7 8 9 Overview 10 11 12 13 14 15 Figure 1 4 Top view of the marXbot Power button LED MX reset button Mic 1 RTC backup battery CoreOn LED LED 0 3 red LED 5 RGB ISFC for iMX UART1 X11 MicroSD card Audio jack Translator reset button Selector SD card slot Power on 13 14 15 16 17 18 19 20 21 22 23 ISFC for translator X14 Translator status LEDs dsPICs reset button USB OTG device MarXbot ID tag Mxx Wi Fi dongle Upward camera Wi Fi status LED Mic 2 LED 4 RGB Front camera Insert the battery inside the base module with the contacts towards the back of the marXbot The power LED 1 and core LED 5 will turn on If nothing happens press for 1 second on the power button 1 Shortly after the heart beating LED 6 will start to blink After about 30 seconds the LEDs of the translator 14 will also turn on the marXbot is now ready to be used 1 43 Power off In order to power off the robot press for 1 second on the power button 1 or execute the poweroff command on the robot Wait until the robot shutdowns itself all LEDs turned off and then remove the battery Please don t let the battery inside the robot even if it is powered off O Always properly shutdown the robot Th
15. microphones is filled 48 Natives Functions rfid scan Start a RFID scan This will initiate a standard enumeration of all the RFID tags in close contact with the antenna A maximum of five tag will be discovered this should not be a problem as the antenna can power a maximum of 3 tags This native function will trigger the rfid scan_done event when the enumeration process is over rfid count n Get the number of RFID tags found by the last enumeration rfid result n id rssi block count Get the ID received signal strength indication block size and block count of the tag number N n Tag number Must be lt to the number returned by rfid count id The 64bits unique identifier of the tag rssi Received signal strength indication Minimum value 0 maximum value 31 block The tag block size in bytes count The tag block count r id read i b d failed Initiate a read operation of the EEPROM block b of the RFID tag with unique identifier i When finished the rfid read_done event is generated If failed is equal to 0 the data read are placed in the d If failed is nonzero the read has failed thus d is noninitialised Note The variables failed and d must not be touched between the call to rfid read and the rfid read_done event r id write i b d failed Initiate a write operation to the EEPROM block b of the RFID tag with unique identifier i When finished the rfid write done event is generated If failed is equal
16. node can be found in ASEBA Studio by showing the hidden variables 19 2 5 4 asebadump asebadump connected to an asebaswitch is used to dump all the data going on the ASEBA network Those data are output on the console using a raw format 2 5 5 asebarec asebaplay asebarec connected to an asebaswitch is used to record global events on the ASEBA network Those events are time stamped and are in a human readable format asebaplay is used to inject recorded events into the ASEBA network You can choose to play them faster than usual 2 5 6 asebaeventlogger asebaeventlogger is a Qt interface used to plot a specific event over time However this can be also achieved in ASEBA Studio so it s of little use 20 Chapter 3 Advanced Topics This chapter will cover more advanced usages like accessing the camera the LEDs or updating the robot 3 1 Using the Camera Up to two Aptina MT9T031 cameras can be mounted on the robot However only one acquisition bus is available on the current processor thus only one camera can be used at the same time This can be partly workarounded as we will see in Sec 3 1 4 The camera appears in Linux as a block device dev video0 Operations should be carried on this node 3 1 1 Selecting the Camera The selection between the two cameras is done by an external electronics activated by one of the GPIO General Purpose IO pin of the i MX processor This pin is available in user space and
17. power en Enable the RX power amplifiers Only impact infrared medium If RX is disabeld the node will not be able to sens the others robot position but will be able to communicate over the RF source The received s ID data The data payload of the received packet Only the first 13 bytes are valid little endian rangel The first stage amplifiers value on the IR sensors range2 The second stage amplifiers value on the IR sensors range3 The third stage amplifiers value on the IR sensors dist The estimated distance of the emiting robot Units are mm angle The estimated angle of the emiting robot Units are aseba angle see section 6 2 1 timers period The period of four general purpose timers 45 Events node new This event is emitted when a previously never seen node is emiting a packet See rf ev node_id network down This event is emitted when the RAB stop to emit because no answer has been received for a too long time See rf max_tx network start This event is emitted when the RAB is creating a new network node lost This event is emitted when a node which was previously emiting stopped emiting for more than 255 packets packet rx This event is emitted when a new packet is received on the RF packet tx This event is emitted when a new packet is transmitted on the RF timerX Thoses event are trigged each time the corresponding timer expire See the variables timers period Natives Functions r start
18. scan native function rfid read_ done This event is trigged when the read operation on a rfid tag is done The result of the scan is now available in the argument data passed to the rfid read native function rfid write done This event is trigged when the write operation on the rfid tag is done The status success failure is available in the failed argument passed to the rfid write native function Natives functions rfid scan Start a RFID scan This will initiate a standard enumeration of all the RFID tags in close contact with the antenna A maximum of five tag will be discovered this should not be a problem as the antenna can power a maximum of 3 tags This native function will trigger the rfid scan_done event when the enumeration process is over 36 rfid count n Get the number of RFID tags found by the last enumeration rfid result n id rssi block count Get the ID received signal strength indication block size and block count of the tag number N n Tag number Must be lt to the number returned by rfid count id The 64bits unique identifier of the tag rssi Received signal strength indication Minimum value 0 maximum value 31 block The tag block size in bytes count The tag block count rfid read i b d failed Initiate a read operation of the EEPROM block b of the RFID tag with unique identifier i When finished the rfid read_done event is generated If failed is equal to 0 the data read are placed in
19. the IR sensors ir reflected These 22 values give the reflected value measured by the IR sensors ir delta These 22 values give the difference between the ambiant and the reflected value of the IR sensors These are the value to be used to measure a distance This will not take account of the ambiant lightning as long as the sensor is not saturated led 0 led 1 These leds are not visible unless you unmount the robot They are used in debugging phases rfid enable This is a bool value enabling the rfid module 1 or disabling it 0 timers period 0 2 These are two timers that you can set to a different period The maximum period is 400 ms Events ir This event is emitted when the IR sensors are updated rfid scan_done This event is trigged when the scanning operation of the rfid chip is over You can check the result of scan with the rfid count native function See also the rfid scan native function rfid read_done This event is trigged when the read operation on a rfid tag is done The result of the scan is now available in the argument data passed to the rfid read native function rfid write_done This event is trigged when the write operation on the rfid tag is done The status success failure is available in the failed argument passed to the rfid write native function timer0 timeri These events are emitted when the timer 0 or 1 gives a clock count sound This event is emitted when the sound buffer of both
20. the d If failed is nonzero the read has failed thus d is noninitialised Note The variables failed and d must not be touched between the call to rfid read and the rfid read_done event rfid write i b d failed Initiate a write operation to the EEPROM block b of the RFID tag with unique identifier i When finished the rfid write_done event is generated If failed is equal to 0 the data has been succefully written If failed is nonzero the write operation has failed Note The variables failed and d must not be touched between the call to rfid write and the rfid write_done event Settings The settings number 0 to 18 are used by the standard motor module 19 20 Ground sensors calibration offset 21 22 Ground sensors calibration gain 23 Distance calibration value Number of motor pulse per straight 50cm displacement of the robot 24 Rotation calibration value Number of motor pulse per full trun over itself of the robot 25 27 Accelerometer offsets 6 2 5 Treel right This aseba node manage the following sensors and actuators e right treel e Two right side close range infrared ground sensors e Supercapacitor charge Due to some internal limitation the two infrared ground sensors and the capacitor charge voltage are bound to the same sampling speed This module embedd a standard motor module named motor The speed and distance unit is the motor pulse For a more convenient unit a special virtual encoder is
21. transfert to the sensors The natives functions sharp set_speed and sharp set_position already schedule a such transfert Settings 0 10 X calibration value for sensor 0 11 21 Y calibration value for sensor 0 22 32 X calibration value for sensor 1 33 43 Y calibration value for sensor 1 44 54 X calibration value for sensor 2 55 65 Y calibration value for sensor 2 66 76 X calibration value for sensor 3 TT 87 Y calibration value for sensor 3 Hidden Variables motor _command The raw value to send to the motor If position control is wanted the command should be computed as position 1 The position must be given in raw unit If speed control is required the command should be computed as speed 16384 The speed must be given in raw unit sharp led The led used for the scan for each sensor Each item in the array is a 8 bits number with the first nibble correspondig to the first led to use and the second to the second led The led are numeroted from 1 to 5 Use 0 to switch off one led The default value is 3 sharp raw position The position of the sensor in raw unit 41 6 2 8 Led rgb This aseba node manage the following sensors and actuators e One RGB 3W beacon LED e One LED s temperature sensor The temperature sensor is thermally coupled to the led If the temperature is above 80 C the led will switch off automatically and emit the led overheat event If will re
22. whole robot Such variables or natives functions are hidden by default in ASEBA Studiot These begin with a 66 or have _ in their names and will be displayed in gray in the rest of this manual Conventions Some natives functions and variables uses angles In ASEBA the angles are 16 bit integers where 32768 is equal to 7 0 is a null angle and 32767 is almost equal to 7 In the documentation of natives functions variables in capitals letters denote vectors while variables in minuscules denote scalars Variables in capitals letters with indices such as means for all in the range of indices of A 1Vou can change this by checking the Settings Show hidden variables and functions option 29 Settings A hidden functionality of ASEBA is the settings subsystem In almost every microcontrollers some calibration constants must be stored across powerdown These settings should not be modified without special care They are stored inside the flash of the microcontroller and thus only a limited number of write cycle is allowed 6 2 2 Common API Variables event source The ASEBA node identifier of the incoming event Only valid for external events If you write it you loose the identifier of the last received event event args The arguments of the incoming event Only valid for external events If you write it you loose the arguments of last received event Hidden variables _id The ASEBA node identifie
23. A node each microcontroller appears in a separate tab The full documentation for each node is available in Chap 6 For a full marXbot the following nodes are available e treel left Left wheel and corresponding sensors e treel right Right wheel and corresponding sensors e base sensors Range sensors in the base module sensor turret Rotating scanner module e gripper sensor Sensors for the gripper module gripper led Gripper s RGB LEDs and actuation 15 X Aseba Target Selec 2 y o x v Network TCP Host Port 10 0 0 122 33333 9 _ Serial _ Custom English x Y Connect Cancel L 4 Figure 2 1 ASEBA Studio connection screen h Untitled Aseba Studio File Edit Debug Tools Settings Help Load all Resetall Runall Pause all treel left treel right base sensors sensorturret gripper sensor griperled rab2 led rgb Constants t Execution unknown Load gt Run R a Nex Memory 9 refresh variables values A event source gt event args Events ear m ition motorpid target_current motorpid target_speed motorpid target_position motorenc period motor enc delta_pulse motorenc delta_dist sensors period gt ground delta imu enable o gt imu acc corrected gt imuacc raw gt imu gyro rfid enable o gt _timers period Native Functions gt math rfid Local Events Compilation success w
24. D bed Pe dia Fa bebe bee 23 1 Light On the RGB LED ae is cec cee ane a ea 2 RAR RED Ha GSE RO 23 2 Your First Local Event s 4 20 ah bee e eee are da aa 2 3 3 Your First Global Eyen oa a a doe Pe eee de A AN a nor a 24 Advanced ASEBA TOPICS nit dk BG kee aR ee RES a a a A lee 2 5 Other ASEBA Tools a 085 84 3 da eee ee Re bas a ae as al Dasbel Martel edi AR ee ee ee a Ge ds de 252 asebactid sa aer s 4 4 aa Due Soha eee eee ee 4 ee eS 20 3 as baswitel asebamiedulla id E a a ee A 2 04 o ec s a A H504 ped date bbe ba date men 2 0 0 asebaree asebaplay si A alah wd ea eee SS es seu 2 0 0 asebaeventlogger o con su su sua nes wee ba Se eee ee 3 Advanced Topics al Using the Camera ioe 64 4444 shee bee hed a ee eh de Rd ae hd be dhe zll Selecting the Camera 2 sa dan es sat nus A Re Ra PRR ee eS 3 12 Streaming Images 224 486 0644 dd oe A bas Sea eee ot gt MOOI Site a gt pe ok Botta aot eaters grag Ae ne gh aN Os AR oe dee ee ee tas SAY Advanced s sse ar bi ee be OEE EES Ow ES eee Bes 32 GPlOs and LEDS lt 4 e a eae Gb Se mea MEE See ES Aha REA Rae KS ol GPM a a oe te wt ee ta be ee AA A O22 LEDS Lee a oe oc RA Ne ra eae bath ne RD a oo Power Management sss 44 662 a GAGE Ee moe te ba he ee bw oe 3 4 Accessing the Root Filesystem and Flash 3441 Micro SD memory sisa emea dr dee e a n ho 242 NOR MEMO eca A e a A a ao Updating the Robot 24 4440 620444 oe Pe
25. FIS directory 124 Yes mtdblock3 RedBoot config 4 Yes Only the Linux kernel and the bootloader partition is writable The other partitions are forced to read only Please don t mess the bootloader partition a r wow 3 5 Updating the Robot YOO There are tons of ways to screw up the update So don t do it unless needed If you have any doubt or any potential misunderstanding please ask before performing the e Dr update 3 5 1 Simple Update If the robot has access to the Internet using the Wi Fi this simple update process is enough It will update everything including e The Linux distribution e The Linux kernel on the NOR e The firmware of the microcontrollers Using a remote console SSH or serial issue the commands opkg update opkg upgrade If you want to update the microcontrollers firmware first make sure the battery is not empty Then update robot 2Excepted the 2 microcontrollers without a bootloader see Sec 1 3 24 A DO NOT for ANY REASON kill this task or do ctrl c Gs 3 5 2 The Hard Way This way may be your only chance if the distribution on the robot is really old without the Wi Fi ci or if your SD card is corrupted Em AN 0 q Do this only only only if needed Ask us if you are unsure This can leave the robot A VAS unusable if you screw up the kernel and we will have to load a new kernel by hand ht Ann Updating the SD Card
26. MarXbot User Manual Version 1 1 Philippe R tornaz St phane Magnenat Florian Vaussard Mobots group LSRO EPFL December 12 2014 Contents 1 The MarXbot Robot ILL OWerview cio A be bee H dau A nat 1 2 Electr mies of the Modules 2 22 64 5 eter een Me be ee he sue AS Baden LS Sotware Description de ete ponte Ee a ade Bee e DRE la Basics cg cca ee Ba Less se pos eee a Ba Se eee GE ee hd oe oe Geta a LAU OVERVIEW o sr D ph a aaa et oe a eR ae bass 142 Power0m ceres aaa adas wh Pee Ree BA wa A LAS Poweriait Le 444 24 Buse AGE Ra REE wee EAN A ae EAA es 1 5 Establishing a TCP IP Connection Tad WEL Connection Luz wie oe Se Ae we She e RE a a e 152 USB Connection ii SA ache eee hate eee ee Rh bbe Awa aes Loa OH SESSION aa Ae Seeds ee a ae MANN be ee AA e 1 6 Establishing a Console Session 164A FID Module 1122 uds ee te ek ae has Ge Pew ee bad a Ba es 1 6 2 Bluetooth Module i 06 0604044 sa dam 6645 de de eee eee eS Ir BONUS a0 2 eeu eS een sa oe ie ae Bi ee Ree he REA eA Saut 1 7 1 Configuration for the Mobots Network 2 Introduction to Aseba Studio 21 Getting ASEBA us cardiac da ue Rd badd aa Hottes ZLI Getting the Binaries ouaa sgy anade o A he EE Rds 212 Compiling From Sources 4 0600 2 45 e eau ee ee 22 Ring A TBA QUO erriren aa a Sl a et OAS ee a Aa 23 Your First OCDE fa sati 44 4 4g 908 2 RE
27. dulla 2 5 2 asebacmd asebacmd is useful for sending commands over the ASEBA network Among the commands the most useful are summarized in Table 2 3 Table 2 3 Useful commands for asebacmd Command Usage presence Broadcast an identification request usermsg type length Send a global event on the network of ID type with length number of data For now the dumb data are 0 1 2 length 1 sb nodeid Reset the node with ID nodeid number 2 5 3 asebaswitch asebamedulla asebaswitch and asebamedulla are almost identical Both of them are used to connect several ASEBA components together like a control software a dump program and an ASEBA network This will be explained in greater details in Chap 5 asebaswitch supports all the dashel targets serial TCP Moreover asebamedulla can connect components using D Bus The only limitation is the ID of the nodes Each ID must be unique inside the same network This implies that two marXbots can t connect to the same ASEBA network as this would give rise to ID conflicts If you want to leverage D Bus using your own program and asebamedulla you can look at the example Python script located in the medulla folder The system bus is used on the marXbot while the session bus is used on a remote computer For both programs you can use the d v switches in order to display what is going on the network which can be quite useful for troubleshooting 4The ID of a
28. e file system is of type EXT2 and is thus A not journaled sudden power off could corrupt the file system leaving you with no A VO other chance than performing a e2fsck on the corrupted SD card Most of the time z A De it will be easier to write fresh root file system See Sec 3 5 2 Always remove the battery If you leave it inside some capacitors may get charged through pull up resistors possibly powering on the microcontrollers and making the robot to jump down your table like a Lemming would do You have been warned z l gt S 1 5 Establishing a TCP IP Connection The marXbot is a versatile platform and there are several ways to establish a connection 1 5 1 Wi Fi Connection By default the marXbot is configured to connect to the WPA secured mobots network using the embedded Wi Fi dongle This imply the availability of the corresponding access point The config uration is summarized in Sec 1 7 1 The configuration of the robot can of course be changed in etc network interfaces and etc wpa_supplicant Supposing that you have the access point the LED on the Wi Fi dongle will become blue when connected As the USB driver on the marXbot has some problems it may happen that the connection is not established properly even 1 or 2 minutes after booting In that case remove carefully the dongle 18 insert it again and wait If you are unlucky you will have to perform this 2 or 3 times As a last resort reboot
29. ecision A Bec Note An exception will be trigged if a division by zero occurs math atan2 A Y X Compute arctan E using the signs of Y and X to determine the quadrant of the output where A Y and X are three vectors of the same size Note X 0 and Y 0 will produce A 0 math sin A B Compute A sin B where A and B are two vectors of the same size math cos A B Compute A cos B where A and B are two vectors of the same size math rot2 A B angle Rotate the vector B by angle write result to Note and B must be two vectors of size 2 math sqrt A B Compute A VB where A and B are two vectors of the same size math nzseq a B m Write to a the middle index of the largest sequence of non zero elements from B 1 if not found or if the sequence is smaller than m Hidden Natives Functions _System reboot Hard reset the microcontroller immediately The microcontroller will execute the bootloader immediately after the reset _system settings read a v Read the setting number a and put its value in v _system settings write a v Write the setting number a with value v system settings flash Flash the settings inside the microcontroller s flash Warning This is really dangerous as the flash wears every time you write to it Settings There is no common settings 6 2 3 Standard Motor Module This is the interface used by most motors on the marXbot It compris
30. egration in mobile robotics a science to scale up machine intelligence PHD thesis Lausanne 2010 ol
31. emulated serial port This is the purpose of the ISFC for iMX31 X11 connector 7 on the marXbot Two modules have been developed The following instructions are only given for a Linux like operating system 1 6 1 FTDI Module This module Fig 1 5 allows you to establish a console session using a USB cable The white side on the small male connector gives you the orientation of the pin number 1 It should match the corresponding mark on the marXbot s side ES Dn 0 Be sure not to invert the orientation A Abus USS _ When plugged in you will see a new block device called dev ttyUSBx You can also refer to the output of the dmesg command for the exact name Figure 1 5 FTDI dongle We will use minicom as a serial terminal To enter the configuration screen only needed the first time issue Snttp mobots epf1 ch mx31moboard mobots ssh key 11 sudo minicom s and select Serial port setup Enter the setup given in Table 1 1 Table 1 1 Minicom configuration for USB A Serial Device dev ttyUSBO E Bps Par Bits 921600 8N1 F Hardware Flow Control Yes G Software Flow Control No Before exiting save the configuration as ftdi Launch again minicom this time using minicom ftdi and it should connect 1 6 2 Bluetooth Module This module Fig 1 6 offers you a wireless serial link The white side on the small male connector
32. es the set of variables events and natives functions which manage the PID controllers of the motors Each motor has his own name and there can be multiple motors on the same ASEBA node Thus the variables natives functions and event names are prefixed by the motor s name We will use the following name in this section M 31 Target Position PWM Current Position PD Speed PID Current PI Cm Position re sre Figure 6 1 Standard Motor Module PID architecture Principle of Operation The controller of the motor module is a triple PID controller nesting current speed and position sub controllers Thus there are one PID for setting the current to the motor one to set the speed and one to set the position as shown in Figure 6 1 This architecture is flexible as it allows to set limits on maximum current or maximum speed One can disable the position controller and directly feed the input of the speed controller to directly control the motor speed One can apply the same override to the current controller The following pseudocode shows the generic code of the PID controller The PD or PI controllers are architecturally similar with the corresponding term set to zero a t i t 1 e t 6 1 e t Kp i t Ki Kd e t e t 1 scaler output 6 2 Moreover the speed and position time constants are not in the same order of magnitude than the current ones Thus the current controller must run at a h
33. est version of the toolchain first download the manifest from our website wget http mobots epfl ch mx31moboard sdk latest_sdk and use the link provided in the file to download the SDK corresponding to the architecture of your development computer For example with a 64 bits computer wget http mobots epfl ch mx31moboard sdk angstrom 2010 4 test 20100608 x86_64 linux armv6 linux gnueabi toolchain mobots tar bz2 If you want to download the SDKs for all architectures wget i latest_sdk Once done you can install it on your development machine To install it just decompress the archive at the root of your computer sudo tar xjf toolchain tar bz2 C It will install its files in usr local angstrom arm You then need to source the environment setup script at startup for example from your bashrc in order to set a number of environment variables for the SDK to work To achieve this just execute once echo source usr local angstrom arm environment setup gt gt bashre 26 4 1 2 Using the Toolchain You can then invoke the cross GCC using the arm angstrom linux gnueabi prefix In order to make your life easier a CMake file is freely available at http mobots epf1l ch mx31moboard sdk moboard cmake It will set the necessary variables for a smooth compilation like this cmake DCMAKE_TOOLCHAIN FILE moboard cmake Once co
34. eudo nodes Table 3 1 shows available GPIOs and their usage An output GPIO can be put high with echo 1 gt sys class gpio value and put low with echo 0 gt sys class gpio value For input GPIOs you can read the value using cat sys class gpio value 22 Table 3 1 Available GPIOs Name Direction Function gpio21 Output Translator reset gpio22 Output dsPICs reset gpio28 Output Select the camera gpio40 Input Selector bit 0 gpio41 Input Selector bit 1 gpio42 Input Selector bit 2 gpio43 Input Selector bit 3 gpio87 Input Battery detection 3 2 2 LEDs LEDs can be accessed on the marXbot through the sys class leds pseudo nodes Table 3 2 shows available LEDs and their location For each node the actual brightness is retrieved with cat sys class leds brightness and the maximum brightness with cat sys class leds max_brightness while the brightness is set with echo brightness gt sys class leds brightness Replace brightness with the brightness you desire Triggers can also be set This way allows you to automatically turn on off the LEDs based on some system events A list of available triggers for each LED is obtained with cat sys class leds trigger and a trigger can be set for example heartbeat echo heartbeat gt sys class leds trigger Table 3 2 Available LEDs Name Location
35. everal layers Fig 1 3 b e A CAN bootloader is responsible for flashing the whole microcontroller if needed e The low level programming is done in C with some optimizations performed in assembler allowing good performances e The high level behavior is done in ASEBA leveraging the functions offered by the low level layer The ASEBA script runs inside a small virtual machine Each script is transferred through the CAN network and can be permanently written in Flash for persistency purpose desktop centralembedded microcontroller computer computer running Linux 1 t 1 i i 1 y i 1 1 re H TOP Medulla GAN microcontroller D Bus or TCP high level control i programs L microcontroller 1 1 i p optional optional robot a a typical ASEBA network in a robot microcontroller CAN communication virtual machine us ian aad us low level control actuators sensors b a microcontroller in an ASEBA network Figure 1 3 Architecture of the network a and microcontrollers b source 3 3In fact two microcontrollers don t have a bootloader and thus must be flashed using a Microchip ICD2 or ICD3 the internal translator UART CAN not shown on the computer module and the rotating dsPIC of the scanner module Same apply here 1 4 Basics Here you will
36. figure then e when errors are displayed You should then be able to enter the paths by pressing enter Typical paths are given in Table 2 1 adapt them to your configuration When done you can rerun the configuration by pressing c or executing cmake When the configuration succeeds compile as before cmake make Table 2 1 An example of CMake configuration for ASEBA CMAKE INSTALL _PREFIX usr local DASHEL INCLUDE DIR home vaussard svn dashel DASHEL LIBRARY home vaussard svn dashel libdashel a ENKI INCLUDE DIR home vaussard svn enki ENKILIBRARY home vaussard svn enki enki libenki a ENKI_VIEWER_LIBRARY home vaussard svn enki viewer libenkiviewer a QT QMAKE EXECUTABLE usr bin qmake qt4 QWT_INCLUDE_DIR usr include qwt QWT_LIBRARIES usr lib64 libqwt so SDLMAIN_LIBRARY usr lib64 SDL_INCLUDE_DIR usr include SDL SDL_LIBRARY usr lib64 libSDL so lpthread 2 2 Running Aseba Studio The first step is to establish a TCP IP network with the robot Follow the instructions given in Sec 1 5 either using Wi Fi or USB usbnet Go into the folder where you have compiled ASEBA and run the asebastudio executable studio asebastudio The connection screen of Fig 2 1 will show up Enter the corresponding IP address or hostname as described in the introduction Port should be 33333 If successful try to ping the robot otherwise the ASEBA Studio GUI will appear Fig 2 2 Each ASEB
37. gdb target remote marXbot_ip 5000 From this point you can use gdb as if you were debugging on your computer Please note that not all libraries have the debug symbols enabled 27 Chapter 5 Control Architecture Chapter 6 Aseba API 6 1 Calibration The marXbot should already be calibrated Any new marXbot must be calibrated prior to first use To do so use the relevant python script This script uses asebamedulla and thus depends on D Bus to run A recent Linux distribution should run D Bus by default The procedure to follow will be displayed by the python script Make sure to do the calibration in an environment without external infrared sources such as windows exposed to sun lamps etc 6 2 Aseba Application Programmer Interface 6 2 1 Introduction All the marXbot modules have common interfaces available on any module and some specific to each modules The specific interfaces will be discussed in each module s subsection Visible and Hidden API The API can be subdivided in two major parts Visible Part This subset of the API is safe to use Some range checking is done on the variables and natives functions It should not be possible to crash the microcontroller when using it Hidden Part This subset is unsafe to use blindly You must double check what you are doing gt E when using such variables or natives functions You can crash the microcontroller f burn it or damage the
38. he timer 0 1 or 2 gives a clock count Natives Functions The only three native functions of this node concern the reset of the motors encoder You can use them with call mot_lift enc reset call mot_rot enc reset or call mot_tilt enc reset These functions will set the encoders of the motors to 0 If you change the reference of the motors be careful not to go out of the borders the motors can reach This could destroy the gripper arms part 47 6 2 13 Magnetic Gripper Front This section describes the Magnetic Gripper Front node of the Marxbot This node lies in the gripper of the module called Magnetic Gripper It is bound with the Magnetic Gripper Main node In the Magnetic Gripper Front node you will find 22 TR sensors two leds not visible if the robot is mounted and an RFID scanner The IR sensors are splitted into four groups The first ones IR 0 9 are the frontal sensors The second ones IR 10 19 are the bottom ones The last two are the left and right sensor IR 20 and IR 21 The values of these sensors vary from 0 nothing is in front of the sensor and 4095 something is sticked to the sensor Variables ir period This is the period between two measurements of the IR sensors If set to 0 the sensors are deactivated If you want to use the microphones the variable ir period cannot be set to zero otherwise the microphone are not powered ir ambiant These 22 values give the ambiant value measured by
39. igher frequency than the speed and position controllers The current controller filters the current through an IIR filter with the same time constant as the motor thermal time constant This ensures that the current imposed to the motor is never higher than its nominal current Variables M pid current max The absolute value of the maximum current in the motor in milliampere If higher than the nominal current the controller will internally automatically reduce it to avoid overheating This allows to set the maximum torque of the motor M pid speed_max The maximum speed of the motor The unit depends on implementation Warning The maximum speed is not enforced if the controller is set in current mode M pid enable The selection of the controller O The controller is disabled the motor is short circuited 1 Only the current controller is enabled Use M pid target_current to set the target current 2 The speed control is enabled thus the speed and current controllers are enabled Use M pid target_speed to set the target speed 3 The position control is enabled thus the speed current and position controllers are enables Use M pid target position to set the target position M current The actual current in the motor in milliampere Only updated if the PID controller is enabled M speed The actual speed of the motor The unit depends on implementation Only updated if the PID controller is enabled 32 M position The actual
40. imately the ground 49 Tilt boundaries Lift boundaries Figure 6 2 The boundaries of the lifting and tilting motors 3 The robot will tilt its gripper around itself beyond the boundaries to detect the ground and to be able to set the tilting motor to its zero Once done the gripper returns to its new zero position 4 The lifting arms will go down again to adjust the ground detection When it detected the ground this time through the IR sensors the robot is stopped and the three motors are calibrated to their respective 0 The robot should lie on a flat obstacle less white surface during the calibration If during the phase 2 the robot doesn t stop lifting itself after a few second you should press on the dsPic Reset to stop the calibration process set the arms to a position included in the boundaries and restart the calibration process The lifting and tilting motors must be in a position included in the boundaries before initiating the calibration process If at the end of the phase 3 the gripper is not at its O position the calibration process must be stopped dsPic Reset and restarted This calibration process can be ineffective on a few robots it depends on the IR values and the motor current feedback which can change from one robot to an other If you prefer you can place the robot at the desired position yourself and the launch the three functions call mot_lift enc reset call mot_rot enc reset and call mot_ti
41. ion offset 24 47 Horizontal sensors calibration gain 48 Horizontal sensors clamp value 49 56 Vertical sensors calibration offset 57 64 Vertical sensors calibration gain 6 2 7 sensor turret This aseba node manage the following sensors and actuators e Two long range infrared sensors 20cm to 1 5m e Two short range infrared sensors Ocm to 30cm e Rotating motor The sampling rate of the sensors is fixed to 60Hz Variables sharp value The raw value from the sensors sharp dist The computed distance in mm sharp angle The position of the sensors in degree voltage The voltage of the secondary controller Events sharp updated New sensors values are available undervoltage The secondary controller experienced an undervoltage condition The sensors value can be degraded sharp disconnect The secondary controller had a communication or power failure thus disconnected the sensors You can restart it with sharp start 40 Natives functions sharp start Start to power the sensors You can call the sharp set speed sharp set_position or sharp send conf before powering up the sensor sharp stop Power down the sensors Call this when you don t need the sensors anymore as it consume quite a large amount of power about 2W sharp set_speed s Set the sensors rotating speed s in RPM sharp set_position p Set the sensors position p in degree sharp send_conf Force the configuration
42. ire See the variables motor enc for more informations ground _sensors updated This event is trigged each time new sensors values are available See the variables ground and battery capacitor timerX Thoses event are trigged each time the corresponding timer expire See the variables timers period Natives functions There is no native functions specific to this virtual machine Settings The settings number 0 to 18 are used by the standard motor module 19 20 Ground sensors calibration offset 38 21 22 Ground sensors calibration gain 23 Distance calibration value Number of motor pulse per straight 50cm displacement of the robot 24 Rotation calibration value Number of motor pulse per full trun over itself of the robot 6 2 6 Sensors This aseba node manage the following sensors e 24 horizontal infrared proximity bumpers e 8 vertical infrared sensors As the differents proximity sensors must be synchronized to ensure they don t interfer with each others they are bound to the same sampling rate Variables proximity ambiant The raw ambiant infrared value of the horizontal sensors The sensor number is counted clockwise starting from the front of the robot This value is read just before switching on the infrared LED of the sensor proximity reflected The raw reflected infrared value of the horizontal sensors proximity delta This is equal to proximity reflected minus proximity ambiant proximity co
43. is called gpio28 To select the upward camera 19 echo 0 gt sys class gpio gpio28 value If you prefer to use the frontward camera 23 echo 1 gt sys class gpio gpio28 value Never change this configuration while the node is opened Always close the port prior to any modifications In fact this could mislead the driver as both the cameras share the same bus You must also wait 100 us between a change on the GPIO and the opening of the node 3 1 2 Streaming Images Streaming images to your computer is the most straightforward operation First be sure gstreamer is installed on your computer This is easily achieved through the packager manager of your favorite Linux distribution Then on the robot launch camera viewer which is a custom software installed by default camera viewer qws display VNC 0 Then on your computer gst launch 0 10 tepclientsre host 10 0 0 1xx port 11111 jpegdec autovideosink Set the IP address to the one of your marXbot see Sec 1 5 You can also set the camera s parameters exposure and gain as camera viewer offers this facility by exporting a VNC remote desktop To access it use your favorite VNC client for example KRDC on KDE desktops using the IP of your marXbot 1 This is the default option 21 3 1 3 Coding If you wish to access the camera directly the best way is to process the images on the iMX Any program can get
44. it is zero The code is rather self explaining with the help of the API documentation of Chap 6 The sensors are refreshed every 100 ms and the update function tests each sensor for a value greater than THRESHOLD If such a case exists the global event obstacle is emitted 17 You can already play with this part Load and execute the script You will see fired events in the log window on the bottom right corner each time you approach your hand from the base sensors obstacle events and when you go back no_obstacle events var i var nb_obstacles sensors period 100 sensors updated at 10 Hz onevent sensors updated nb_obstacles 0 for i in 0 23 do if proximity corrected i gt THRESHOLD then nb_obstacles nb_obstacles 1 end end if nb_obstacles gt 0 then emit obstacle end when nb_obstacles 0 do emit no_obstacle end Listing 2 2 Third example proximity sensors base sensors node grippersensor griper led rab2 led rgb Constants var i THRESHOLD var nb_obstacles 2 sensors period 100 onevent sensors updated nb_obstacles 0 for 1 in 0 23 do if proximity corrected i gt THRESHOLD then nb_obstacles nb_obstacles 1 end end if nb_obstacles gt then emit obstacle end when nb_obstacles 0 do emit no_obstacle Events j end obstacle no_obstacle e 09 04 07 426 obstacle 07 o obstacle 09 04 08 416 obstacle obstacle
45. ite http mobots epfl ch aseba html Binaries for Linux deb packages are also available but are unfortunately outdated We will try to add more binaries and keep them up to date but without any warrantee 2 1 2 Compiling From Sources The best solution is to build from sources This is easily achieved thanks to CMake You will need to install at least e cmake e ccmake The SVN repository of ASEBA is hosted on gna ASEBA also depends on a number of other libraries e Dashel e Enki e Qt4 e Boost e Qwt e SDL Dependencies other than enki and dashel should be available through the package manager of your favorite distribution Take care to install the devel packages also For example on Fedora 14 Thttp gna org projects aseba 2SVN repository http gna org projects dashel 3SVN repository http gna org projects enki 14 sudo yum install qt devel boost devel qwt devel SDL devel Dashel and enki are to be download on gna using SVN and compiled using CMake should be easy if other dependencies are correctly installed cmake make sudo make install optional The last step is to compile ASEBA The only tricky step is to correctly setup the path to the dependencies Most of them should be automatically detected but you will have to specify by hand the ones for dashel and enki if not installed To configure the paths run ccmake If the cache is empty press c to con
46. lt enc reset which will set the motors encoders to 0 the zero posi tion is when the turret is aligned with the treels and when the gripper lies on the floor with the magnetic gripper at 0 as on 6 2 The three motors are reversible which means that you can move them by hand But be careful sometimes the mechanical links between the motor and the part you want to move can be a bit stiff The easiest method to place the motor where you want by hand is to set the vari ables mot_lift pid enable mot_tilt pid enable and mot_rot pid enable to 1 and then to set mot_1ift pid target_current mot_tilt pid target_current and mot _rot pid target_current to 0 This means that the motors aimed current is 0 When you will try to move one of these motors it will generate a current Then the motor will try to cancel this induced current by powering the motor in the direction you are pushing In the end the motor will help you move itself and the possible stiffness will disappear 50 Bibliography 1 M Bonani V Longchamp S Magnenat P R tornaz D Burnier G Roulet F Vaussard H Bleuler and F Mondada The marXbot a miniature mobile robot opening new perspectives for the collective robotic research In Intelligent Robots and Systems IROS 2010 IEEE RSJ International Conference on pages 4187 4193 IEEE 2 Michael Bonani Robotique collective et auto assemblage PhD thesis Lausanne 2010 3 St phane Magnenat Software int
47. mon laser range scanners using 4 infrared rangers 2 short range 2 long range It generates 480 points per second at a rotation frequency of 1 to 2 Hz Main computer with front camera The main computer is a Freescale i MX31 processor ARM 11 533 MHz 128 MB RAM running a lightweight Linux distribution no graphic desktop A 3 megapixels camera can be mounted onto the board in two different orientations either upward or frontward Optional Upward camera and beacon LED This module provides another 3 megapixels camera and a powerful RGB LED with built in thermal protection This camera is mainly used as an omnidirectional one Ihttp mobots epf1 ch 2http 1sro epfl ch marXbot 217x29cm 1 8kg i main computer ARM 11 processor 533 MHz 128 MB RAM e Linux based operating system Bluetooth Wifi SD card e omnidirectional camera 3 megapixels hyperbolic mirror e front camera 3 megapixels 3 5 W RGB beacon LED rotating scanner 2x2 long range triangulating IR distance sensors e range 4 to 150cm 1 to 2 scans s angular resolution 3 at 1 scan s 6 at 2 scans s range and bearing module e detect robots up to 5m e get range and bearing of peers 2 4GHz chip for synchronization infrared for range and bearing attachment module e attachment device based on three fingers e attachment point rotates around the robot e attachment ring with 12 RGB LEDS
48. mpiled simply copy the binary to the target and run it 4 2 Remote Debugging The toolchain includes gdb called arm angstrom linux gnueabi gdb and it can be used to debug programs running on the marXbot from your computer To achieve this we use remote cross target debugging with gdbserver First you need to compile your program with the debug option g with gcc so that it contains the debug symbols With CMake you need to add the DCMAKE BUILD_TYPE Debug option If we go back to the above command it becomes cmake DCMAKE_BUILD_TYPE Debug DCMAKE_TOOLCHAIN _FILE moboard cmake On the marXbot run your program with gdbserver and the port the server is going to listen to for the TCP connection gdbserver 5000 yourprogram On your computer just start your program with the toolchain s debugger arm angstrom linux gnueabi gdb If gdb complains about not being able to load libexpat so 0 just create a link usr lib libexpat so 0 to usr lib libexpat so First you need to tell gdb where the libraries are on your computer Here is the default SDK install path gdb set solib search path usr local angstrom arm arm angstrom linux gnueabi Then tell gdb to read the symbols from your debug enabled program gdb symbol file yourpgram Then you just need to issue the target command in gdb on your computer so that it connects to the gdbserver on the robot
49. n current of the motor is back lower than 90 of the nominal current Natives Functions There is no native function for the Standard Motor Module Settings You should not alter the settings unless you know what you are doing All the position are relative to the start of the Standard Motor Module section 0 Kp of the current controller E Ki of the current controller Scaler of the current controller Prescaler of the speed and position period Kp of the speed controller Kd of the speed controller Ki of the speed controller Scaler of the speed controller Maximum current allowed in the motor in milliampere wana a A N Nominal current of the motor in milliampere ei Motor s heating time constant in millisecond 34 11 Maximum speed allowed unit is implementation dependant 12 Kp of the position controller 13 Kd of the position controller 14 Scaler of the position controller 15 Period of the current controller in millisecond 16 Raw offset of the current 17 Software maximum bound on position 18 Software minimum bound on position If the maximum and minimum positions are equals the software end stops are disabled 6 2 4 Treel left This aseba node manage the following sensors and actuators Left treel Two left side close range infrared ground sensors e Three axis accelerometer e Three axis gyroscope e 15 56Mhz ISO 15693 RFID host Due to some internal limitatio
50. n the two infrared ground sensors the gyroscope and the accelerometer are bound to the same sampling speed This module embedd a standard motor module named motor The speed and distance unit is the motor pulse For a more convenient unit a special virtual encoder is available which unit is the thenth milimeter Please refer to section 6 2 3 for detailed documentation of this module Variables motor enc period The period in ms of the virtual encoder Maximum is 400ms 0 mean disabled motor enc delta pulse The number of motor pulse raw unit since the last virtual encoder event motor enc delta dist The traveled distance in mm since the last virtual encoder event sensors period The update period of the ground and imu sensors Maximum is 400ms minimum is 10ms 0 mean disabled ground corrected The calibration corrected value of the two ground sensors The calibration should produce a value of 1000 when the robot is on a white paper sheet ground ambiant The ambiant infrared value This value is read just before switching on the infrared LED of the sensor ground reflected The reflected infrared value This value is read 300us after the infrared LED of the sensor has been switched on 2Wheel and track 35 ground delta This is strictly equal to ground reflected minus ground ambiant imu enable 0 mean accelerometer and gyroscope are powered off Write 1 to power them on imu acc corrected The three acceler
51. ne oe aL aed 42 Hidden Variables s 43 4 6 46 24 44 4 So bd 4 aa ad Se a 42 PPOO e e o ae a oy ee A 42 Variables 44642 iaa RUN a A di ee o hae haha 43 o A O On A eae ek 43 Natives PUNTO coco SN ER a A a E eee 43 SOES e o A A A PAR RES me 43 Hidden Variables s s Le da da a a a RER met 43 Hidden Natives Functions 4 coc s ok aaa e dun ce Rae ad 44 TEA DIS ILES aa e ma RE eye Eon a a EE ne ke ee ah Pa wf Odes 44 Valla bles 4x os MA Chala Gone ak SAS Ae ee a RUE de La A E 44 EVENS ss ae he gs Re ek A ee a ee deh em eK aR ick ao ae RR he 44 Natives Functions ii 524 4 sca a poa de 4 dau ewe hab ee Ba aus 44 o de Eka ans te oe ek eee oe Gg AN 44 ADD ois he a a Sete AA ee de E A 44 Variables eei 44 da id a AM a ma SP a bus RO a 4 Bees 45 EVENTS 4 Hu sus de ss we a a GS Eee A od he ed a dde ee ed 46 Natives Functions s acia oie hls a amp hoe AA ws aa GO a 46 SETE boo Gane be ea oe a ie ew Us ds ee AA a 46 Hidden Variables 4 4 208402 fe ce separada re De 46 Masnetie Gripper Mala osa e ae ee a ka gode Be RAR ES qu 47 Na sure idi au ee ai NE aa at aa eme Dada 47 VEN S ss LE Se a LE AMAR A Se Save apd Da Raid Lee HAS Lu 47 Natives Functions crespo a ue 46 is ae da Ale 47 Mapnetic Gripper Front s s s sos d a pren A RE de dot BA a ee 48 Variables a Le ba pus al ha e d a Hat ds 48 ENERO aaa Ge OS Se Ge dete es ei Ta leo Det a AN ai 48 Natives FUNCIONS s Le bow set a wee a ee ee oe Be B
52. o the Bluetooth and wait until the robot displays the login prompt it can take some time for the first boot Log in as root empty password and do cat boot zImage gt dev mtdblock1 When the command is done it will take some time writing inside the NOR memory is slow reboot reboot It should now be able to connect to the Wi Fi or usbnet If it does not connect to the Wi Fi reboot until it succeeds wait at least 1 minute after each boot to wait for the connection Now you can proceed with the regular update process as explained in Sec 3 5 1 chmod x create_sd sh 25 Chapter 4 Introduction to MX Programming Programs can be developed for the embedded computer This allows you for example to FIXME However this embedded processor is based on an ARM architecture implying the use of a cross compiler to generate the binaries This part can only be performed on a Linux host system as the SDK is not available for other operating systems 4 1 The SDK The SDK includes several pieces of software so you can develop investigate and debug programs running on the ARM processor This includes e The cross gcc toolsuite arm angstrom linux gnueabi gcc and so on e The CMake and Qt tools cmake qmake e Cross compiled standard libraries 1ibc libstdc e Other cross compiled libraries you will need to link most of the programs we provide 4 1 1 Installing the SDK To find out the lat
53. ometer axis in X Y and Z order without offset The unit is 993 code g The range is 1 59 imu acc raw The three accelerometer axis in X Y and Z order without offset cancelation The unit is the same as imu acc corrected imu gyro The three gyroscrope axis Thoses value have an offset which change with temperature The drift become noticeable after about 2 5 minutes The unit is 31 2 code The manufacturer of the gyroscope give a 50 100 tolerance on the scale factor rfid enable 0 mean the rfid chip is powered down Write 1 to power it up You must power up the rfid chip before using any of the rfid native functions timers period The period of four general purpose timers 0 mean disabled Maximum period is 400ms The timerX event expire each time the period timeout interaxis 1 The distance between the two wheel of the robot in 30 0 mm Events motor enc timer This event is trigged each time the virtual encoder timer expire See the variables motor enc for more informations sensors updated This event is trigged each time new sensors values are available See the variables sensors period ground imu gyro and imu acc timerX Thoses event are trigged each time the corresponding timer expire See the variables timers period rfid scan done This event is trigged when the scanning operation of the rfid chip is over You can check the result of scan with the rfid count native function See also the rfid
54. pe eA Dada V NUS a a a MEL ee ee AS US SN ad a A A Ras Hal NativesiBunchons Los Li TN ARS ak ee D A a ins da SOUL sc AAA AAA AA OAR A Treekleft c coti Doi don dha sas ainia Cee ad ai den Variables 2 4 pus didas cs ad a has DR BG aus SVMS ss io cal DE Vo o De we LUE SRE ES a SA a LS Es Natives fUnCtionS ora a Le AM MEME RE L a ie o ae E e 5 DR du der eme NN Wreelbright 65 4 Le La Baie betwee bee ORE do dci EAA Bays Variables ia de ALA a a 4 wh a ae ee LA ag EA di EVENTS o saciar Pee ROR ER ae A ee bus 4 aed Natives functions 44 ransa a Fe ge Reo ae RR ae RE eA me d De o AI BONSOES cach ae e de ee a la DE e Ae a OR HR 4 nanas Warsi ua e E LR wre ate RAR wed ate DE AA sa NOR hee eh de oe ones aes se Retails a ne teen UE ne A Natives MUNGtIONS 2 2 hee he Be a Re EN e Sc om ee a ce o 24 fed hoa hs oe a eae eR a eek D a dote SENSO GULO eae a Ale we SEE owe Len gw Boe Ae es eee ot HA Ae eed Vanabl ios ea MACE wo AO eS adm ORS ke eee a EVENS e ec We ae oes aks Bok ave Gr oy ete Pere nae ack ean ee a a gs OS es see nee ees Ree SS ay hea Natives MUMChIONS e 2 LL La NU ab ha de de a e ee eB a DOUES c des n mana ses SAMU oie we fe hee BR asus Hidden Variables sz i dela dos a ca ett woe UE ee ep Ms de AA nan E A RN E A E SN 6 2 9 6 2 10 6 2 11 6 2 12 6 2 13 6 2 14 Natives Fun tions iio dE da deb ee gun A A de a 42 a ee ot A dede a A De ew ee Be
55. ping motor traction sensor dsPIC33 light ring Base module IMU RFID left treel ground sensor below dsPIC33 right treel ground sensor below 2x 2x 2x proximity sensor dsPIC33 ground sensor around 24x Battery pack 8x protection circuit LiPoly batteries Auxiliary power storage for battery hot swap Figure 1 2 Overview of the electronics source 1 using a TCP IP socket operating either over Wi Fi or USB usbnet 1 3 Software Description The great challenge in the marXbot is to manage the programs distributed between the 10 microcontrollers and the main CPU Flashing all those units by hand would be untenable This is why we take here advantage of the CAN bus in order to flash remotely the microcontrollers For this reason the robot can t be operated without the computer module This could be feasible but solder jumps have to be soldered on the base module in this case Ask the Mobots group for this modification data CAN Moreover managing such a network only with low level programming in C would be hard for the end user This assessment gave birth to ASEBA a high level event based scripting language ASEBA scripting is only available on the microcontrollers Thus the program inside each microcontroller is structured in s
56. position of the motor The unit depends on implementation Only updated if the PID controller is enabled M pid target_current The target current of the current controller in milliampere M pid target_speed The target speed of the speed controller The unit depends on implementation M pid target position The target position of the speed controller The unit depends on implementation Hidden Variables You should not need to read nor to write these varibles in the basic Standard Motor Module use case M pid period The period in millisecond of the current controller If positive and M pid enable is 1 2 or 3 the PID is executing If negative the PID is not executing and M pwm is directly applied without any safeguard on the motor The M pid timer event is generated at the specified period absolute value The maximum period is 400 ms M pid _kp_i The Kp term of the current controller must be positive M pid ki_i The Ki term of the current controller must be positive M pid _scaler_i The scaler term of the current controller must be gt 0 M pwm The PWM applied to the motor M pid prescaler_s The period multiplier of the speed and position controller Must be gt 0 M pid _current_speed_pulse The actual speed of the motor in raw units M pid _target_speed_pulse The target speed of the motor in raw units M pid _kp_s The Kp term of the speed controller must be positive M pid _ki _s The Ki term of the speed
57. r of the current virtual machine Unsafe to write _fwversion The firmware s version of the microcontroller Unsafe to write Events There is no common events Natives Functions math copy A B Copy the vector B in the A vector element by element A Bj math fill A c Fill each element of the A vector by the constant c A c math addscalar A B c Compute A B c where cis a scalar math add A B C Compute A B C where A B and C are three vectors of the same size math sub A B C Compute A B C where A B and C are three vectors of the same size math mul A B C Compute A B C where A B and C are three vectors of the same size Warning This is not a dot product math div A B C Compute A B C where A B and C are three vectors of the same size Note An exception will be trigged if a division by zero occurs math min A B C Write the minimum of each element of B and C in A where B and C are three vectors of the same size A min B C math max A B C Write the maximum of each element of B and C in A where A B and C are three vectors of the same size A max B C 30 math dot r A B n Compute the dot product between two vectors of the same size A and B gt di Bi r on math stat V min max mean Compute the maximum the mean and the minimum value of vector V math muldiv A B C D Compute multiplication division using internal 32 bit pr
58. rce period The update period of the force sensor in ms Max value is 400ms force mag The magnitude of the force sensor in metric gram force angle aseba The angle of the force vector The unit is aseba angle see section 6 2 1 force angle deg The angle of the force vector in degree 0 360 force x The force on the X axis in metric gram force y The force on the Y axis in metric gram timers period The period of six general purpose timers Events sensor This even is trigged each time a new force mesurement is available timerX Thoses event are trigged each time the corresponding timer expire See the variables timers period Natives Functions There is no natives function specific to this module Settings 0 X offset 1 Y offset Hidden Variables force _raw_x The raw X axis force mesurement without offset cancelation force _raw_y The raw Y axis force mesurement without offset cancelation potx tot_r The X axis potentiometer end to end total resistance in 0 1 kOhm _potx wpos The wipers positions of the X axis potentiometers poty tot_r The Y axis potentiometer end to end total resistance in 0 1 kOhm _poty wpos The wipers positions of the Y axis potentiometers 43 Hidden Natives Functions _potx set pot value Set the X axis potentiometer pot wiper position to value _potx update Read back the X axis potentiometers wiper position _potx save pot Save X axis potentiometer pot wipe
59. re is no others settings than the standard motor modules settings 6 2 11 rab2 This section describe the Range and Bearing module of the marXbot The Range and Bearing use the infrared medium to sens the relative position of other surrounding robots and 2 4Ghz radio to synchronize the swarm and exchange data The RF and infrared medium access are both TDMA and syncronized using an unique address on each node and a predetermined network size This implies the following restrictions 44 e Each node of the network must have an unique ID e Each node of the network must use the same network size e Each node of the network must use the same medium access time Variables rf rf rf rf rf rf tx rx rx rx rx rx rx rx rx id The ID of the RAB on the network Must be unique on the network swarm_size The swarm size Must be higher than 3 and smaller than 253 slot_time The medium access time in microsecond Minimal value 3000us Recommanded value 4000us max_tx The number of time the RAB module will send a packet without having any answer Put 0 to disable this behavior tx_data The data to send The first 13 bytes will be transmitted little endian ev node_id The node concerned by the event See events node new node lost power en Enable the TX power amplifiers Only impact infrared medium If TX is disabled the node will be visible on the RF network but not on the infrared
60. rrected This is the processed sensor value All the sensors should have a near zero offset when no object is present and a somewhat identical gain ground ambiant The raw ambiant infrared value of the vertical sensors ground reflected The raw reflected infrared value of the vertical sensors ground delta This is strictly equal to ground reflected minus ground ambiant ground corrected This is the processed sensor value All the sensors should have a near zero offset when no object is present and a somewhat identical gain sensors period The sampling period of the sensors in ms The maximum value is 400ms the minimum is 5ms 0 mean the sensors are disabled sensors bitfield This is a two word 32bits bitfield where a 1 indicate the sensor is switched on and O mean the sensor will not be switched on during the scanning process The bits number 0 to 23 are used for the horizontal sensors and the bits 24 to 31 are used for the vertical sensors timers period The period of six general purpose timers 0 mean disabled Maximum period is 400ms The timerX event expire each time the period timeout 39 Events sensors updated This event is trigged each time new sensors values are available timerX Thoses event are trigged each time the corresponding timer expire See the variables timers period Natives functions There is no native functions specific to this virtual machine Settings 0 23 Horizontal sensors calibrat
61. rs position in EEPROM _poty set pot value Set the Y axis potentiometer pot wiper position to value _poty update Read back the Y axis potentiometers wiper position _poty save pot value Save axis potentiometer pot wipers position in EEPROM 6 2 10 griper led This node manage the gripper and led ring of the marXbot Is manage two motors one for the gripper fingers and the other to manage the gripper rotation The finger motor use a standard motor module interface named gipper The speed unit is degree 100ms and the position is in degree The rotation motor use a standard motor module interface named rev The speed unit is degree 10ms and the position is in degree Please refer to section 6 2 3 for detailed documentation of both motors Variables timers period The period of two general purpose timers Events timerX Thoses event are trigged each time the corresponding timer expire See the variables timers period Natives Functions set_led n r g b Set the LED RGB brightness for each red r green g and blue b componnant for the led number n The maximum value for each componnant full brighness is 63 The minimum value switched off is 0 The led number 0 is the first led The led number 11 is the last led gripper enc reset Reset the gripper motor position Usefull to set the motor initial 0 position rev enc reset Reset the rotation motor position Usefull to set the motor initial 0 position Settings The
62. s 49 Magnetic Gripper Motors calibration 49 Foreword This user manual is devoted to document the marXbot basic use with the bootloaders and ASEBA virtual machines already programmed This is not a documentation about the electronics nor about embedded C programming on the microcontrollers As the marXbot is running an embedded Linux system most of the tricks in this manual are given for a Linux host system apart ASEBA which is a cross platform software When known to work the Windows equivalence is given If you find some working tools feel free to share with us for future users Anyway a Linux system is strongly encouraged You will see the following warnings along the road Please always read them and make sure you understand them Feel free to ask us any questions you may have as some operations could easily break the marXbot Mind this point This can be harmful for you or the robot Take great care This can destroy the robot Do this at your own risks This can destroy the robot and bring you years of torments maybe for eternity You have been warned Chapter 1 The MarXbot Robot This chapter will give you a first crash course to the marXbot robot if you are not already familiar with it At the end you should be able to understand the basic architecture both from the hardware and software point of view and establish a first SSH connection with the robot For a more in depth de
63. scription please refer to 1 3 1 1 Overview An overview of the robot can be found in Fig 1 1 The marXbot is a general purpose all terrain modular robot It has been designed and manufactured by the Mobots group belonging to the EPFL LSRO robotics laboratory The robot is modular by design 1 The base module It is made up of two wheels with tracks the power electronics and a great number of sensors 24 IR proximity rangers IR ground rangers 8 long range 4 short range 3D accelerometer 3D gyroscope RFID reader writer The power electronics is capable to hot swap the battery allowing the user to exchange the battery without shutting down the power The main processor will continue to work while the less useful parts motors sensors will be powered off to save energy There should be enough energy to power the processor for 10 seconds The hot swap is achieved using supercapacitors Thus a minimum charging time of 5 minutes should be granted before trying this capability Optional Attachment module This module allows marXbots to attach to each other in swam experiments The gripper can rotate around the robot This module also provides 12 RGB LEDs Optional Range and bearing module A marXbot can get the relative position distance angle of each individual inside a swarm using this module up to a distance of 5 meters Optional Rotating scanner This scanner is a low cost version of com
64. sult between 0 and 4095 If correctly calibrated it should be around 2048 when the arms are not bent When the variable displays a value bigger or smaller than 2048 by 1500 it means that a force of approximately 5000 N is applied laterally to the gripper The calibration method used a mass of 500 gramms attached to the gripper to determine the gain factors This means that if gauge_bend value displays 3548 an force equivalent to a dead mass of 500 gramms is pressing laterally on the gripper in one direction and if gauge_bend value displays 548 the same force is applied in the other direction gauge period This is the period between two measurement of the strain gauges It can be set between 1 and 1000 The smaller the period is the busier the microcontroller will be A good value is typically 100 meaning the sensor is updated every 0 1 second led 0 led 1 These leds are not visible unless you demount the robot They are used in debugging phases timers period 0 3 These are three timers that you can set to a different period The maximum period is 400 ms Events Most of the events concern the motors for more details see 6 2 3 mot_rot_index This event is emitted when the rotation motor reach the index This happen when the robot is aligned with its treels by default it is the position 0 of this motor gauge updated This event is emitted when the strain gauges are updated timer0 timeri timer2 These events are emitted when t
65. t the sampling and timer0 period led temperature period 100 timers period 0 100 timer0 event routine onevent timer0 time time 1 if time 10 then time 0 state state value 500xstate call led rgb value 0 0 end Listing 2 1 Second example blinking LED A few words of explanation e Oneline comments begin with e All the variables are global and should be declared at the beginning e Local events are fired by the microcontrollers and cached locally Each microcontroller has its own set of local events They are displayed using the Local Event tab at the lower left corner of the GUI e timers period 0 sets the period in milliseconds for the local event fired by Timer0 e onevent timero is the routine executed when the Timer0 event is fired 2 3 3 Your First Global Event Global events can be exchanged between the microcontrollers connected to the CAN bus and also to from a computer connected on the same network like with asebastudio We will demonstrate this using the proximity sensors coupled with the RGB LED to display the detection of an obstacle The first script shown in Listing 2 2 is to be coded in the base sensors node In addition you will have to add a constant named THRESHOLD set to 1000 upper right corner The global events are also to be added in the Events box on the right see Fig 2 3 The number next to the event is the number of arguments this event will take In our case
66. the robot using the power button 1 On your computer you also need to get associated with this private network using the information given in Sec 1 7 1 The IP address will be allocated by DHCP Using this Wi Fi connection the marXbot will have the static IP address IP 10 0 0 1xx replacing xx by the number of your marXbot written on the yellow sticker 17 Tf your computer is running zeroconf avahi for example you can use the hostname instead of the IP marxbotxx local again replacing xx by the number of your marXbot 1 5 2 USB Connection In case the Wi Fi connection is not available to you you can create a network over USB using usbnet To do so you will need a USB cable mini B to std A Plug the mini B into the OTG HS port 16 of the marXbot while connecting the A plug to your computer If you look at your network interfaces using ifconfig you should see a new interface named usbo You first need to configure this interface Your computer should be configured with a address in the subnet 192 168 0 1 24 for example sudo ifconfig usb0 192 168 0 1 Now you should be able to ping the marXbot They all have the same static IP address 5On Windows you will have to perform a few more steps not tested http docwiki gumstix org index php Windows_XP_usbnet using the inf provided here http www davehylands com linux gumstix usbnet linux inf 10 IP 192 168 0 202
67. to 0 the data has been succefully written If failed is nonzero the write operation has failed Note The variables failed and d must not be touched between the call to rfid write and the rfid write done event sound buffer 1 128 r 128 This function gets the two buffer of the microphones The left and right buffer is a table of 128 elements If you take the difference between the maximum and the minimum value of each table you will get the volume of the recorded sound servo open This function disables the magnetic gripper servo close This function enables the magnetic gripper 6 2 14 Magnetic Gripper Motors calibration This section will describe the motors calibration process Indeed the tilting and lifting motors must not go beyond some physical limits illustrated on 6 2 As long as no absolute landmark exists on which these motors can rely a calibration process has been established The Initial_calibration aesl file will perform this calibration 1 The robot will turn on itself using the rotation motor This is the only motor with an absolute index As soon as it has reached this index the robot knows it is in the right position It will then turn until it reaches the index and reset the rotation motor encoder to set the zero position in parallel with the treels 2 The robot will lower the gripper until it raise itself a bit then will set its arms a bit higher than the ground This manoeuvre is done to detect approx
68. turn to normal operating state when the temperature decrease below 70 C and emit the led overhead cleared Variables led temperature The led temperature in 0 1 C unit led temperature period The led temperature refresh period in ms Maximum value is 400ms This trigger the led temperature updated event timers period The period of seven general purpose timers 0 mean disabled Maximum period is 400ms The timerX event expire each time the period timeout Events led overheat The LED has overheated it is temporarly switched off it will be automatically switched on when the temperature is sufficiently lower led overheat cleared The LED overheat condition is cleared if the LED was on it is automatically switched on led temperature updated The LED temperature is updated You can read the new temperature in the led temperature variable timerX Thoses event are trigged each time the corresponding timer expire See the variables timers period Natives Functions led rgb r g b Set the LED RGB brightness for each red r green g and blue b componnant The maximum value for each componnant full brighness is 1000 The minimum value switched off is 0 Settings There is no settings with this module Hidden Variables There is no specific hidden variables in this module 6 2 9 gripper sensor This aseba node manage the force sensor of the marXbot The general units are in metric gram 42 Variables fo

Download Pdf Manuals

image

Related Search

Related Contents

User`s Manual - Sierra Video  Anexo Manual de uso del blog  Atmos 1000    HP Scanjet Enterprise Flow 7500  Mode d`emploi pour les stations de consignation  Verbatim Store 'n' Go USB 3.0 Portable Hard Drive 500GB    Operating instructions    

Copyright © All rights reserved.
Failed to retrieve file