Ask Your Question
1

rosserial and arduino

asked 2020-06-02 05:31:55 -0500

Saul gravatar image

Hi folks,

I have just upgraded to Ubuntu 20.04 LTS, and ROS Noetic. Following the instructions in the ROS tutorials, using ROS Noetic, everything worked fine except for the tutorial about installing Arduino IDE Setup: http://wiki.ros.org/rosserial_arduino... I do the 2.1.1 (RECOMMENDED) Installing Binaries on the ROS workstation:

sudo apt-get install ros-noetic-rosserial-arduino
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ros-noetic-rosserial-arduino

I suspect that the rosserial Arduino package is not yet provided for noetic. Am I right? Does anyone know when/if it will be? Or can I install this package in another way? I tried the build from source option too, but no success there... it simply does not work when I try to run the simple helloworld example in the next tutorial. Before I upgraded to Ubuntu 20.04, I ran 18.04 and melodic. It worked fine! Any help/advice much appreciated! All the best, Krister

edit retag flag offensive close merge delete

5 Answers

Sort by » oldest newest most voted
1

answered 2020-06-03 01:21:28 -0500

hericles gravatar image

Hi, I was having the same problem. I upgraded to Ubuntu 20.04 and and the rosserial-arduino was not yet available for noetic. I was able to install using the 2.1.2, but using a specific branch in the git clone, which is gcc7-fixes, and it worked.

cd ws/src

git clone -b gcc7-fixes https://github.com/ros-drivers/rosser...

cd ~/ws

catkin_make

The catkin_make install was not necessary for me. My english is rusty, but I hope I've helped!

edit flag offensive delete link more
0

answered 2020-08-04 17:35:43 -0500

Donzo gravatar image

updated 2020-09-21 00:54:13 -0500

130s gravatar image

Just updating that the gcc7-fixes branch still appears to work as explained by hericles whilst the noetic-devel still doesn't work with noetic for fairly simple stuff with arduino at least. Noetic-devel complains about unicode strings being converted as per traceback below:

Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ubuntu/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 799, in processWriteQueue
    self._write(data)
  File "/home/ubuntu/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 763, in _write
    self.port.write(data)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/serial/serialposix.py", line 532, in write
    d = to_bytes(data)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/serial/serialutil.py", line 63, in to_bytes
    raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))
TypeError: unicode strings are not supported, please encode to bytes: 'ÿþ\x00\x00ÿ\x00\x00ÿ'
edit flag offensive delete link more

Comments

1

I don't think this belongs as an answer. I would open this as an issue on the upstream repo, and comment the update on @hericles answer

sloretz gravatar image sloretz  ( 2020-08-05 10:21:23 -0500 )edit
0

answered 2020-06-02 11:58:31 -0500

sloretz gravatar image

I suspect that the rosserial Arduino package is not yet provided for noetic.

You're correct. The index.ros.org page for rosserial_arduino says it is UNRELEASED.

Does anyone know when/if it will be?

When something will be released is a question only the maintainers would know. Good news is it looks like someone asked about a Noetic release here: https://github.com/ros-drivers/rosser...

Or can I install this package in another way? I tried the build from source option too, but no success there... it simply does not work when I try to run the simple helloworld example in the next tutorial

Trying from source was the right thing to do. Since you discovered it doesn't work, the next step would be to open a pull request that fixes the issue, or if there is already a PR then I'm sure the maintainers would find it helpful if you tested it and commented if it works.

edit flag offensive delete link more

Comments

I think https://index.ros.org/p/rosserial_ard... says that it is released but still I am getting the same error. Any solution?

HB gravatar image HB  ( 2021-05-09 01:15:28 -0500 )edit
0

answered 2020-09-21 00:57:13 -0500

130s gravatar image
sudo apt-get install ros-noetic-rosserial-arduino
:
E: Unable to locate package ros-noetic-rosserial-arduino

