Python error when starting a Poppy torso

Hi, I start here a new topic for our new Poppy Humanoid (upper half) at Telecom Bretagne.

So up until now we managed to assemble the hardware, and change the ids of the motors (with Dynamixel Wizard).
I can detect all the motors with herborist (on macos) and Dynamixel Wizard (on windows), but when I launch the try to connect to the robot with python, there is an error. I run the following code:

from poppy.creatures import PoppyHumanoid

poppy = PoppyHumanoid()

I get first the error:

Traceback (most recent call last):
File “”, line 1, in
File “/Library/Python/2.7/site-packages/poppy_creature-1.3.0-py2.7.egg/poppy/creatures/abstractcreature.py”, line 72, in new
poppy_creature = from_json(config, sync)
File “/Library/Python/2.7/site-packages/pypot/robot/config.py”, line 200, in from_json
return from_config(config, sync=sync)
File “/Library/Python/2.7/site-packages/pypot/robot/config.py”, line 58, in from_config
check_motor_limits(config, dxl_io, motor_names)
File “/Library/Python/2.7/site-packages/pypot/robot/config.py”, line 152, in check_motor_limits
dxl_io.set_angle_limit(changed_angle_limits)
File “/Library/Python/2.7/site-packages/pypot/dynamixel/io/abstract_io.py”, line 321, in set_angle_limit
if ‘wheel’ in self.get_mode(limit_for_id.keys()):
File “/Library/Python/2.7/site-packages/pypot/dynamixel/io/abstract_io.py”, line 298, in get_mode
return tuple(self._known_mode[id] for id in ids)
File “/Library/Python/2.7/site-packages/pypot/dynamixel/io/abstract_io.py”, line 298, in
return tuple(self._known_mode[id] for id in ids)
KeyError: 32

and when I call again “poppy = PoppyHumanoid();”, I get the error :

Traceback (most recent call last):
File “”, line 1, in
File “/Library/Python/2.7/site-packages/poppy_creature-1.3.0-py2.7.egg/poppy/creatures/abstractcreature.py”, line 72, in new
poppy_creature = from_json(config, sync)
File “/Library/Python/2.7/site-packages/pypot/robot/config.py”, line 200, in from_json
return from_config(config, sync=sync)
File “/Library/Python/2.7/site-packages/pypot/robot/config.py”, line 56, in from_config
dxl_io = dxl_io_from_confignode(config, c_params, attached_ids, strict)
File “/Library/Python/2.7/site-packages/pypot/robot/config.py”, line 105, in dxl_io_from_confignode
port = pypot.dynamixel.find_port(ids, strict)
File “/Library/Python/2.7/site-packages/pypot/dynamixel/init.py”, line 60, in find_port
raise IndexError(‘No suitable port found for ids {}!’.format(ids))
IndexError: No suitable port found for ids [31, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 51, 52, 53, 54]!

What is strange is that these ids are exactly those that are seen by herborist and Dynamixel Wizard.

If you use the poppy_humanoid python package for a Poppy torso, It won’t work for sure.

You have a custom Poppy creature so you will have to create your custom code.

Maybe a first step would be to look at the pypot documentation here: http://poppy-project.github.io/pypot/controller.html

Then fork fork the Poppy torso repository, and create a software architecture similar with the Poppy Humanoid i.e. software folder with “poppy_torso_telecom” package, configuration (.json) file and so on.

BTW for the configuration file, you have just to copy the one of Poppy Humanoid and delete all parts you do not have.

Hope it will help you to start you robot :slight_smile:

Hi,

i’ve been working very slowly on this, I can now use the robot with the python command:
ergo = pypot.robot.from_json(‘poppy_torso/configuration/poppy_torso.json’)

I am now trying to use it with snap. I managed to use snap with the simulator vrep on the poppy-humanoid, and am now trying to use it with our robot (controlled by computer running macos yosemite).

  1. Is there an option for snap with the same command (pypot.robot.from_json)?

  2. I read from the doc http://nbviewer.ipython.org/github/poppy-project/pypot/blob/master/samples/notebooks/Controlling%20a%20Poppy%20Creature%20using%20SNAP.ipynb, that there was a poppy-snap command. But I can not use it. I have updated all pypot, poppy-humanoid (I tried both from pip, uninstalled it from pip and reinstalled it from the latest git source files), but I get :

-bash: poppy-snap: command not found

The only command I seem to have from my terminal is poppy-motor-reset.

  1. I tried to use, after updating poppy-torso (again both through pip and the latest git source files):

    from poppy.creatures import PoppyTorso
    poppy = PoppyTorso()

But I only get the error when I try to import the module:

Traceback (most recent call last):
File “”, line 1, in
ImportError: cannot import name PoppyTorso

Do you have any idea how to use snap for my poppy-torso?

Also I was wondering with the snap program pypot-snap-record-orchestration-demo.xml, where are stored the recorded movement files, in order to be re-used later on?