Sparki / Python Library

The Easy Robot for Everyone!

Re: Sparki / Python Library

Postby radarjd » Mon Jan 25, 2016 2:38 pm

banda wrote:The motor behavior is unchanged. All the motors() based commands still yield the same results - the right motor turns at speed, the left motor inches incredibly slowly, and the command takes more than a minute to complete.


I've added a sketch called sparki_motors_util, and then a python program called sparki_myro_test_motors.py to the sparki_learning program. The sketch makes use of code identical to motors in the main library, but has some more debugging info. During the setup() of the sketch, sparki will use the motors command to move forward / backward / left / right. The function itself will display the input it's getting on the LCD.

Once setup is done, you can run the sparki_myro_test_motors.py program. That will run through several functions, all which use motors. I'm trying to determine if the issue is communication between the libraries, or if there's something going wrong in motors on the sparki itself. It works on mine, but as I've said, I had a problem similar to what you're having.

Thanks again for your help debugging this. Hopefully we can work it out.
radarjd
 
Posts: 21
Joined: Wed Feb 11, 2015 6:26 pm

Re: Sparki / Python Library

Postby banda » Tue Jan 26, 2016 12:10 am

Bit of bad luck, I'm afraid: I was unable to successfully compile the sparki_motors_util.ino sketch. Not enough memory.
I'm using Arduino 1.6.7, and for "Board", I've selected "Arduino Leonardo". Here's the verbose output from compilation:

Code: Select all
Arduino: 1.6.7 (Linux), Board: "Arduino Leonardo"

/home/bill/Downloads/arduino-1.6.7/arduino-builder -dump-prefs -logger=machine -hardware "/home/bill/Downloads/arduino-1.6.7/hardware" -tools "/home/bill/Downloads/arduino-1.6.7/tools-builder" -tools "/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr" -built-in-libraries "/home/bill/Downloads/arduino-1.6.7/libraries" -libraries "/home/bill/Arduino/libraries" -fqbn=arduino:avr:leonardo -vid-pid=0X2341_0X8036 -ide-version=10607 -build-path "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/home/bill/Development/Arduino/sparki_learning/sparki_motors_util/sparki_motors_util.ino"
/home/bill/Downloads/arduino-1.6.7/arduino-builder -compile -logger=machine -hardware "/home/bill/Downloads/arduino-1.6.7/hardware" -tools "/home/bill/Downloads/arduino-1.6.7/tools-builder" -tools "/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr" -built-in-libraries "/home/bill/Downloads/arduino-1.6.7/libraries" -libraries "/home/bill/Arduino/libraries" -fqbn=arduino:avr:leonardo -vid-pid=0X2341_0X8036 -ide-version=10607 -build-path "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/home/bill/Development/Arduino/sparki_learning/sparki_motors_util/sparki_motors_util.ino"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sketch/sparki_motors_util.ino.cpp" -o "/dev/null"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sketch/sparki_motors_util.ino.cpp" -o "/dev/null"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/home/bill/Arduino/libraries/Sparki/src/Radio.cpp" -o "/dev/null"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/home/bill/Arduino/libraries/Sparki/src/SPI.cpp" -o "/dev/null"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/home/bill/Arduino/libraries/Sparki/src/Sparki.cpp" -o "/dev/null"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/home/bill/Arduino/libraries/Sparki/src/SparkiEEPROM.cpp" -o "/dev/null"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/home/bill/Arduino/libraries/Sparki/src/SparkiWire.cpp" -o "/dev/null"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sketch/sparki_motors_util.ino.cpp" -o "/dev/null"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sketch/sparki_motors_util.ino.cpp" -o "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
"/home/bill/Downloads/arduino-1.6.7/tools-builder/ctags/5.8-arduino5/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "-I/home/bill/Arduino/libraries/Sparki/src" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sketch/sparki_motors_util.ino.cpp" -o "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sketch/sparki_motors_util.ino.cpp.o"
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/Radio.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/SPI.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/Sparki.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/SparkiEEPROM.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/SparkiWire.cpp.o
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-gcc" -c -g -x assembler-with-cpp -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino" "-I/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/variants/leonardo" "/home/bill/Downloads/arduino-1.6.7/hardware/arduino/avr/cores/arduino/wiring_pulse.S" -o "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_pulse.S.o"
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/WInterrupts.c.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/hooks.c.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring.c.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_analog.c.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_digital.c.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_pulse.c.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_shift.c.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/CDC.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial0.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial1.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial2.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial3.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/IPAddress.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/PluggableUSB.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/Print.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/Stream.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/Tone.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/USBCore.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/WMath.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/WString.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/abi.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/main.cpp.o
Using previously compiled file: /tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/new.cpp.o
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_pulse.S.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/WInterrupts.c.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/hooks.c.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring.c.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_analog.c.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_digital.c.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_pulse.c.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/wiring_shift.c.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/CDC.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial0.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial1.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial2.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/HardwareSerial3.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/IPAddress.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/PluggableUSB.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/Print.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/Stream.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/Tone.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/USBCore.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/WMath.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/WString.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/abi.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/main.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-ar" rcs  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/new.cpp.o"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-gcc" -w -Os -Wl,--gc-sections -mmcu=atmega32u4  -o "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sparki_motors_util.ino.elf" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sketch/sparki_motors_util.ino.cpp.o" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/Radio.cpp.o" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/SPI.cpp.o" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/Sparki.cpp.o" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/SparkiEEPROM.cpp.o" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/libraries/Sparki/SparkiWire.cpp.o" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/core/core.a" "-L/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp" -lm
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sparki_motors_util.ino.elf" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sparki_motors_util.ino.eep"
"/home/bill/Downloads/arduino-1.6.7/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom  "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sparki_motors_util.ino.elf" "/tmp/build73e5710f10f17f54cbc99e616750bdf1.tmp/sparki_motors_util.ino.hex"
Using library Sparki at version 1.661 in folder: /home/bill/Arduino/libraries/Sparki

