El documento presenta un taller de robótica móvil que incluye dos sesiones. La primera sesión introduce conceptos básicos de programación en robótica móvil, realiza demostraciones prácticas y propone tres proyectos utilizando Lego Mindstorms. La segunda sesión cubre el hardware y software de Handy Board y propone dos proyectos adicionales utilizando este equipo, además de introducir conceptos de programación de robots manipuladores.
35. Introducción El RCX es el cerebro del sistema ROBOTICS INVENTION, el RCX se programa mediante una PC, además tiene pre-cargados algunos programas.
36. Introducción El RCX tiene puertos para tomar lecturas de los sensores, un procesador para realizar cálculos y salidas con las cuales controla los motores.
38. Introducción Mediante un lenguaje de programación visual para PC y el puerto serial, es posible programar y posteriormente descargar el código que ejecutará el RCX.
39.
40.
41. El “cerebro” del Lego (RCX) Imágenes de http://graphics.stanford.edu/~kekoa/rcx/
78. Expresiones x==1 ? y : z n/a conditional value ? : x || y left Logical OR || x && y left Logical AND && x | y left Bitwise OR | x ^ y left Bitwise XOR ^ x & y left Bitwise AND & x == 1 left equal to, not equal to ==, != x < y left relational operators <, >, <=, >= x << 4 shift amount must constant left Left and right shift <<, >> x + y left Addition, subtraction +, - x * y left Multiplication, division, modulo *, /, % -x ~123 !x constant only right right right Unary minus Bitwise negation (unary) Logical negation - ~ ! x++ or ++x variables only left Increment, decrement ++, -- abs(x) sign(x) n/a n/a Absolute value Sign of operand abs() sign() Example Restriction Associativity Description Operator
79. Condiciones logical OR of two conditions (true if and only if at least one of the conditions are true) cond1 || cond2 logical AND of two conditions (true if and only if both conditions are true) cond1 && cond2 logical negation of a condition - true if condition is false ! condition true if expr1 is greater than or equal to expr2 expr1 >= expr2 true if expr1 is greater than expr2 expr1 > expr2 true if expr1 is less than or equal to expr2 expr1 <= expr2 true if one expr1 is less than expr2 expr1 < expr2 true if expr1 is not equal to expr2 expr1 != expr2 true if expr1 equals expr2 expr1 == expr2 true if expr is not equal to 0 expr always false false always true true Meaning Condition
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91. Sensores a rotation sensor SENSOR_TYPE_ROTATION a light sensor SENSOR_TYPE_LIGHT a temperature sensor SENSOR_TYPE_TEMPERATURE a touch sensor SENSOR_TYPE_TOUCH Meaning Sensor Type
92. Sensores rotation (16 ticks per revolution) SENSOR_MODE_ROTATION degrees C SENSOR_MODE_CELSIUS degrees F SENSOR_MODE_FAHRENHEIT value from 0 to 100 SENSOR_MODE_PERCENT counts number of boolean periods SENSOR_MODE_PULSE counts number of boolean transitions SENSOR_MODE_EDGE boolean value (0 or 1) SENSOR_MODE_BOOL raw value from 0 to 1023 SENSOR_MODE_RAW Meaning Sensor Mode
95. Salidas La dirección se fija mediante SetDirection( salidas , direccion ). La dirección puede ser: La potencia va de 0 (menor) a 7 (mayor). Se fijan mediante SetPower( salidas , potencia ). Switch direction to the opposite of what it is presently OUT_TOGGLE Set to reverse direction OUT_REV Set to forward direction OUT_FWD Meaning Direction
96. Salidas turns outputs on for specified amount of time (in 100ths of a second) OnFor(outputs, time) sets direction to reverse, then turns on OnRev(outputs) sets direction to forward, then turns on OnFwd(outputs) toggles direction of outputs Toggle(outputs) sets outputs to reverse direction Rev(outputs) sets outputs to forward direction Fwd(outputs) makes outputs "float" Float(outputs) turns motors off Off(outputs) turns motors on On(outputs) Action Command