ROSMonitoring icon indicating copy to clipboard operation
ROSMonitoring copied to clipboard

Generator results in error for ros2 monitor

Open iagosilvestre opened this issue 2 years ago • 7 comments

Hey there,

I've been trying to set up ROSMonitoring using ROS Foxy and Ubuntu 20.04. I've been using the ros2 branch and whenever I try running ./generator --config_file offline_config.yaml the following error occurs:

File "./generator", line 38 destination_path: pathlib.Path ^ SyntaxError: invalid syntax

I've tried analyzing the generator file but could not detect the issue in the line mentioned, do you have any idea what could be causing this ?

iagosilvestre avatar Feb 14 '24 20:02 iagosilvestre

Hi Iago,

Are you using Python3? Because from the error you are reporting seems you are using Python 2. Let me know if using Python 3 you are still getting the error.

Cheers, Angelo

AngeloFerrando avatar Feb 14 '24 21:02 AngeloFerrando

Hey There Angelo,

That was indeed the source of the issue, thanks for the help.

iagosilvestre avatar Feb 15 '24 01:02 iagosilvestre

Sorry for the inconvenience Angelo but actually the error persisted. I mistakenly successfully compiled inside the generator folder and not the ros2_devel one. image

iagosilvestre avatar Feb 15 '24 13:02 iagosilvestre

Hi Iago,

Weird, it is Indeed a problem with Python. In that line there Is a type hint which is not supporter in Python 2. I would suggest two things:

1- Try to run the generator file through Python explicitly. That is, something like python3 ./generator --config_file and so on. Just to be sure that your are not running Python 2.

2- Remove that line from the file (line 38). It is not needed since it Is just an hint for the developers.

If neither of the two things I suggested work, let me know and I will think about other possible suggestions.

Cheers, Angelo

AngeloFerrando avatar Feb 15 '24 14:02 AngeloFerrando

Changing the first line from generator file from #!/usr/bin/env python to #!/usr/bin/env python3 , or running with python3 ./generator --config_file changed the error to: image I'm trying to detect the source of the problem but if you have any idea let me know.

iagosilvestre avatar Feb 15 '24 14:02 iagosilvestre

Try:

python3 -m pip install jedi

AngeloFerrando avatar Feb 15 '24 14:02 AngeloFerrando

I believe that has solved the issue Angelo, I had to install prompt_toolkit as well but it seems to have compiled successfully and copied the files to my colcon workspace.

Thanks for the help!

iagosilvestre avatar Feb 15 '24 14:02 iagosilvestre