[python2] Roboclaw instance has no attribute '_port'

General discussion of using Roboclaw motor controllers
Post Reply
felix
Posts: 19
Joined: Thu Dec 03, 2020 8:08 am
[python2] Roboclaw instance has no attribute '_port'

Post 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
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: [python2] Roboclaw instance has no attribute '_port'

Post 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.
felix
Posts: 19
Joined: Thu Dec 03, 2020 8:08 am
Re: [python2] Roboclaw instance has no attribute '_port'

Post 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.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: [python2] Roboclaw instance has no attribute '_port'

Post 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.

Post Reply