Using only 4 motors on Ergo Jr

Hello, it’s me again!

Thanks to you, i’m able to use a OpenCV camera on my raspberry. I don’t have any problem using the classic Ergo jr with its 6 motors.
I would like to use a 4 motors Ergo Jr on my raspberry too, but at init i cant use the robot. Jupyter told me:

DxlError: Could not find the motors (5, 6) on bus /dev/ttyAMA0.

Is there a way to say to the raspberry “i want to work on only 4 motors this time”, with m5=‘dummy’ in PoppyErgoJr() or something like that?Do i need to configure the config.txt instead?

Thanks for reading!

Corentin

Hi,
You have to edit the ErgoJr configuration file.
You can edit it from Jupyter interface at this URL (change poppy by your robot hostname) http://poppy.local:8888/edit/poppy_src/poppy_ergo_jr/configuration/poppy_ergo_jr.json
You have to remove them from the config file or add an argument “broken=True” in the motor configuration (in the same json file).
And remove, in edit the ErgoJr .py starter file (http://pythias.local:8888/edit/poppy_src/poppy_ergo_jr/poppy_ergo_jr.py), all attached primitives, because the name of this motors are in the definition of primitives

hello!

I did as you said:

{
“controllers”: {
“my_dxl_controller”: {
“sync_read”: true,
“protocol”: 2,
“attached_motors”: [
“base”,
“tip”
],
“port”: “/dev/ttyAMA0”,
“syncloop”: “LightDxlController”
}
},
“motorgroups”: {
“base”: [
“m1”,
“m2”,
“m3”
],
“tip”: [
“m4”,
“m5”,
“m6”
]
},
“motors”: {
“m1”: {
“offset”: 0.0,
“type”: “XL-320”,
“id”: 1,
“angle_limit”: [
-90.0,
90.0
],
“orientation”: “direct”
},
“m2”: {
“offset”: 0.0,
“type”: “XL-320”,
“id”: 2,
“angle_limit”: [
-90.0,
125.0
],
“orientation”: “indirect”
},
“m3”: {
“offset”: 0.0,
“type”: “XL-320”,
“id”: 3,
“angle_limit”: [
-90.0,
90.0
],
“orientation”: “indirect”
},
“m4”: {
“offset”: 0.0,
“type”: “XL-320”,
“id”: 4,
“angle_limit”: [
-90.0,
90.0
],
“orientation”: “direct”
},
“m5”: {
“offset”: 0.0,
“type”: “XL-320”,
“id”: 5,
“angle_limit”: [
-90.0,
90.0
],
“broken”:“True”,
“orientation”: “indirect”
},
“m6”: {
“offset”: 0.0,
“type”: “XL-320”,
“id”: 6,
“angle_limit”: [
-90.0,
90.0
],
“broken”:“True”,
“orientation”: “indirect”
}
},
“sensors”: {
“camera”: {
“type”: “OpenCVCamera”,
“index”: -1,
“fps”: 20.0,
“resolution”: [640, 480]
},
“marker_detector”: {
“type”: “MarkerDetector”,
“cameras”: [“camera”],
“freq”: 1.0,
“need_robot”: true
}
}
}
I run my normal init:

%pylab inline
from poppy.creatures import PoppyErgoJr
from pypot.primitive.move import MovePlayer
from pypot.primitive.move import MoveRecorder
poppy=PoppyErgoJr(camera=‘dummy’)
import time
from future import print_function
from copy import deepcopy

but i dont have Populating the interactive namespace from numpy and matplotlib, which appears when the block ends.
If i check the kernel it looks busy, and i cant use blocks from the notebook anymore.
Is there an infinite loop somewhere?

Apologies for reviving an old thread, but I have the same issue. I want to use Poppy Ergo Jr with 5 motors instead of 6, but I run into the same problem.

I tried erasing m6 from the poppy_ergo_jr.json file, I also tried putting it as broken=true, both attempts give me this error when I try to start Poppy Ergo Jr. from jupyter:

ValueErrorTraceback (most recent call last)
in ()
1 from pypot.creatures import PoppyErgoJr
2
----> 3 poppy = PoppyErgoJr(camera=‘dummy’)
4
5 # If you want to use the robot with the camera unpluged,

/home/poppy/miniconda/lib/python2.7/site-packages/pypot/creatures/abstractcreature.pyc in new(cls, base_path, config, simulator, scene, host, port, id, use_snap, snap_host, snap_port, snap_quiet, use_http, http_host, http_port, http_quiet, use_remote, remote_host, remote_port, use_ws, ws_host, ws_port, start_background_services, sync, **extra)
158 logger.info(‘Ws server is now running on: ws://{}:{}\n’.format(ws_host, ws_port))
159
→ 160 cls.setup(poppy_creature)
161
162 if start_background_services:

/home/poppy/miniconda/lib/python2.7/site-packages/poppy_ergo_jr/poppy_ergo_jr.pyc in setup(cls, robot)
21 motors=robot.motors,
22 passiv=,
—> 23 tip=[0, 0, -0.07])
24
25 robot.chain = c

/home/poppy/miniconda/lib/python2.7/site-packages/pypot/creatures/ik.pyc in from_poppy_creature(cls, poppy, motors, passiv, tip, reversed_motors)
31 base_elements=chain_elements,
32 last_link_vector=tip,
—> 33 active_links_mask=activ)
34
35 chain.motors = [getattr(poppy, l.name) for l in chain.links[1:-1]]

/home/poppy/miniconda/lib/python2.7/site-packages/ikpy-2.2.1-py2.7.egg/ikpy/chain.pyc in from_urdf_file(cls, urdf_file, base_elements, last_link_vector, base_element_type, active_links_mask, name)
123 links = URDF_utils.get_urdf_parameters(urdf_file, base_elements=base_elements, last_link_vector=last_link_vector, base_element_type=base_element_type)
124 # Add an origin link at the beginning
→ 125 return cls([link_lib.OriginLink()] + links, active_links_mask=active_links_mask, name=name)
126
127 def active_to_full(self, active_joints, initial_position):

/home/poppy/miniconda/lib/python2.7/site-packages/ikpy-2.2.1-py2.7.egg/ikpy/chain.pyc in init(self, links, active_links_mask, name, profile, **kwargs)
30 if active_links_mask is not None:
31 if len(active_links_mask) != len(self.links):
—> 32 raise ValueError(“Your active links mask length of {} is different from the number of your links, which is {}”.format(len(active_links_mask), len(self.links)))
33 self.active_links_mask = np.array(active_links_mask)
34 # Always set the last link to True

ValueError: Your active links mask length of 7 is different from the number of your links, which is 8

Has someone been able to use Poppy Ergo Jr. with less than 6 motors?

Thank you for your help!

hello @cbertin

Have you erasing the m6 ref in a motorgroups ?

also, you can use the version of ergo creature:

Thank you for your reply! I got it to work by removing mention of m6 in the configuration file mentioned above, removing mention of m6 from all the primitives (dance.py, jump.py, etc…). Also commented the following lines from poppy_ergo_jr.py

    c = IKChain.from_poppy_creature(robot,
                                    motors=robot.motors,
                                    passiv=[],
                                    tip=[0, 0, -0.07])

    robot.chain = c

Thank you for your help, and hope this helps someone else!

1 Like