Sketch uses 20,104 bytes (70%) of program storage space. Maximum is 28,672 bytes.
Global variables use 2,588 bytes (101%) of dynamic memory, leaving -28 bytes for local variables. Maximum is 2,560 bytes.
processing.app.debug.RunnerException: Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.
   at cc.arduino.Compiler.size(Compiler.java:319)
   at cc.arduino.Compiler.build(Compiler.java:156)
   at processing.app.Sketch.build(Sketch.java:1108)
   at processing.app.Sketch.build(Sketch.java:1083)
   at processing.app.Editor$BuildHandler.run(Editor.java:2011)
   at java.lang.Thread.run(Thread.java:745)
Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.
banda
 
Posts: 12
Joined: Sat Jan 02, 2016 11:28 pm

Re: Sparki / Python Library

Postby radarjd » Tue Jan 26, 2016 12:58 am

banda wrote:Bit of bad luck, I'm afraid: I was unable to successfully compile the sparki_motors_util.ino sketch. Not enough memory.
I'm using Arduino 1.6.7, and for "Board", I've selected "Arduino Leonardo".


I have never personally compiled using Arduino software -- only the Sparkiduino with the ArcBotics Sparki board selected. It compiles without issue on my machine with those settings. Have you tried the Sparkiduino software?

Wait, you're on Ubuntu, so maybe that isn't an option for you? It looks from your error like the global variables are the problem (
Code: Select all
Global variables use 2,588 bytes (101%) of dynamic memory, leaving -28 bytes for local variables. Maximum is 2,560 bytes.
), which is odd, because that sketch should use less global space than the main library.

Hmmm... so, if you're comfortable editing Sparki.h, you could uncomment //#define NO_MAG and //#define NO_ACCEL (but you'll have to remember to re-comment those). I don't know if that will fix the global variable issue, though.

