ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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
0

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

Question Tools

2 followers

Stats

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

Seen: 206 times

Last updated: Apr 12 '22