Browse files

Removed vestiges of old LED code

  • Loading branch information...
1 parent 7037fb4 commit c90defc13df5414e66becb02be9de1b80b9266b0 Johannes Strom committed Jun 20, 2009
View
1 cmake.man/CMakeLists.txt
@@ -248,7 +248,6 @@ TARGET_LINK_LIBRARIES(
${ALCOMMON_LIBRARIES}
${TINYXML_LIBRARIES}
${COMM_TARGET}
- ${LEDS_TARGET}
${SENSORS_TARGET}
${SYNCHRO_TARGET}
${ROBOT_CONNECT_TARGET}
View
436 corpus/_ledsmodule.cpp
@@ -1,436 +0,0 @@
-
-#include <vector>
-#include "altypes.h"
-#include "_ledsmodule.h"
-#include "corpusconfig.h"
-
-using namespace AL;
-
-static const string LED_NAMES[] = {
- "ChestBoard/Led/Red/Actuator/Value",
- "ChestBoard/Led/Green/Actuator/Value",
- "ChestBoard/Led/Blue/Actuator/Value",
- "LFoot/Led/Red/Actuator/Value",
- "LFoot/Led/Green/Actuator/Value",
- "LFoot/Led/Blue/Actuator/Value",
- "RFoot/Led/Red/Actuator/Value",
- "RFoot/Led/Green/Actuator/Value",
- "RFoot/Led/Blue/Actuator/Value",
- "Ears/Led/Left/0Deg/Actuator/Value",
- "Ears/Led/Left/36Deg/Actuator/Value",
- "Ears/Led/Left/72Deg/Actuator/Value",
- "Ears/Led/Left/108Deg/Actuator/Value",
- "Ears/Led/Left/144Deg/Actuator/Value",
- "Ears/Led/Left/180Deg/Actuator/Value",
- "Ears/Led/Left/216Deg/Actuator/Value",
- "Ears/Led/Left/252Deg/Actuator/Value",
- "Ears/Led/Left/288Deg/Actuator/Value",
- "Ears/Led/Left/324Deg/Actuator/Value",
- "Ears/Led/Right/0Deg/Actuator/Value",
- "Ears/Led/Right/36Deg/Actuator/Value",
- "Ears/Led/Right/72Deg/Actuator/Value",
- "Ears/Led/Right/108Deg/Actuator/Value",
- "Ears/Led/Right/144Deg/Actuator/Value",
- "Ears/Led/Right/180Deg/Actuator/Value",
- "Ears/Led/Right/216Deg/Actuator/Value",
- "Ears/Led/Right/252Deg/Actuator/Value",
- "Ears/Led/Right/288Deg/Actuator/Value",
- "Ears/Led/Right/324Deg/Actuator/Value",
- "Face/Led/Red/Left/0Deg/Actuator/Value",
- "Face/Led/Green/Left/0Deg/Actuator/Value",
- "Face/Led/Blue/Left/0Deg/Actuator/Value",
- "Face/Led/Red/Left/45Deg/Actuator/Value",
- "Face/Led/Green/Left/45Deg/Actuator/Value",
- "Face/Led/Blue/Left/45Deg/Actuator/Value",
- "Face/Led/Red/Left/90Deg/Actuator/Value",
- "Face/Led/Green/Left/90Deg/Actuator/Value",
- "Face/Led/Blue/Left/90Deg/Actuator/Value",
- "Face/Led/Red/Left/135Deg/Actuator/Value",
- "Face/Led/Green/Left/135Deg/Actuator/Value",
- "Face/Led/Blue/Left/135Deg/Actuator/Value",
- "Face/Led/Red/Left/180Deg/Actuator/Value",
- "Face/Led/Green/Left/180Deg/Actuator/Value",
- "Face/Led/Blue/Left/180Deg/Actuator/Value",
- "Face/Led/Red/Left/225Deg/Actuator/Value",
- "Face/Led/Green/Left/225Deg/Actuator/Value",
- "Face/Led/Blue/Left/225Deg/Actuator/Value",
- "Face/Led/Red/Left/270Deg/Actuator/Value",
- "Face/Led/Green/Left/270Deg/Actuator/Value",
- "Face/Led/Blue/Left/270Deg/Actuator/Value",
- "Face/Led/Red/Left/315Deg/Actuator/Value",
- "Face/Led/Green/Left/315Deg/Actuator/Value",
- "Face/Led/Blue/Left/315Deg/Actuator/Value",
- "Face/Led/Red/Right/0Deg/Actuator/Value",
- "Face/Led/Green/Right/0Deg/Actuator/Value",
- "Face/Led/Blue/Right/0Deg/Actuator/Value",
- "Face/Led/Red/Right/45Deg/Actuator/Value",
- "Face/Led/Green/Right/45Deg/Actuator/Value",
- "Face/Led/Blue/Right/45Deg/Actuator/Value",
- "Face/Led/Red/Right/90Deg/Actuator/Value",
- "Face/Led/Green/Right/90Deg/Actuator/Value",
- "Face/Led/Blue/Right/90Deg/Actuator/Value",
- "Face/Led/Red/Right/135Deg/Actuator/Value",
- "Face/Led/Green/Right/135Deg/Actuator/Value",
- "Face/Led/Blue/Right/135Deg/Actuator/Value",
- "Face/Led/Red/Right/180Deg/Actuator/Value",
- "Face/Led/Green/Right/180Deg/Actuator/Value",
- "Face/Led/Blue/Right/180Deg/Actuator/Value",
- "Face/Led/Red/Right/225Deg/Actuator/Value",
- "Face/Led/Green/Right/225Deg/Actuator/Value",
- "Face/Led/Blue/Right/225Deg/Actuator/Value",
- "Face/Led/Red/Right/270Deg/Actuator/Value",
- "Face/Led/Green/Right/270Deg/Actuator/Value",
- "Face/Led/Blue/Right/270Deg/Actuator/Value",
- "Face/Led/Red/Right/315Deg/Actuator/Value",
- "Face/Led/Green/Right/315Deg/Actuator/Value",
- "Face/Led/Blue/Right/315Deg/Actuator/Value"
-};
-static const int NUM_LEDS = sizeof(LED_NAMES) / sizeof(string);
-
-static const string LED_GROUPS[] = {
- "AllLeds",
- "AllLedsBlue",
- "AllLedsGreen",
- "AllLedsRed",
- "ChestLeds",
- "EarLeds",
- "FaceLeds",
- "FeetLeds",
- "LeftEarLeds",
- "LeftEarLedsBack",
- "LeftEarLedsEven",
- "LeftEarLedsFront",
- "LeftEarLedsOdd",
- "LeftFaceLeds",
- "LeftFaceLedsBlue",
- "LeftFaceLedsGreen",
- "LeftFaceLedsRed",
- "LeftFootLeds",
- "RightEarLeds",
- "RightEarLedsBack",
- "RightEarLedsEven",
- "RightEarLedsFront",
- "RightEarLedsOdd",
- "RightFaceLeds",
- "RightFaceLedsBlue",
- "RightFaceLedsGreen",
- "RightFaceLedsRed",
- "RightFootLeds"
-};
-static const int NUM_LED_GROUPS = sizeof(LED_GROUPS) / sizeof(string);
-
-static AL::ALPtr<AL::ALLedsProxy> led_proxy;
-static bool ledSet = false;
-
-void setLedsProxy(AL::ALPtr<AL::ALLedsProxy> _led_proxy){
- led_proxy = _led_proxy;
- ledSet = true;
-}
-
-//
-// _leds module initialization
-//
-
-static PyMethodDef _leds_methods[] = {
- // Sentinel
- { NULL }
-};
-
-PyMODINIT_FUNC
-init_leds ()
-{
- // Initialize LEDs type object
- if (PyType_Ready(&PyLEDsType) < 0)
- return; // error handled by Python
-
- // Initialize module
- PyObject *module = Py_InitModule3("_leds",
- _leds_methods,
- "Python wrapped access to the Aldebaran LEDs proxy");
- if (module == NULL)
- return; // error handled by Python
-
- // Add LEDs type reference to the module
- Py_INCREF(&PyLEDsType);
- PyModule_AddObject(module, "LEDs", reinterpret_cast<PyObject*>(&PyLEDsType));
-}
-
-
-//
-// PyLEDS definitions
-//
-
-PyLEDs*
-PyLEDs_new ()
-{
- return reinterpret_cast<PyLEDs*>(PyLEDs_new(&PyLEDsType, NULL, NULL));
-}
-
-PyObject*
-PyLEDs_new (PyTypeObject* type, PyObject* args, PyObject* kwds)
-{
- PyObject *self = type->tp_alloc(type, 0);
-
- if (self != NULL) {
- PyLEDs* leds = reinterpret_cast<PyLEDs*>(self);
- try {
-#ifdef USE_PYLEDS_CXX_BACKEND
- if (ledSet)
- leds->proxy = led_proxy;
-#endif
-
- }catch (ALError &e) {
- PyErr_Format(PyExc_SystemError,
- "Error occured initializing module proxy.\n %s",
- e.toString(VerbosityFull).c_str()
- );
- PyLEDs_dealloc(self);
- self = NULL;
- }
-
- leds->groups = vector<string>();
- }
-
- return self;
-}
-
-void
-PyLEDs_dealloc (PyObject* self)
-{
- self->ob_type->tp_free(self);
-}
-
-const string*
-get_led_or_group (PyLEDs *self, int id)
-{
- if (id < 0)
- return NULL;
- else if (id < NUM_LEDS)
- return &LED_NAMES[id];
-
- id -= NUM_LEDS;
- if (id < NUM_LED_GROUPS)
- return &LED_GROUPS[id];
-
- id -= NUM_LED_GROUPS;
- if (id < (signed int)self->groups.size())
- return &self->groups[id];
-
- return NULL;
-}
-
-PyObject*
-PyLEDs_createGroup (PyLEDs *self, PyObject *args)
-{
- char *name;
- PyObject *seq;
-
- if (!PyArg_ParseTuple(args, "sO:createGroup", &name, &seq))
- return NULL;
-
- PyObject *fast = PySequence_Fast(seq,
- "createGroup() expected a sequence of string or integer ids of leds "
- "as the second argument");
- if (fast == NULL)
- return NULL;
-
- // convert sequence of ints or strings to a string vector
- vector<string> leds(PySequence_Fast_GET_SIZE(fast), string());
- PyObject *o;
- for (int i = 0; i < PySequence_Fast_GET_SIZE(fast); i++) {
- o = PySequence_Fast_GET_ITEM(fast, i);
- if (PyInt_Check(o)) {
- int id = PyInt_AsLong(o);
- if (id > 0 && id < NUM_LEDS)
- leds[i] = LED_NAMES[i];
- else {
- PyErr_Format(PyExc_ValueError, "invalid led id given (%i)", id);
- Py_DECREF(fast);
- return NULL;
- }
- }else if (PyString_Check(o))
- leds[i] = string(PyString_AsString(o));
-
- else {
- PyErr_Format(PyExc_TypeError,
- "createGroup() expected a sequence of string or integer ids of leds "
- "as the second argument (%s in the list)", o->ob_type->tp_name);
- Py_DECREF(fast);
- return NULL;
- }
- }
-
- // call proxy method with group anem and array of leds names
- try {
-#ifdef USE_PYLEDS_CXX_BACKEND
- self->proxy->callVoid("createGroup", string(name), ALValue(leds));
-#endif
- }catch (ALError &e) {
- PyErr_Format(PyExc_SystemError,
- "createGroup() returned an ALError.\n %s",
- e.toString(VerbosityFull).c_str()
- );
- return NULL;
- }
- self->groups.push_back(name);
- return PyInt_FromLong(self->groups.size() - 1);
-}
-
-PyObject*
-PyLEDs_off (PyLEDs *self, PyObject *args)
-{
- string tmp;
- const string *name = &tmp;
-
- if (PyInt_Check(args)) {
- int id = PyInt_AsLong(args);
- name = get_led_or_group(self, id);
- if (name != NULL) {
- PyErr_Format(PyExc_ValueError, "unknown integer reference id (%i given)",
- id);
- return NULL;
- }
- }else if (PyString_Check(args))
- tmp = string(PyString_AsString(args));
-
- else {
- PyErr_Format(PyExc_TypeError, "expected integer or string (%s given)",
- args->ob_type->tp_name);
- return NULL;
- }
-
- try {
-#ifdef USE_PYLEDS_CXX_BACKEND
- self->proxy->callVoid("off", *name);
-#endif
- }catch (ALError &e) {
- PyErr_Format(PyExc_SystemError,
- "Error occured initializing module proxy.\n %s",
- e.toString(VerbosityFull).c_str()
- );
- return NULL;
- }
- Py_RETURN_NONE;
-}
-
-PyObject*
-PyLEDs_on (PyLEDs *self, PyObject *args)
-{
- string tmp;
- const string *name = &tmp;
-
- if (PyInt_Check(args)) {
- int id = PyInt_AsLong(args);
- name = get_led_or_group(self, id);
- if (name == NULL) {
- PyErr_Format(PyExc_ValueError, "unknown integer reference id (%i given)",
- id);
- return NULL;
- }
- }else if (PyString_Check(args))
- tmp = string(PyString_AsString(args));
-
- else {
- PyErr_Format(PyExc_TypeError, "expected integer or string (%s given)",
- args->ob_type->tp_name);
- return NULL;
- }
-
- try {
-#ifdef USE_PYLEDS_CXX_BACKEND
- self->proxy->callVoid("on", *name);
-#endif
- }catch (ALError &e) {
- PyErr_Format(PyExc_SystemError,
- "createGroup() returned an ALError.\n %s",
- e.toString(VerbosityFull).c_str()
- );
- return NULL;
- }
- Py_RETURN_NONE;
-}
-
-PyObject*
-PyLEDs_set (PyLEDs *self, PyObject *args)
-{
- PyObject *arg2;
- float intensity;
- string tmp;
- const string *name = &tmp;
-
- if (!PyArg_ParseTuple(args, "Of:set", &arg2, &intensity))
- return NULL;
-
- if (PyInt_Check(arg2)) {
- int id = PyInt_AsLong(arg2);
- name = get_led_or_group(self, id);
- if (name == NULL) {
- PyErr_Format(PyExc_ValueError, "unknown integer reference id (%i given)",
- id);
- return NULL;
- }
- }else if (PyString_Check(arg2))
- tmp = string(PyString_AsString(arg2));
-
- else {
- PyErr_Format(PyExc_TypeError, "expected integer or string (%s given)",
- arg2->ob_type->tp_name);
- return NULL;
- }
-
- try {
-#ifdef USE_PYLEDS_CXX_BACKEND
- self->proxy->callVoid("set", *name, intensity);
-#endif
- }catch (ALError &e) {
- PyErr_Format(PyExc_SystemError,
- "set() returned an ALError.\n %s",
- e.toString(VerbosityFull).c_str()
- );
- return NULL;
- }
- Py_RETURN_NONE;
-}
-
-PyObject*
-PyLEDs_fadeRGB (PyLEDs *self, PyObject *args)
-{
- PyObject *arg2;
- int rgbHex;
- float time;
- string tmp;
- const string *name = &tmp;
-
- if (!PyArg_ParseTuple(args, "Oif:set", &arg2, &rgbHex,&time))
- return NULL;
-
- if (PyInt_Check(arg2)) {
- int id = PyInt_AsLong(arg2);
- name = get_led_or_group(self, id);
- if (name == NULL) {
- PyErr_Format(PyExc_ValueError, "unknown integer reference id (%i given)",
- id);
- return NULL;
- }
- }else if (PyString_Check(arg2))
- tmp = string(PyString_AsString(arg2));
-
- else {
- PyErr_Format(PyExc_TypeError, "expected integer or string (%s given)",
- arg2->ob_type->tp_name);
- return NULL;
- }
-
- try {
-#ifdef USE_PYLEDS_CXX_BACKEND
- //self->proxy->callVoid("fadeRGB", *name, rgbHex, time);
-#endif
- }catch (ALError &e) {
- PyErr_Format(PyExc_SystemError,
- "set() returned an ALError.\n %s",
- e.toString(VerbosityFull).c_str()
- );
- return NULL;
- }
- Py_RETURN_NONE;
-}
View
129 corpus/_ledsmodule.h
@@ -1,129 +0,0 @@
-
-#ifndef __ledsmodule_h_DEFINED
-#define __ledsmodule_h_DEFINED
-
-#include <albroker.h>
-#include <alledsproxy.h>
-#include <alptr.h>
-
-#include <Python.h>
-
-//
-// _leds module initialization
-//
-void setLedsProxy(AL::ALPtr<AL::ALLedsProxy> led_proxy);
-
-PyMODINIT_FUNC init_leds();
-
-//
-// PyLEDS definitions
-//
-
-typedef struct PyLEDs_t {
- PyObject_HEAD
- // Aldeberan proxy to the leds
- AL::ALPtr<AL::ALLedsProxy> proxy;
- vector<string> groups;
-} PyLEDs;
-
-// C++ - accessible interface
-extern PyLEDs* PyLEDs_new ();
-// backend methods
-extern PyObject* PyLEDs_new (PyTypeObject* type, PyObject* args,
- PyObject* kwds);
-extern void PyLEDs_dealloc(PyObject* self);
-// Python - accessible interface
-extern PyObject* PyLEDs_createGroup(PyLEDs* self, PyObject* args);
-extern PyObject* PyLEDs_off(PyLEDs* self, PyObject* args);
-extern PyObject* PyLEDs_on (PyLEDs* self, PyObject* args);
-extern PyObject* PyLEDs_set(PyLEDs* self, PyObject* args);
-extern PyObject* PyLEDs_fadeRGB(PyLEDs* self, PyObject* args);
-
-//extern PyObject* PyLEDs_spinGroup(PyLEDs* self, PyObject* args);
-// Method list
-static PyMethodDef PyLEDs_methods[] = {
-
- {"createGroup", reinterpret_cast<PyCFunction>(PyLEDs_createGroup),
- METH_VARARGS,
- "createGroup(name, leds) --> None. Group the given LEDS under a common"
- "group name.\n"
- "\n"
- "LED ids amay be integer ids or string names."},
-
- {"off", reinterpret_cast<PyCFunction>(PyLEDs_off), METH_O,
- "off(id) --> None. Switch the given LED or group to minimum intensity."
- "\n\n"
- "Accepts either an integer ID or string name of and LED or group \n"
- "(group id must be a string name of a group created via createGroup())"},
-
- {"on", reinterpret_cast<PyCFunction>(PyLEDs_on), METH_O,
- "on(id) --> None. Switch the given LED or group to maximum intensity."
- "\n\n"
- "Accepts either an integer ID or string name of and LED or group \n"
- "(group id must be a string name of a group created via createGroup())"},
-
- {"set", reinterpret_cast<PyCFunction>(PyLEDs_set), METH_VARARGS,
- "set(id) --> None. Set the given LED or group to the given intensity."
- "\n\n"
- "Accepts either an integer ID or string name of and LED or group \n"
- "(group id must be a string name of a group created via createGroup())"},
- {"fadeRGB", reinterpret_cast<PyCFunction>(PyLEDs_fadeRGB), METH_VARARGS,
- "fadeRGB(id,0xRRGGBB,seconds) --> None. Set the given LED or group to the "
- "given RGB Hex value over a certain number of seconds."
- "\n\n"
- "Accepts either an integer ID or string name of and LED or group \n"
- "(group id must be a string name of a group created via createGroup())"},
- //{"spinGroup", reinterpret_cast<PyCFunction>(PyLEDs_spinGroup), METH_VARARGS,
- // "spinGroup(name, start=0, forwards=True, onTime=1.0,\n"
- // " fadeTime=.5, totalTime=4.0) --> None.\n"
- // " Spin a group of LEDs."},
-
- // Sentinel
- { NULL }
-};
-
-// PyLEDs type definition
-static PyTypeObject PyLEDsType = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
- "_leds.LEDs", /*tp_name*/
- sizeof(PyLEDs), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- (destructor)PyLEDs_dealloc,/*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "LEDs object", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- PyLEDs_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- (newfunc)PyLEDs_new, /* tp_new */
-};
-
-
-#endif
View
73 corpus/_webotsledsmodule.cpp
@@ -1,73 +0,0 @@
-//JUNK FILE
-
-
-
-#include <vector>
-#include "_webotsledsmodule.h"
-#include "corpusconfig.h"
-
-
-//
-// _leds module initialization
-//
-
-static PyMethodDef _leds_methods[] = {
- // Sentinel
- { NULL }
-};
-
-PyMODINIT_FUNC
-init_leds ()
-{
- // Initialize LEDs type object
- if (PyType_Ready(&PyLEDsType) < 0)
- return; // error handled by Python
-
- // Initialize module
- PyObject *module = Py_InitModule3("_leds",
- _leds_methods,
- "Python wrapped access to the Aldebaran LEDs proxy");
- if (module == NULL)
- return; // error handled by Python
-
- // Add LEDs type reference to the module
- Py_INCREF(&PyLEDsType);
- PyModule_AddObject(module, "LEDs", reinterpret_cast<PyObject*>(&PyLEDsType));
-}
-
-
-//
-// PyLEDS definitions
-//
-
-PyLEDs*
-PyLEDs_new ()
-{
- return reinterpret_cast<PyLEDs*>(PyLEDs_new(&PyLEDsType, NULL, NULL));
-}
-
-PyObject*
-PyLEDs_new (PyTypeObject* type, PyObject* args, PyObject* kwds)
-{
- PyObject *self = type->tp_alloc(type, 0);
-
- if (self != NULL) {
- PyLEDs* leds = reinterpret_cast<PyLEDs*>(self);
- }
-
- return self;
-}
-
-void
-PyLEDs_dealloc (PyObject* self)
-{
- self->ob_type->tp_free(self);
-}
-
-PyObject*
-PyLEDs_dummy (PyLEDs *self, PyObject *args)
-{
-
- Py_RETURN_NONE;
-
-}
View
114 corpus/_webotsledsmodule.h
@@ -1,114 +0,0 @@
-// This is a dummy python module which duplicates all the methods in
-// the _ledsmodule, but just throws runs a dummy method
-
-
-#ifndef __webotsledsmodule_h_DEFINED
-#define __webotsledsmodule_h_DEFINED
-
-#include <Python.h>
-
-//
-// _leds module initialization
-//
-
-PyMODINIT_FUNC init_leds();
-
-//
-// PyLEDS definitions
-//
-
-typedef struct PyLEDs_t {
- PyObject_HEAD
- int dummy;
-} PyLEDs;
-
-// C++ - accessible interface
-extern PyLEDs* PyLEDs_new ();
-// backend methods
-extern PyObject* PyLEDs_new (PyTypeObject* type, PyObject* args,
- PyObject* kwds);
-extern void PyLEDs_dealloc(PyObject* self);
-// Python - accessible interface
-extern PyObject* PyLEDs_dummy(PyLEDs* self, PyObject* args);
-
-static PyMethodDef PyLEDs_methods[] = {
-
- {"createGroup", reinterpret_cast<PyCFunction>(PyLEDs_dummy),
- METH_VARARGS,
- "createGroup(name, leds) --> None. Group the given LEDS under a common"
- "group name.\n"
- "\n"
- "LED ids amay be integer ids or string names."},
-
- {"off", reinterpret_cast<PyCFunction>(PyLEDs_dummy), METH_O,
- "off(id) --> None. Switch the given LED or group to minimum intensity."
- "\n\n"
- "Accepts either an integer ID or string name of and LED or group \n"
- "(group id must be a string name of a group created via createGroup())"},
-
- {"on", reinterpret_cast<PyCFunction>(PyLEDs_dummy), METH_O,
- "on(id) --> None. Switch the given LED or group to maximum intensity."
- "\n\n"
- "Accepts either an integer ID or string name of and LED or group \n"
- "(group id must be a string name of a group created via createGroup())"},
-
- {"set", reinterpret_cast<PyCFunction>(PyLEDs_dummy), METH_VARARGS,
- "set(id) --> None. Set the given LED or group to the given intensity."
- "\n\n"
- "Accepts either an integer ID or string name of and LED or group \n"
- "(group id must be a string name of a group created via createGroup())"},
- {"fadeRGB", reinterpret_cast<PyCFunction>(PyLEDs_dummy), METH_VARARGS,
- "fadeRGB(id,0xRRGGBB,seconds) --> None. Set the given LED or group to the "
- "given RGB Hex value over a certain number of seconds."
- "\n\n"
- "Accepts either an integer ID or string name of and LED or group \n"
- "(group id must be a string name of a group created via createGroup())"},
- // Sentinel
- { NULL }
-};
-
-// PyLEDs type definition
-static PyTypeObject PyLEDsType = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
- "_leds.LEDs", /*tp_name*/
- sizeof(PyLEDs), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- (destructor)PyLEDs_dealloc,/*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "LEDs object", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- PyLEDs_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- (newfunc)PyLEDs_new, /* tp_new */
-};
-
-
-#endif
View
32 corpus/cmake.man.corpus/CMakeLists.txt
@@ -119,12 +119,7 @@ SET( SENSORS_SRCS ${CORPUS_INCLUDE_DIR}/Sensors
${CORPUS_INCLUDE_DIR}/NaoPose )
-###### LEDS ############
-IF(WEBOTS_BACKEND)
- SET( LEDS_SRCS ${CORPUS_INCLUDE_DIR}/_webotsledsmodule )
-ELSE(WEBOTS_BACKEND)
- SET( LEDS_SRCS ${CORPUS_INCLUDE_DIR}/_ledsmodule )
-ENDIF(WEBOTS_BACKEND)
+###### SYNCHRO ############
SET( SYNCHRO_SRCS ${CORPUS_INCLUDE_DIR}/synchro
${CORPUS_INCLUDE_DIR}/_synchromodule
@@ -179,11 +174,6 @@ IF( PYTHON_SHARED_CORPUS )
SHARED
${SENSORS_SRCS}
)
- ADD_LIBRARY(
- ${LEDS_TARGET}
- SHARED
- ${LEDS_SRCS}
- )
ADD_LIBRARY(
${SYNCHRO_TARGET}
@@ -196,7 +186,6 @@ IF( PYTHON_SHARED_CORPUS )
${ROBOT_CONNECT_SRCS}
)
GET_TARGET_PROPERTY( SENSORS_TARGET_LOCATION ${SENSORS_TARGET} LOCATION )
- GET_TARGET_PROPERTY( LEDS_TARGET_LOCATION ${LEDS_TARGET} LOCATION )
GET_TARGET_PROPERTY( SYNCHRO_TARGET_LOCATION ${SYNCHRO_TARGET} LOCATION )
GET_TARGET_PROPERTY( ROBOT_CONNECT_TARGET_LOCATION
${ROBOT_CONNECT_TARGET} LOCATION )
@@ -208,13 +197,6 @@ IF( PYTHON_SHARED_CORPUS )
RENAME ${SENSORS_TARGET}module.so
)
INSTALL(
- FILES ${LEDS_TARGET_LOCATION}
- DESTINATION ${CORPUS_PYTHON_TARGET_DIR}
- CONFIGURATIONS "" Debug Release
- RENAME ${LEDS_TARGET}module.so
- )
-
- INSTALL(
FILES ${SYNCHRO_TARGET_LOCATION}
DESTINATION ${CORPUS_PYTHON_TARGET_DIR}
CONFIGURATIONS "" Debug Release
@@ -234,11 +216,6 @@ ELSE( PYTHON_SHARED_CORPUS )
${SENSORS_SRCS}
)
ADD_LIBRARY(
- ${LEDS_TARGET}
- STATIC
- ${LEDS_SRCS}
- )
- ADD_LIBRARY(
${SYNCHRO_TARGET}
STATIC
${SYNCHRO_SRCS}
@@ -263,7 +240,6 @@ INSTALL(
#IF( APPLE )
SET_TARGET_PROPERTIES( ${SENSORS_TARGET} PROPERTIES LINKER_LANGUAGE CXX )
- SET_TARGET_PROPERTIES( ${LEDS_TARGET} PROPERTIES LINKER_LANGUAGE CXX )
#ENDIF( APPLE )
@@ -275,12 +251,6 @@ TARGET_LINK_LIBRARIES( ${SENSORS_TARGET} ${NBCOMMON_LIBRARIES}
${PYTHON_LIBRARIES}
${VISION_LIBRARIES}
)
-TARGET_LINK_LIBRARIES( ${LEDS_TARGET} ${NBCOMMON_LIBRARIES}
- ${ALCOMMON_LIBRARIES}
- ${TINYXML_LIBRARIES}
- ${PTHREAD_LIBRARIES}
- ${PYTHON_LIBRARIES}
- )
TARGET_LINK_LIBRARIES( ${SYNCHRO_TARGET} ${NBCOMMON_LIBRARIES}
${ALCOMMON_LIBRARIES}
${TINYXML_LIBRARIES}
View
2 manmodule.cpp
@@ -52,8 +52,6 @@ typedef TTMan ALMan;
#include "ALTranscriber.h"
#include "ALImageTranscriber.h"
-
-#include "_ledsmodule.h"
#include "NaoLights.h"
#include "almodule.h"
View
50 noggin/LedConstants.py
@@ -1,50 +0,0 @@
-####### LED DEFINITIONS #############
-LED_OFF = 0
-LED_ON = 1
-
-#GROUPS
-LEFT_FOOT_LED = "LeftFootLeds"
-RIGHT_FOOT_LED = "RightFootLeds"
-CHEST_LED = "ChestLeds"
-LEFT_EYE_LED = "LeftFaceLeds"
-RIGHT_EYE_LED = "RightFaceLeds"
-FACE_LED = "FaceLeds"
-EAR_LED = "EarLeds"
-
-#COLORS
-RED = 0xFF0000
-GREEN = 0x00FF00
-BLUE = 0x0000FF
-YELLOW= 0xFFFF00
-WHITE = 0xFFFFFF
-OFF = 0x000000
-NOW = 0.0
-
-
-
-###### GC LEDS ##########
-###### KICKOFF ##########
-HAVE_KICKOFF_LEDS = ((RIGHT_FOOT_LED, WHITE, NOW),)
-NO_KICKOFF_LEDS = ((RIGHT_FOOT_LED, OFF, NOW),)
-
-###### TEAM COLOR ##########
-TEAM_BLUE_LEDS = ((LEFT_FOOT_LED, BLUE, NOW),)
-TEAM_RED_LEDS = ((LEFT_FOOT_LED, RED, NOW),)
-
-###### STATES ###########
-STATE_INITIAL_LEDS = ((CHEST_LED, OFF, NOW),)
-STATE_READY_LEDS = ((CHEST_LED, BLUE, NOW),)
-STATE_SET_LEDS = ((CHEST_LED, YELLOW, NOW),)
-STATE_PLAYING_LEDS = ((CHEST_LED, GREEN, NOW),)
-STATE_PENALIZED_LEDS =((CHEST_LED, RED, NOW),)
-STATE_FINISHED_LEDS = ((CHEST_LED, OFF, NOW),)
-
-##### Brain ######
-#### Ball #######
-BALL_ON_LEDS = ((FACE_LED, RED, NOW),)
-BALL_OFF_LEDS = ((FACE_LED, BLUE, NOW),)
-
-
-#### GOAL ######
-GOAL_ON_LEDS = ((EAR_LED, BLUE, NOW),)
-GOAL_OFF_LEDS = ((EAR_LED, OFF, NOW),)
View
6 noggin/Noggin.cpp
@@ -8,12 +8,6 @@
#include "EKFStructs.h"
#include <cstdlib>
-#ifndef WEBOTS_BACKEND //HACK-ish should make abstract Lights object..!!
-#include "_ledsmodule.h"
-#else
-#include "_webotsledsmodule.h"
-#endif
-
#include "PySensors.h"
#include "PyRoboGuardian.h"
#include "PyMotion.h"
View
1 noggin/cmake.noggin/CMakeLists.txt
@@ -208,7 +208,6 @@ TARGET_LINK_LIBRARIES(
${NBCOMMON_LIBRARIES}
${PYTHON_LIBRARIES}
${VISION_TARGET}
- ${LEDS_TARGET}
${SENSORS_TARGET}
)

0 comments on commit c90defc

Please sign in to comment.