# Error running voxl-mpa-to-ros2

Source: https://forum.modalai.com/topic/3076/error-running-voxl-mpa-to-ros2
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2024-01-31 19:03:45 UTC by riteshsharma
Replies: 11 · Views: 2584

## riteshsharma · 2024-01-31 19:03:45 UTC

I tried running following commands:

![Capture.PNG](https://forum.modalai.com/assets/uploads/files/1706727553191-capture.png)

## Reply by Darshit Desai · 2024-01-31 19:40:10 UTC

@rsr4z Hi I have the same error after building the package from source and installing it, did you follow this procedure here, I still get that error even after doing that

https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-to-ros2/-/tree/master?ref_type=heads#build-instructions-if-running-in-qrb5165-emulator-and-pushing-to-voxl2-post-build

## Reply by riteshsharma · 2024-01-31 21:13:39 UTC (in reply to Darshit Desai)

@Darshit-Desai Try running voxl-configure-mpa-to-ros2. It should do all what you are looking for.

## Reply by Darshit Desai · 2024-01-31 21:18:55 UTC (in reply to riteshsharma)

@rsr4z Did the ros2 launch work for you after that?

## Reply by riteshsharma · 2024-01-31 21:20:28 UTC (in reply to Darshit Desai)

@Darshit-Desai Unfortunately I am now getting different error

![Capture2.PNG](https://forum.modalai.com/assets/uploads/files/1706736026366-capture2.png)

## Reply by Darshit Desai · 2024-02-01 00:00:47 UTC (in reply to riteshsharma)

@rsr4z Were you able to resolve this issue? Also are you also using the voxl2 starling drone?

## Reply by Darshit Desai · 2024-02-01 00:07:31 UTC (in reply to riteshsharma)

@rsr4z Also I get this error while using this command

voxl2:~$ voxl-configure-mpa-to-ros2.
bash: voxl-configure-mpa-to-ros2.: command not found

@rsr4z said in [Error running voxl\-mpa\-to\-ros2](/post/14472):
> @Darshit-Desai Try running voxl-configure-mpa-to-ros2. It should do all what you are looking for.

## Reply by Alex Kushleyev (ModalAI staff) · 2024-02-02 17:12:49 UTC (in reply to Darshit Desai)

@Darshit-Desai , 

It looks like the launch file is not valid. the launcher is not recognizing it as an xml file. However, i tried renaming the launch file to xml, it also failed.

First, as @rsr4z suggested, you need to run `voxl-configure-mpa-to-ros2` to install prerequisites.

Then to bypass the launch file issue, you can run the executable directly:

```
voxl2:$ ros2 run voxl_mpa_to_ros2 voxl_mpa_to_ros2_node
Found new interface: imu_apps
Found new interface: voa_pc_out
Found new interface: vvhub_body_wrt_fixed
Found new interface: vvhub_body_wrt_local
```

We will investigate the launch file issue

## Reply by Zachary Lowell 0 · 2024-02-02 18:54:22 UTC

@Alex-Kushleyev said in [Error running voxl\-mpa\-to\-ros2](/post/14520):
> ros2 run voxl_mpa_to_ros2 voxl_mpa_to_ros2_node

@Darshit-Desai @rsr4z can you please try the following

1. `sudo apt-get install voxl-ros2-foxy`
2. `sudo apt-get install voxl-mpa-to-ros2`
3. `voxl-configure-mpa-to-ros2`
4. `source /opt/ros/foxy/mpa_to_ros2/install/setup.bash`
5. `export ROS_HOME=/opt/foxy`
6. `ros2 run voxl_mpa_to_ros2 voxl_mpa_to_ros2_node`

Lmk what happens.

## Reply by Darshit Desai · 2024-02-03 19:11:36 UTC (in reply to Zachary Lowell 0)

@Zachary-Lowell-0 Yes this runs the mpa-to-ros2 node, the only difference I found was that when streaming hires image data over wifi the speed is a little slower. When compared with ros1 voxlmpatoros the hires image data is streamed at 4 FPS while for ros2 voxlmpatoros2 the hires image data is streamed at 0.5-1FPS. 

Another bug is that whenever I try to subscirbe to topic /hires_large_color or /hires_large_grey both voxl mpatoros1 and voxl mpatoros2 nodes get killed. This is irrespective of which domain I subscribe from, whether I subscribe inside another terminal of voxl or on a different terminal over wifi.

ROS 1:

![9ed6cb36-9a96-4c16-9a39-bacfb5c7cb2e-image.png](https://forum.modalai.com/assets/uploads/files/1706986323136-9ed6cb36-9a96-4c16-9a39-bacfb5c7cb2e-image.png) 

ROS 2:

![2f5a38cd-ed97-469b-91ac-514974258bee-image.png](https://forum.modalai.com/assets/uploads/files/1706987486973-2f5a38cd-ed97-469b-91ac-514974258bee-image.png)

## Reply by Zachary Lowell 0 · 2024-02-05 17:12:34 UTC

@Darshit-Desai this is the response I am getting for hires_small_color firstly:

![fb1b5776-09cd-401e-9a49-a1cd05188172-image.png](https://forum.modalai.com/assets/uploads/files/1707153004747-fb1b5776-09cd-401e-9a49-a1cd05188172-image.png) 

Looks like about 22 FPS.

As for hires_large:

![1edb459c-9692-479b-9168-c7308e0c69c8-image.png](https://forum.modalai.com/assets/uploads/files/1707153047928-1edb459c-9692-479b-9168-c7308e0c69c8-image.png) 

I am getting about 2 FPS which is expected as we are converting 4K imagery from traditional YUV formatted frames into ros2 images, which is a bottleneck in general. I am not able to trigger the ros2 instance to die when I subscribe to the hires LARGE frames.

A note - internally, the HIRES LARGE imagery is more meant for onboard video recording, not for transfering between the MPA and ros2. For that reason I highly recommend using either the encoded pipe or the SMALL pipes.

## Reply by brahim · 2024-02-06 16:29:37 UTC (in reply to Zachary Lowell 0)

@Darshit-Desai when you are subscribing to /hires_large_color or /hires_large_grey are you planning to do some kind of image processing on these image messages in ROS? These are huge 4k images and I'm not sure how much the ros CV bridge can handle. One option is to resize the images since that typically complements image processing for whatever consumer subscribes to these image topics and will result in a speed up. Rectification also can be used to reduce the image warp.

Another option is to play with the image sensor encodings and find something more manageable in  ROS and computational power required.
