sonyccd / roboclaw_ros

ros for roboclaw
BSD 2-Clause "Simplified" License
50 stars 92 forks source link

Noetic support #27

Open simonbogh opened 4 years ago

simonbogh commented 4 years ago

Hi,

Has anyone succeeded in using the package in ROS Noetic on Ubuntu 20.04?

My roboclaw_node process dies during launch, and running the python file directly gives the following error:

TypeError: unicode strings are not supported, please encode to bytes: '\x80'

I suspect this has something to do with the python environment being Python 3.x and the lines containing port.write(chr()).

jeevan-git commented 3 years ago

same here does any one has used this package for ROS Noetic on Ubuntu 20.04?

juluwuu commented 2 years ago

Hello,

I am using ROS Noetic and Ubuntu 20.04 and had the same problem with this package.

Apparently it was because roboclaw_driver.py was not the latest version for Python 3.x. A similar problem is discussed in this forum entry: https://forums.basicmicro.com/viewtopic.php?f=2&t=815&sid=dabc655ec1568e78b3e884020364eb1a&start=10.

You can copy the roboclaw_3.py library and rename it to roboclaw_driver.py and delet the old driver file. Download of the roboclaw_3.py library can be found here under "Python Example for Raspberry Pi, OSX, Linux, Windows": https://www.basicmicro.com/downloads

chaitanyantr commented 2 years ago

Any one succed in ROS roboclaw package in noetic(python3). I still have this issue.

AlexGarciaG commented 2 years ago

I think that the solution is in this pull request https://github.com/sonyccd/roboclaw_ros/pull/31#issue-1114432419 I tested it, and it worked properly.

chaitanyantr commented 2 years ago

Thankyou will try it.

leonsuetfeld commented 1 year ago

In my case, replacing the file roboclaw.py by roboclaw_3.py (both in /roboclaw_python/) fixed it.

JChiaHH commented 1 year ago

Hi i've also tried to use the amended roboclaw_3 driver in the pull request, however the roboclaw driver is unresponsive only when using the new driver on ROS Noetic with python2. It is responsive on ROS Melodic with python3.

i also noticed that there when the self.port command was used this way in roboclaw_driver.py: self._port.write(chr(address)) on python2, the roboclaw is able to receive data from my python script. However when edited command in the roboclaw_driver in the pull request self._port.write(address.to_bytes(1, 'big')) on python3, the driver is not receiving data from my python script.

I have tried multiple ways but i could not get the driver to receive data from my script, does anyone know how I can overcome this problem?

JChiaHH commented 1 year ago

could it be because the motor driver receive commands in unicode strings only and it is unable to receive in bytes (i'm not sure)?