Ask Your Question

powershell vs cmd

asked 2022-04-11 05:39:36 -0500

koraykoca gravatar image

updated 2022-04-11 05:42:15 -0500

Hi, I installed ROS2 on Windows 10 and followed the instructions properly. In the end, I wanted to run the example.

When I run the command "call C:\dev\ros2_galactic\ros2-windows\local_setup.bat" and commands for talker and listener in cmd, it works without problem. However, in Powershell, it gives error?

I googled it and found out that bat.files should be run in different way in Powershell? Then, I tried "Start-Process -FilePath C:\dev\ros2_galactic\ros2-windows\local_setup.bat" . It looked like worked but when I run ros2 command, it gives error. I also tried, "Powershell.exe -ExecutionPolicy Unrestricted -command C:\dev\ros2_galactic\ros2-windows\local_setup.bat" and I got the same problem and same for "powershell C:\dev\ros2_galactic\ros2-windows\local_setup.bat".

How can I run "ros2 run demo_nodes_cpp talker" and "ros2 run demo_nodes_py listener" in Powershell? Why do these examples work in cmd but not in Powershell?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-04-12 07:50:24 -0500

koraykoca gravatar image

I found the solution: writing "C:\dev\ros2_galactic\ros2-windows\local_setup.ps1" in Powershell worked.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2022-04-11 05:39:36 -0500

Seen: 60 times

Last updated: Apr 12