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

Running ros2 node inside blender venv

asked 2021-11-10 03:03:14 -0500

Iftahnaf gravatar image

updated 2021-11-10 05:42:58 -0500

Hi all,

I'm trying to run simple ros2 node inside blender environment.

The node should render some scenario and publish the frames to a topic using cv_bridge.

I tried to source /opt/ros/foxy/setup.bash and build a workspace in the scripts folder before running blender. After that, execute the node's script from blender, but It can't find the ros2 python packages and fails to run simple publisher node.

Any ideas of how I can get it to work?

Thanks in advance, Iftach.

edit retag flag offensive close merge delete

Comments

ROS 2 is Python 3 only. You've tagged this python2.7, so that would appear not to work.

gvdhoorn gravatar image gvdhoorn  ( 2021-11-10 05:05:44 -0500 )edit

Wrong tagget, my bad. The blender environment's python version is 3.9

Iftahnaf gravatar image Iftahnaf  ( 2021-11-10 05:42:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-10 10:33:45 -0500

Iftahnaf gravatar image

updated 2021-11-13 09:24:02 -0500

Ok so I manage to make this work, it's not pretty and I'm sure that this is a correct solution but:

copy the desired ros2 packages (rclpy, std_msgs etc..) to /path/to/blender/scripts/modules (i copied the whole ros2 package folder)

--- if your ros2 python env doesnt match the python version of blender ---

  • in each package edit the name of the .so file, for example, I work with python 3.8.10 and blender was with python 3.9.2 (2.93.5 version of blender) so the file: std_msgs_s__rosidl_typesupport_c.cpython-38-x86_64-linux-gnu.so inside std_msgs package was changed to std_msgs_s__rosidl_typesupport_c.cpython-39-x86_64-linux-gnu.so. probably you will have to debug it for few tries until you change everything in all the packages
edit flag offensive delete link more

Question Tools

Stats

Asked: 2021-11-10 03:03:14 -0500

Seen: 451 times

Last updated: Nov 13 '21