Perhaps the compiler is statically allocating space for the debug strings as globals? I have no idea how the arduino compiler works -- I would not call those global variables, but perhaps it includes those... I'm trying to figure out how you could be exceeding the available space. My guess is that Sparki is closest to a Leonardo but not actually a Leonardo, which is why you would get a different amount of memory available -- that's just a guess, though. If you want to try out this theory, you could comment out the printDebugs inside the setup() function (just put a // at the beginning of the line), and then try to re-upload. Sorry I'm not of more help here -- I don't have access to a linux machine to try this. I've got a raspberry pi that I could repurpose, but don't have the time right now.
radarjd
 
Posts: 21
Joined: Wed Feb 11, 2015 6:26 pm

Re: Sparki / Python Library

Postby radarjd » Tue Feb 02, 2016 3:26 pm

radarjd wrote:Perhaps the compiler is statically allocating space for the debug strings as globals? I have no idea how the arduino compiler works -- I would not call those global variables, but perhaps it includes those... I'm trying to figure out how you could be exceeding the available space. My guess is that Sparki is closest to a Leonardo but not actually a Leonardo, which is why you would get a different amount of memory available -- that's just a guess, though. If you want to try out this theory, you could comment out the printDebugs inside the setup() function (just put a // at the beginning of the line), and then try to re-upload.


I uploaded a very minor revision of sparki_motors_util.ino that comments out those strings to see if it fixes the issues.

I also uploaded a revised sparki_myro.py library with the DEBUG version, and a new command: getUptime() which returns the number of milliseconds since the robot was initialized.
radarjd
 
Posts: 21
Joined: Wed Feb 11, 2015 6:26 pm

Re: Sparki / Python Library

Postby radarjd » Sun Mar 06, 2016 12:50 am

I just pushed a new update to the github repository (https://github.com/radarjd/sparki_learning) with version 1.1.0 of the python library containing what I'm calling the "grid commands". The following commands have been added:
drawFunction(function, xvals) - draws the function given on the coordinate plane; the function given as the argument should be a lambda function which calculates the y coordinate for a given x; the xvals argument should be an iterable of the x values for which to calculate a y value; a test / example python file has also been added demonstrating the use of this function

getAngle() - returns the current heading of the robot in degrees, where Sparki starts at 0 degrees when initialized; only turns done through turnBy() will be "tracked" for the purposes of this command; a heading of 0 is treated as going up the y axis

getPosition() - returns the current position of Sparki on the coordinate plane

moveBy(x,y) - moves to the x,y position relative to the current position; the behavior of this command is exactly the same as a moveTo() executed immediately following initialization

moveTo(x,y) - moves to the x,y position indicated on the coordinate plane

resetPosition() - resets the position to a heading of 0 and a current position of 0,0

setAngle(degrees) - sets the current heading of the Sparki

setPosition(x,y) - sets the current position on the coordinate plane

The turnTo(degrees) command has had its behavior changed since the previous version. It will now turn to the heading given as the argument.

The python library will maintain an internal x,y coordinate on a coordinate plane so long as you're using the moveTo() and moveBy() commands. drawFunction() uses moveTo() internally, and so will also maintain the current coordinates.

Each integer position is 1cm away from the next. That is, 0,1 is one cm up the y axis from 0,0. 1,1 is sqrt(2) cm from 0,0.

The commands rely on the Sparki's internal moveBackward(), moveForward(), moveLeft() and moveRight() commands which seem to be quite accurate. The shapes that you can draw with the coordinate plane are very cool.

I have updated the increasingly inaccurately named "quick" reference to include descriptions of the new commands.

For the next update, I'm hoping to get a setup.py working, and then upload the library to Pypi for easy distribution.

Please let me know if any bugs, errors, etc.

edit: noted change in behavior for turnTo()
radarjd
 
Posts: 21
Joined: Wed Feb 11, 2015 6:26 pm

Re: Sparki / Python Library

Postby radarjd » Thu Mar 17, 2016 6:53 pm

I just uploaded a new version of the library (https://github.com/radarjd/sparki_learning) which simply moved the files around. I'm preparing to provide a setup.py file, and to post the library on PyPI. To do that, I wanted a more sane directory structure.

All files which might be used on the Sparki itself are now located in the sparkiduino folder. The sparki_myro library to be loaded onto your sparki can be downloaded from there.

Example / test files are found in the examples folder.

Documentation (excepting the readme) are located in the docs folder. I intend to write a non-Word version of the documentation.

The main python library is in the sparki_learning subfolder, which is how this library will be known on PyPI (at least, that's my intention).

Finally, I wanted to mention that I have tried out the library on Python 2.7 and everything appears so far to work just fine. I'd be interested to know if anyone else has success on 2.7.
radarjd
 
Posts: 21
Joined: Wed Feb 11, 2015 6:26 pm

Re: Sparki / Python Library

Postby radarjd » Tue Mar 22, 2016 5:06 pm

The library is now available on PyPI - the Python Package Index - at https://pypi.python.org/pypi/sparki-learning. Note that there's a dash instead of an underscore. I can't figure out how to fix that.

So, if you've already got the code loaded onto your sparki using the Sparkiduino software, and you have a valid python install, you should just be able to do:
Code: Select all
easy_install sparki-learning

and it will take care of any necessary dependencies and install the library into the proper location.

If you download the code from github, you can install the library from its directory with:
Code: Select all
python setup.py install


Please let me know if there are problems with this. I've tested it some, and I'm going to test it more. I'm intending to look at the sparkiduino software next to see if I can fit a couple more LCD commands onto it. I've also got a pair of library commands in testing which are intended to make it easier to sync multiple sparkis actions.
radarjd
 
Posts: 21
Joined: Wed Feb 11, 2015 6:26 pm

Re: Sparki / Python Library

Postby radarjd » Tue Apr 05, 2016 11:11 pm

While working on a revision to add some EEPROM commands and allow drawing lines and strings, the motors() problem reported by banta has reappeared. The motors() command works just fine on the sparki itself, but when sent a motors commands from python, it does not work. Specifically, the robot turns the right wheel on full power and the left wheel on at 1% power. I'm trying to figure out why as the python code hasn't changed at all. My best guess at present is a memory (RAM) issue, but I'm continuing to debug this.

Also, does anyone know if the behavior of systemVoltage() from Sparki.cpp has changed intentionally? Previously, it was returning a voltage which appeared to be accurate, but with the most recent version of Sparkiduino, it appears the voltage is reported as being much lower.
radarjd
 
Posts: 21
Joined: Wed Feb 11, 2015 6:26 pm

Re: Sparki / Python Library

Postby radarjd » Thu Apr 07, 2016 1:45 pm

radarjd wrote:While working on a revision to add some EEPROM commands and allow drawing lines and strings, the motors() problem reported by banta has reappeared. The motors() command works just fine on the sparki itself, but when sent a motors commands from python, it does not work. Specifically, the robot turns the right wheel on full power and the left wheel on at 1% power. I'm trying to figure out why as the python code hasn't changed at all. My best guess at present is a memory (RAM) issue, but I'm continuing to debug this.


I believe I have figured out the problem and fixed it in the most recent version, which is available on github (https://github.com/radarjd/sparki_learning and pypi "easy_install sparki-learning").

Prior to this version, the call to motors() in the .ino file looked like this:
Code: Select all
case COMMAND_MOTORS:              // int, int, float; returns nothing
      motors(  getSerialInt(), getSerialInt(), getSerialFloat() );
      break;

On the version of Sparkiduino I originally used to develop the code, that worked just fine. However, with the newest version of Sparkiduino, the above call would cause the variables to become "jumbled". The argument passed over the serial part for time was used for the left wheel (which is the first argument), and the argument passed over the serial port for the left wheel speed was used for the time (which is the last argument). I had thought it was a memory issue, because it used to work and then suddenly did not. However, debugging the code, I figured out that the arguments were actually being passed on the wrong order because the compiler was performing the getSerialFloat() call first. Each of the getSerial_____() calls checks the serial port for information and reads off whatever is available up until the terminator character. It is critical, therefore, that the calls happen in the right order. That is, if the data coming in to the serial port looks like this:
50, 50, 1.5
the order that the data must be read should be left_speed, right_speed, time. That's the order I wrote it in the call above ( getSerialInt(), getSerialInt(), getSerialFloat() ). The compiler, however, processed the calls from right to left instead of left to right, so it was doing the getSerialFloat() first, and passing the value of 50 to the function. To fix this problem, I had to ensure the calls were made in the correct order, so I changed the code to
Code: Select all
case COMMAND_MOTORS:              // int, int, float; returns nothing
      {
      int left_speed = getSerialInt();
      int right_speed = getSerialInt();
      int time_length = getSerialFloat();     
      motors( left_speed, right_speed, time_length );
      break;
      } // end COMMAND_MOTORS

This appears to fix the motors issue which user banda first reported some time ago (and if he or she is still around, I'd love to know if this did indeed fix the problem). Several other calls were done the same way in the switch statement, and I changed those to follow this paradigm as well.

The most recent release also includes the following new commands:
EEPROMread(location, amount) - Reads amount bytes of data at location in the EEPROM.

EEPROMwrite(location, data) - Writes data to location in the EEPROM.

LCDdrawLine() - Draws a line from X1, Y1 to X2, Y2 on the LCD.

LCDdrawString()- Prints message to the LCD on the back of Sparki at the X, Y coordinate given.

LCDreadPixel() - Returns True if the color of the pixel at X, Y on the LCD is colored in; otherwise returns False.

Please let me know if you find any issues.
radarjd
 
Posts: 21
Joined: Wed Feb 11, 2015 6:26 pm

Re: Sparki / Python Library

Postby Stephen » Sat Apr 09, 2016 12:26 pm

Hi, I want to send commands from my android device to Sparki using sparki_myro. What are the commands and the string format required to send to Sparki. Please advise.

Thank you very much.
Stephen
 
Posts: 5
Joined: Sat Apr 09, 2016 12:11 pm

PreviousNext

Return to Sparki

Who is online

Users browsing this forum: No registered users and 1 guest