Original error is returned by apt-getthat looked for a debian binary. Looks like it is now released and available after https://github.com/ros/rosdistro/pull...

edit flag offensive delete link more
-1

answered 2020-06-08 03:54:20 -0500

Saul gravatar image

Hi, thanks for your answers! But no significant progress yet... ros_lib builds when I run catkin_make, but I still have problems when I try to run the helloworld example. Compiling it and uploading to Arduino works, though. It works fine when I run it on my laptop with melodic...

I get the following errors:

>> rosrun rosserial_python serial_node.py /dev/ttyACM0
Traceback (most recent call last):
  File "/home/krister/catkin_ws/devel/lib/rosserial_python/serial_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/krister/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 39, in <module>
    from rosserial_python import SerialClient, RosSerialServer
  File "/home/krister/catkin_ws/devel/lib/python3/dist-packages/rosserial_python/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 1, in <module>
  File "/home/krister/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 48, in <module>
    from serial import Serial, SerialException, SerialTimeoutException
ModuleNotFoundError: No module named 'serial'

Trying from source was the right thing to do. Since you discovered it doesn't work, the next step would be to open a pull request that fixes the issue, or if there is already a PR then I'm sure the maintainers would find it helpful if you tested it and commented if it works.

To be honest, I don't understand what to do... :-)

I tried also with the gcc7-fixes suggested by hericles, but same result there. Given the above output on rosrun I get, I suppose something is missing or broken in my ROS installation!? I mean, catkin_make and catkin_make install seems to just build everything fine, with no errors. Could have something to do with Python compatibility errors, as mentioned here: https://github.com/ros-drivers/rosserial/issues/499 ?

Without more advice, I don't think I get any further with this at the moment I think. I only see two options:

1) Try and reinstall ROS from scratch and see if that helps, or 2) Install 18.04 LTS alongside my 20.04, with melodic. I consider option 1 as a potential fix, and 2 as a workaround (i.e. avoid the problem at the moment) :-).

I really need ROS working now, for an important project at work, and I've already spent too much time on this (why do always new problems arise when upgrading to a new ubuntu version...?)

Anyway, thanks and br!

edit flag offensive delete link more

Comments

Hello, it might be interesting to consider using an image of the docker with melodic, or another version of ROS while noetic is not updated. If you know how to use the docker, it can be a quick solution, but if you think you will waste a lot of time on it, I think that installing Ubuntu 18.04 alongside Ubuntu 20.04 may be more reliable.

hericles gravatar image hericles  ( 2020-06-09 00:52:55 -0500 )edit

I am working on a similar project. In order to fix the serial module not found, you will need to apt install python3-serial. Did you build noetic from source?

ruffner gravatar image ruffner  ( 2020-07-21 20:21:37 -0500 )edit

No I didn't build noetic from source, just tried to build the rosserial arduino... I don't think I did the apt install python3-serial, just python3 (from what I can remember...). Maybe that would help? However, i rest my case for now (see below).

Saul gravatar image Saul  ( 2020-08-05 05:27:14 -0500 )edit

What I did as a workaround was that I installed Ubuntu 18.04 under VirtualBox (under 20.04), and then installed ROS Melodic in 18.04. It works as before, under a native 18.04, so I can get my work done. Not the most elegant solution maybe, but it works... This is what I'm going to recommend to my students in the autumn! Unless they don't have a native 18.04 installation already, of course. I don't feel like I want to waste more time on this now, but thanks to you all for your comments/suggestions! :-) Honestly, I thought that my post would "wake up" the people in charge of the rosserial arduino package, so the should fix the standard installation procedure! ;-) Or maybe they have moved on to ROS2 instead, since Noetic is the final ROS version ever to be released?

Br,

Saul gravatar image Saul  ( 2020-08-05 05:38:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-06-02 05:31:55 -0500

Seen: 1,204 times

Last updated: Sep 21 '20