# ROS2 errors on VOXL2

Source: https://forum.modalai.com/topic/4057/ros2-errors-on-voxl2
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2025-01-02 18:22:38 UTC by Gary Holmgren
Replies: 2 · Views: 728

## Gary Holmgren · 2025-01-02 18:22:38 UTC

I installed ROS2 Foxy on my Voxl2 using the instructions 

-sudo apt-get install voxl-ros2-foxy
-sudo apt-get install voxl-microdds-agent
-sudo apt-get install voxl-mpa-to-ros2
-voxl-configure-mpa-to-ros2
-source /opt/ros/foxy/setup.bash 
-export ROS_HOME=/opt/ros/foxy

All seems to be okay but when I followed the ModalAI  [tutorial](https://docs.modalai.com/building-ros2-nodes/?gad_source=2&gclid=Cj0KCQiA7NO7BhDsARIsADg_hIYZHBtM2VAYXTP7NQOOWTmHcV6iU5r7Envx1BhkSoEhcW9UnZ7_zusaAsIAEALw_wcB) I get the  following errors.

```
voxl2:/$ cd
voxl2:~$ mkdir -p colcon_ws/src
voxl2:~$ cd colcon_ws
voxl2:~/colcon_ws$ cd src
voxl2:~/colcon_ws/src$ git clone https://github.com/PX4/px4_ros_com --recursive
Cloning into 'px4_ros_com'...
remote: Enumerating objects: 2288, done.
remote: Counting objects: 100% (162/162), done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 2288 (delta 128), reused 115 (delta 115), pack-reused 2126 (from 1)
Receiving objects: 100% (2288/2288), 608.87 KiB | 3.60 MiB/s, done.
Resolving deltas: 100% (1455/1455), done.
voxl2:~/colcon_ws/src$ git clone https://github.com/PX4/px4_msgs --recursive
Cloning into 'px4_msgs'...
remote: Enumerating objects: 3283, done.
remote: Counting objects: 100% (1092/1092), done.
remote: Compressing objects: 100% (268/268), done.
remote: Total 3283 (delta 961), reused 829 (delta 822), pack-reused 2191 (from 3)
Receiving objects: 100% (3283/3283), 607.13 KiB | 3.92 MiB/s, done.
Resolving deltas: 100% (2005/2005), done.
voxl2:~/colcon_ws/src$ cd ../
voxl2:~/colcon_ws$ colcon build
Starting >>> px4_msgs
--- stderr: px4_msgs                         
CMake Error at /opt/ros/foxy/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:60 (message):
  execute_process(/usr/bin/python3 -m rosidl_adapter --package-name px4_msgs
  --arguments-file
  /home/root/colcon_ws/build/px4_msgs/rosidl_adapter__arguments__px4_msgs.json
  --output-dir /home/root/colcon_ws/build/px4_msgs/rosidl_adapter/px4_msgs
  --output-file
  /home/root/colcon_ws/build/px4_msgs/rosidl_adapter/px4_msgs.idls) returned
  error code 1:

  AttributeError processing template 'msg.idl.em'

  Traceback (most recent call last):

    File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_adapter/resource/__init__.py", line 48, in evaluate_template
      _interpreter = em.Interpreter(

  AttributeError: module 'em' has no attribute 'Interpreter'

  

  During handling of the above exception, another exception occurred:

  

  Traceback (most recent call last):

    File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_adapter/__main__.py", line 19, in <module>
      sys.exit(main())
    File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_adapter/main.py", line 55, in main
      pathlib.Path(relative_path), output_dir)
    File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_adapter/__init__.py", line 20, in convert_to_idl
      package_dir, package_name, interface_file, output_dir / 'msg')
    File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_adapter/msg/__init__.py", line 39, in convert_msg_to_idl
      expand_template('msg.idl.em', data, output_file, encoding='iso-8859-1')
    File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_adapter/resource/__init__.py", line 23, in expand_template
      content = evaluate_template(template_name, data)
    File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_adapter/resource/__init__.py", line 69, in evaluate_template
      _interpreter.shutdown()

  AttributeError: 'NoneType' object has no attribute 'shutdown'

Call Stack (most recent call first):
  /opt/ros/foxy/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:130 (rosidl_adapt_interfaces)
  CMakeLists.txt:28 (rosidl_generate_interfaces)

---
Failed   <<< px4_msgs [4.33s, exited with code 1]
                                
Summary: 0 packages finished [4.71s]
  1 package failed: px4_msgs
  1 package had stderr output: px4_msgs
  1 package not processed
```

Not sure what exactly here is causing the failure. Has anyone else had trouble building this tutorial?

## Reply by Zachary Lowell 0 · 2025-01-03 16:16:28 UTC

@Gary-Holmgren said in [ROS2 errors on VOXL2](/post/20301):
> -source /opt/ros/foxy/setup.bash
> 

Hey @Gary-Holmgren! So this is an issue with a conflict in the emPY library - it should have been updated in the most recent SDK release - however the solution programmatically is the following:

`python3 -m pip uninstall -y empy`
`python3 -m pip install empy==3.3.4`

https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-to-ros2/-/blob/dev/scripts/voxl-configure-mpa-to-ros2?ref_type=heads#L18

Cheers!
Zach

## Reply by Gary Holmgren · 2025-01-05 03:10:57 UTC (in reply to Zachary Lowell 0)

@Zachary-Lowell-0 Yes this did the trick, thankyou!
