AttributeError: Roboclaw instance has no attribute '_port'

General discussion of using Roboclaw motor controllers
uzair3991
Posts: 1
Joined: Mon May 28, 2018 1:46 am

AttributeError: Roboclaw instance has no attribute '_port'

Postby uzair3991 » Mon May 28, 2018 2:30 am

I am working with very simple code with ROS.
the code was working before.

then i used (roboclaw_speedaccel) this code with the driver. the motor begin to run very fast. I turned off it from main power.

now again my previous code is not working not any otherone. it give this error (AttributeError: Roboclaw instance has no attribute '_port')

Actually i am running ros on my laptop and have attached roboclaw with usb with it. now even when i remove roboclaw usb cable and then run the code on ros on laptop i get the same error.

I think the laptop is not get comminication with the robot.

what i can do now?




################################################
#!/usr/bin/env python
import time
from roboclaw_driver.roboclaw import Roboclaw
#Windows comport name
#rc = Roboclaw("COM9",115200)
#Linux comport name
rc = Roboclaw("/dev/ttyACMO",115200)

rc.Open()
address = 0x81

rc.ForwardMixed(address, 0)
rc.TurnRightMixed(address, 0)

while(1):
rc.ForwardMixed(address, 16)
time.sleep(5)
rc.BackwardMixed(address, 0)
time.sleep(5)

####################################################

User avatar
Basicmicro Support
Posts: 905
Joined: Thu Feb 26, 2015 9:45 pm

Re: AttributeError: Roboclaw instance has no attribute '_port'

Postby Basicmicro Support » Tue May 29, 2018 9:43 am

That error is indicating the comport did not open so it has no instance of _port. Also the motor running out of control when you use the speed commands indicates its not been tuned and the settings saved to the board. You should use Ion Studio to setup and test the speed control settings before trying to use it in ROS.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest

cron