Robotics StackExchange | Archived questions

ros2 run --prefix doesn't work on Windows 10

I got this error when trying to launch a node with a --prefix on a Command Prompt. The node without the prefix works perfectly. Any idea how to fix it ?

ros2 run --prefix "timeout /t 10 " demo_nodes_cpp talker
ERROR: Invalid syntax. Default option is not allowed more than '1' time(s).
Type "TIMEOUT /?" for usage.
[ros2run]: Process exited with failure 1

Asked by arthur.bourbousson on 2023-06-13 02:58:31 UTC

Comments

Quick comment: could you try with double fwd slashes? So timeout //t 10. I've seen some mangling sometimes which could make timeout see 'strange' args.

Asked by gvdhoorn on 2023-06-14 03:04:32 UTC

I got the exact same error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>ros2 run --prefix "timeout //t 10 " 
demo_nodes_cpp talker
   ERROR: Invalid syntax. Default option is not allowed more than '1' time(s).
   Type "TIMEOUT /?" for usage.
   [ros2run]: Process exited with failure 1

( I am sorry for the formatting, It is my first comment and I don't find a way to make it right)

Asked by arthur.bourbousson on 2023-06-14 03:19:17 UTC

Was worth a try.

You could perhaps write a short .cmd or .bat and have it print out the arguments it receives, just to see what ros2 run passes to it.

Asked by gvdhoorn on 2023-06-14 04:29:33 UTC

Answers