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