Page 1 of 1

[python2] Roboclaw instance has no attribute '_port'

Posted: Tue Dec 15, 2020 8:19 am
by felix
Hi,

I'm currently duplicating the code to control my 2x60A roboclaws on a new robot.

When trying to execute my code, I get a strange error :

Code: Select all

Traceback (most recent call last):
  File "/home/boroboxavier1/catkin_ws/src/borobo_ros/roboclaw/script/roboclaw_node.py", line 266, in <module>
    roboclaw_node.runRoboClawNode()
  File "/home/boroboxavier1/catkin_ws/src/borobo_ros/roboclaw/script/roboclaw_node.py", line 205, in runRoboClawNode
    self.getSpeed()
  File "/home/boroboxavier1/catkin_ws/src/borobo_ros/roboclaw/script/roboclaw_node.py", line 230, in getSpeed
    buffer_g_front = roboclaw.ReadSpeedM1(ADDRESS_FRONT)
  File "/home/boroboxavier1/catkin_ws/src/borobo_ros/roboclaw/script/roboclaw.py", line 697, in ReadSpeedM1
    return self._read4_1(address,self.Cmd.GETM1SPEED)
  File "/home/boroboxavier1/catkin_ws/src/borobo_ros/roboclaw/script/roboclaw.py", line 253, in _read4_1
    self._port.flushInput()
AttributeError: Roboclaw instance has no attribute '_port'
Do you have any idea what might be wrong?

I already installed pyserial, added the user to dialout group, and checked that the port /dev/ttyTHS0 exist
Hardware : Jeton xavier AGX developper kit, connected to 2 roboclaws 2x60A in serial (using GPIO, not USB)

Thanks a lot in advance
Felix

PS : please fin attached the corresponding ros node :
roboclaw_node.zip
(2.76 KiB) Downloaded 181 times

Re: [python2] Roboclaw instance has no attribute '_port'

Posted: Tue Jan 19, 2021 10:04 am
by Basicmicro Support
This indicates opening the virtual comport failed. Make sure you used the proper name of the comport. Windows and Linux use completely different naming conventions.

Re: [python2] Roboclaw instance has no attribute '_port'

Posted: Fri Jan 29, 2021 5:57 am
by felix
Hi,
Thanks.

The problem happens to be quite specific to the Jetson computer : the UART output is by default reserved for Serial debugging : in order to use it with the roboclaws, I had to disable the UART debugging.

Re: [python2] Roboclaw instance has no attribute '_port'

Posted: Thu Feb 18, 2021 11:02 am
by Basicmicro Support
Thank you for posting this. We have had multiple Jetson users in the past that had issues and never had a resolution. This will help immensely.