Robotics StackExchange | Archived questions

i have a error "Traceback (most recent call last):" could you help me?

~$ rosrun rosserialpython serialnode.py /dev/ttyACM0

Traceback (most recent call last): File "/home/ahmet/catkinws/src/rosserial/rosserialpython/nodes/serialnode.py", line 39, in from rosserialpython import SerialClient, RosSerialServer File "/home/ahmet/catkinws/devel/lib/python2.7/dist-packages/rosserialpython/init.py", line 34, in exec(_fh.read()) File "", line 1, in File "/home/ahmet/catkinws/src/rosserial/rosserialpython/src/rosserialpython/SerialClient.py", line 42, in import queue ImportError: No module named queue"

When i used queue with capital Q in code, i have this error below.what should i do?

~$ rosrun rosserialpython serialnode.py /dev/ttyACM0

[INFO] [1603106570.886915]: ROS Serial Python Node [INFO] [1603106570.897550]: Connecting to /dev/ttyACM0 at 57600 baud [WARN] [1603106570.900234]: Unexpected Error:

Traceback (most recent call last):

File "/home/ahmet/catkinws/src/rosserial/rosserialpython/nodes/serial_node.py", line 99, in client.port.close() NameError: name 'client' is not defined

my ros is melodic version and python version is 2.7

Asked by turkoahmet on 2021-12-02 14:25:31 UTC

Comments

In Python 2 the module is Queue with capital Q.

Asked by osilva on 2021-12-02 15:49:05 UTC

i edited question a minute ago.i have last error that " ~$ rosrun rosserial_python serial_node.py /dev/ttyACM0

[INFO] [1603106570.886915]: ROS Serial Python Node [INFO] [1603106570.897550]: Connecting to /dev/ttyACM0 at 57600 baud [WARN] [1603106570.900234]: Unexpected Error: Traceback (most recent call last):

File "/home/ahmet/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 99, in client.port.close() NameError: name 'client' is not defined "

Asked by turkoahmet on 2021-12-02 16:02:03 UTC

@turkoahmet. If you got a response to a question then it should be accepted an another question started not edited for your future consideration.

Asked by osilva on 2021-12-02 16:05:29 UTC

Your answer may not be correct, after all, the error persists. ?

Asked by turkoahmet on 2021-12-02 16:18:51 UTC

It’s a different error.

Asked by osilva on 2021-12-02 16:37:19 UTC

Answers

This ros package is available from apt with name ros-melodic-rosserial-python, so ordinarily you should use that one.

You can choose to build it yourself from source, but you now have the responsibility to checkout the proper branch that works in melodic.

Asked by Mike Scheutzow on 2021-12-04 08:41:56 UTC

Comments