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

Error Using rclpy module on a non ROS2 machine

asked 2018-06-10 11:30:25 -0500

vishal_rawat gravatar image

Hi, I am trying to communicate between a ROS2 machine(Linux VM) and a non ROS machine(Host Windows). I have configured the network connections. When I install ROS on the windows machine as well, and run a demo talker on Windows and a listener on Linux, they communicate. Now when I try to run the demo talker using rclpy, it doesnt.

In windows, from the terminal, I run the demo_nodes_py talker.py and I get the error : Traceback (most recent call last): File "listener.py", line 17, in <module> import rclpy ModuleNotFoundError: No module named 'rclpy'

Any idea how to use the rclpy API ? What am I doing wrong here ?

edit retag flag offensive close merge delete

Comments

When I install ROS on the windows machine as well

I don't understand: how is something a "non-ROS machine" if you install ROS2 on it?

gvdhoorn gravatar image gvdhoorn  ( 2018-06-10 14:04:46 -0500 )edit

Just to check if the communication works on 2 different ROS2 machines, i installed ROS2 also on Windows...so that works...but now I dont need to use ROS2 rather only its API (rclpy) @gvdhoorn

vishal_rawat gravatar image vishal_rawat  ( 2018-06-11 03:57:47 -0500 )edit

Not using ROS2 but only its API does not make sense. If you use rclpy, you are using ROS2.

Geoff gravatar image Geoff  ( 2018-08-12 21:01:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-12 21:02:32 -0500

Geoff gravatar image

Are you going through all the steps to enable ROS2 in your command shell before trying to run the rclpy demo? You especially must run call C:\dev\ros2\local_setup.bat first.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-06-10 11:30:25 -0500

Seen: 285 times

Last updated: Aug 12 '18