jeremiedecock / pyax12

Python library to control Dynamixel AX-12 actuators.
MIT License
18 stars 10 forks source link

I cant connect from my Rasberry pi 3 ?? #6

Open CreiUnord opened 6 years ago

CreiUnord commented 6 years ago

I tried to run this program: from pyax12.connection import Connection sc = Connection(port=”/dev/ttyACM0″, baudrate=1000000) ids = sc.scan() for id in ids: print(id) sc.close()

I got this errormessage: Traceback (most recent call last): File "ax12-1.py", line 3, in ids = sc.scan() File "/usr/local/lib/python3.5/dist-packages/pyax12/connection.py", line 488, in scan if self.ping(dynamixel_id): File "/usr/local/lib/python3.5/dist-packages/pyax12/connection.py", line 231, in ping status_packet = self.send(inst_packet) File "/usr/local/lib/python3.5/dist-packages/pyax12/connection.py", line 141, in send status_packet = sp.StatusPacket(status_packet_bytes) File "/usr/local/lib/python3.5/dist-packages/pyax12/status_packet.py", line 118, in init raise ValueError("Incomplete packet.") ValueError: Incomplete packet.

My version of Python is 3.5

Please help, regards Christian

msvargas commented 4 years ago

i have same issue, bad change baud_rate to 57600 working good, some times, what do you do?

CreiUnord commented 4 years ago

Its a long time ago, but I think this solved it: Install PyAX12 library: (Note that “pip” by default on the Raspberry Pi will try to install it under Python 2 which won’t work.) wget https://github.com/jeremiedecock/pyax12/archive/master.zip unzip master.zip cd pyax12-master sudo python3 setup.py install

msvargas commented 4 years ago

Thanks!

CreiUnord commented 4 years ago

I hoped it solved your problem. I am very interrested in sharing experience with pyax12 and Dynamixel actuators.

msvargas commented 4 years ago

I hoped it solved your problem. I am very interrested in sharing experience with pyax12 and Dynamixel actuators.

Thanks, i am currently with 4 motors, how do you have read present position ,speed ... at the time, using polling? intervals 100ms, its good idea? if you share tips about programming or other things

Sorry my english

CreiUnord commented 4 years ago

I just shared a repository with you. Its not perfect code, but I hope it will help you

msvargas commented 4 years ago

I just shared a repository with you. Its not perfect code, but I hope it will help you

Thank you!

aibnus commented 4 years ago

hey, I tried to ping my dynamixel ax12 using your example ping for raspberry pi. But I got this message

/usr/local/lib/python3.5/dist-packages/pyax12-0.5.dev3-py3.5.egg/pyax12/connection.py:78: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
Traceback (most recent call last):
  File "ping.py", line 9, in <module>
    is_available = serial_connection.ping(dynamixel_id)
  File "/usr/local/lib/python3.5/dist-packages/pyax12-0.5.dev3-py3.5.egg/pyax12/connection.py", line 231, in ping
  File "/usr/local/lib/python3.5/dist-packages/pyax12-0.5.dev3-py3.5.egg/pyax12/connection.py", line 141, in send
  File "/usr/local/lib/python3.5/dist-packages/pyax12-0.5.dev3-py3.5.egg/pyax12/status_packet.py", line 118, in __init__
ValueError: Incomplete packet.

I install this library using sudo python3 setup.py install and python3 ping.py to run the program

msvargas commented 4 years ago

hey, I tried to ping my dynamixel ax12 using your example ping for raspberry pi. But I got this message

/usr/local/lib/python3.5/dist-packages/pyax12-0.5.dev3-py3.5.egg/pyax12/connection.py:78: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
Traceback (most recent call last):
  File "ping.py", line 9, in <module>
    is_available = serial_connection.ping(dynamixel_id)
  File "/usr/local/lib/python3.5/dist-packages/pyax12-0.5.dev3-py3.5.egg/pyax12/connection.py", line 231, in ping
  File "/usr/local/lib/python3.5/dist-packages/pyax12-0.5.dev3-py3.5.egg/pyax12/connection.py", line 141, in send
  File "/usr/local/lib/python3.5/dist-packages/pyax12-0.5.dev3-py3.5.egg/pyax12/status_packet.py", line 118, in __init__
ValueError: Incomplete packet.

I install this library using sudo python3 setup.py install and python3 ping.py to run the program

Check the baud rate, you can testing with 57600, the comunication its very sensible and i change delays from disable/enable DTS pin

msvargas commented 4 years ago

Otherwise, i share my fork of Dynamixel SDK oficial with custom linux_sbc changes to working with raspberry, the installation steps you found in oficial doc, https://github.com/punisher97/DynamixelSDK

aibnus commented 4 years ago

Otherwise, i share my fork of Dynamixel SDK oficial with custom linux_sbc changes to working with raspberry, the installation steps you found in oficial doc, https://github.com/punisher97/DynamixelSDK

Is it compatible with ROS using Raspberry Pi?

msvargas commented 4 years ago

Otherwise, i share my fork of Dynamixel SDK oficial with custom linux_sbc changes to working with raspberry, the installation steps you found in oficial doc, https://github.com/punisher97/DynamixelSDK

Is it compatible with ROS using Raspberry Pi?

only c++

aibnus commented 4 years ago

I change the baudrate to 57600 and it works just fine.