Robot Python code execution errors

Hi all !
I’m working on a new robot based on Pypot with XL-320 motors . When I execute my code I get differents errors like this:

If someone can post something can explain these, I’ll appreciate ! :smile:

Thank’s in advance !

Can you see here :

1 Like

My .json file works, the error in this post was by an other controller but i have an USB2AX and i tried the code he write. Nothing works …

@Pierre I call you ! If you have any solutions … ? :weary:

As said in the exception, the first one is only raised during interpreter shutdown (so after your program stops) and the two others look to me like connection issues. I can’t tell much more without seeing any code or example that I could try…

1 Like

there is my test code:

import json 
import pypot.robot
import time 
import contextlib
config_file = 'config2.json'

with open(config_file) as f:
    robot_config = json.load(f)
print robot_config
print ('Config affichee')
test_robot = pypot.robot.from_json('config2.json')

test_robot.start_sync()
test_robot.motors.goal_speed = 200
for m in test_robot.motors: 
    m.compliant = False
    m.goal_position = 0

test_robot.stop_sync() 

test_robot.close()

@YusufGkl, I didn’t test your code, but if the problem is that your robot don’t react at all, try to add

time.sleep(0.1) 

before stopping sync, so the messages have some time to be sent.

1 Like

Hi @Manon ! I tried it and i have nothing change, same errors. It works often.

Do you mean that most of the time your code produce the expected behaviour and sometimes not? If this is the case, it’s likely to be a electric issue. When it’s working, do you have a lot of timeout or communication error issues ?

The code works 1 time and i get 3 or 4 times errors. I power off the robot and switch on, the code re-works.
I wired the robot like this sheme: USB2AX >XL cable + AX cable > OpenCM9 > XL-320’s (and DIY Hub)
The OpenCM9 act like a Powered hub, no code in there.

We often have this kind of errors when one of the wire is slightly damaged (it could also be a motor but it’s less frequent). Unfortunately we did not find a better solution to find out that trying with one motor at a time…

1 Like

I tried to switch 3P cables, nothing works. Can this may be due by the OpenCM9 ? I think not but it’s a possibility…