x75 / lombi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lumpi

lombi explained

lombi[1] is a controller for "the hex", our first piece of robot furniture[2] we created at the lab jetpack. the hex consists of six triangular tiles as structural elements. each element is a sensorimotor node (smnode). it is a cellular automaton on a triangular grid. the update rule for each smnode are identical. in addition to being influenced by neighbor states, each smnode responds to sensors attached to it.

[1] lombi, Limbo, Lombi, Lompi - alluding to a lamp

[2] smart home appliances

jcl: hex instructions

If you want to work on the hex this is a workflow of how to do it

  1. Turn on hex on the power chord main switch. Raspberry and sensorimotor

network will boot up, LEDs will be flashing briefly from sensorimotor init.

  1. On your machine open the atom editor

  2. In atom, go to Menu -> Packages -> Remote Atom -> Start Server

This setup is using the remote-atom package, see https://atom.io/packages/remote-atom

  1. With the remote atom server started, now open or go to a terminal. In the terminal type
ssh hex

This will log you in on the hex raspberry. The full ssh command is

ssh -R 52698:localhost:52698 user@example.com

Suggest to setup ssh key authentication and put the ssh tunnel into ~.ssh/config

  1. Logged in on the hex raspberry you will see this prompt
pi@tauntaun:~ $ 
  1. With this prompt, type
pi@tauntaun:~ $ cd work/Limbo/

This takes you to the Limbo working directory

  1. Now you can run the code for the hex by typing
pi@tauntaun:~ $ python3 lombi-hex-1.py --hardware --clock-freq 0.1

or something similar

  1. In the same terminal, press Control-C twice to stop the script

  2. If you didn't do so already, type

pi@tauntaun:~ $ rmate lombi-hex-1.py

This will open the Python file on the hex raspberry in the Atom editor running on your local machine.

  1. Go to atom, change the code and save your changes

  2. Go to terminal run the script again, Control-C twice to stop it, repeat the loop

  1. If there is an error saying -16 cannot access / open sensorimotor something, that means another script is already running. You need to stop that before you can run you script. To stop it type into the terminal

$ ps ax | grep python

The output should look like this

pi@tauntaun:~ $ ps ax| grep python
 1433 pts/3    Sl+    0:05 /usr/bin/python ./example_node_io.py
 1440 pts/4    S+     0:00 grep --color=auto python
pi@tauntaun:~ $ 

Using the number on the left (here it is 1433) of the sensorimotor script (here it's examplenodeio.py), you can stop the process by typing

pi@tauntaun:~ $ kill 1433

This will stop the currently running script and free the sensorimotor driver for another program.

sensorimotor loop callback

from component refactor change log, rewrote the hex controller to do all the standard setup and bookkeeping stuff only once and provide a blank sensorimotor "shell" where you can plug in your smloop callback. not quite perfect yet but it's working on the real thing.

little bit more work and we will be able to work with only smloop code snippets quite a bit. with the new API know-how we're starting to have, it will be a springtime walk to make a browser UI for posting sensorimotorloop definitions to the live engine. in combination with a webcam this should be really fun down the road and allow to work on it from remote.

integrated the original example_node_io from libsensorimotor

added a SensorimotorDummy class that can be used for testing without having the sensorimotor hardware attached.

TODO

1/ WIP refactor into combination of three components: the sensorimotor loop spec, the sensorimotor driver, the simulation driver.

2/ WIP communication via OSC or other channel

3/ create startup script starting all components into multiprocessing Processes

About


Languages

Language:Python 100.0%