ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Does rosserial_arduino work with Nvidia jetson nano? I get several errors. rosserial_arduino is not working with jetson nano for me. Is it python 2 or 3 compatibility related problem?

asked 2020-08-05 17:11:36 -0500

asifbhatti gravatar image

updated 2020-08-07 16:32:27 -0500

I tried to install it as guided in http://wiki.ros.org/rosserial_arduino.... however, it does not work. is it still under development?

edit retag flag offensive close merge delete

Comments

Can you give more details please? Version of ROS, host OS? Other packages?

What do you mean it doesn't work? How does it not work? Does it burst into flames when you run the launch file, or does it spit out some sort of debugging information.

kscottz gravatar image kscottz  ( 2020-08-05 19:03:32 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-08-06 16:44:19 -0500

asifbhatti gravatar image

updated 2020-08-08 14:52:58 -0500

Hello, Thank you for your reply. Sorry for my late reply. I am using the Nvidia Jetson Nano board. which has Jetson Nano Developer Kit SD Card Image on it, which is based on Ubuntu 18.04. I am using ROS melodic on it. I have followed http://wiki.ros.org/rosserial_arduino... for rosserial installation. that was done successfully without any error. After launching the roscore I run this code: rosrun rosserial_python serial_node.py /dev/ttyACM0, as my Arduino is connected to ACM0 port. However, I get this error

Traceback (most recent call last): File "/home/asif/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 39, in <module> from rosserial_python import SerialClient, RosSerialServer File "/home/asif/catkin_ws/devel/lib/python2.7/dist-packages/rosserial_python/__init__.py", line 34, in <module> exec(__fh.read()) File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'SerialClient'

as per https://answers.ros.org/question/3535... suggests that: "The issue will be solved by adding a dot in front of SerialClient

from SerialClient import *

from .SerialClient import *" which is located at ~/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python After solving that I get another error:

Traceback (most recent call last): File "/home/asif/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 39, in <module> from rosserial_python import SerialClient, RosSerialServer File "/home/asif/catkin_ws/devel/lib/python2.7/dist-packages/rosserial_python/__init__.py", line 34, in <module> exec(__fh.read()) File "<string>", line 1, in <module> File "/home/asif/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 42, in <module> import StringIO ModuleNotFoundError: No module named 'StringIO'

https://stackoverflow.com/questions/1... suggested to change as below: try: from StringIO import StringIO ## for Python 2 except ImportError: from io import StringIO ## for Python 3 after changing that I get another error:

Traceback (most recent call last): File "/home/asif/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 39, in <module> from rosserial_python import SerialClient, RosSerialServer File "/home/asif/catkin_ws/devel/lib/python2.7/dist-packages/rosserial_python/__init__.py", line 34, in <module> exec(__fh.read()) File "<string>", line 1, in <module> File "/home/asif/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 54, in <module> from Queue import Queue ModuleNotFoundError: No module named 'Queue'

For this error I found 2 solutions from now thread https://stackoverflow.com/questions/3... :

(1)

Suggests the solution for that to change import queue as Queue. that gives error as below:

Traceback (most recent call last): File "/home/asif/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 88, in <module> client = SerialClient(port_name, baud, fix_pyserial_for_test=fix_pyserial_for_test) File "/home/asif/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 340, in __init__ self.write_queue = Queue() TypeError: 'module' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/asif/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 100, in <module> client.port.close() NameError: name 'client' is not defined

(2)

suggests that Queue is in the multiprocessing module so:

from multiprocessing import Queue after ... (more)

edit flag offensive delete link more

Comments

Can you please edit the original question instead of making it an answer. I don't have an exact answer but in these situations I open up a python shell where I am working and try to import the library. If you are using stock code I would assume that it is probably functional and that you are probably having python installation issues.

kscottz gravatar image kscottz  ( 2020-08-07 15:10:45 -0500 )edit

Sorry, I didn't get the answering flow. However, I have tried reinstalling the rosserial_aurdino but still get the same error. First I get the ModuleNotFoundError: No module named 'SerialClient', than ModuleNotFoundError: No module named 'StringIO', after that ModuleNotFoundError: No module named 'Queue', after that i get client.port.close() NameError: name 'client' is not defined or NameError: name 'basestring' is not defined error. Is it because rosserial_aurdino is supported on python 2 not for python 3.

asifbhatti gravatar image asifbhatti  ( 2020-08-07 16:34:03 -0500 )edit

I intend to control the servo motor and brushed motor from Jetson nano using Arduino, connected by rosserial_arduino link.

asifbhatti gravatar image asifbhatti  ( 2020-08-07 16:35:12 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-08-05 17:11:36 -0500

Seen: 866 times

Last updated: Aug 08 '20