Generator results in error for ros2 monitor
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 ?
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
Hey There Angelo,
That was indeed the source of the issue, thanks for the help.
Sorry for the inconvenience Angelo but actually the error persisted. I mistakenly successfully compiled inside the generator folder and not the ros2_devel one.
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
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:
I'm trying to detect the source of the problem but if you have any idea let me know.
Try:
python3 -m pip install jedi
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!