# ( VOXL2 PX4 ROS2) MPA to ROS2 for Battery Voltage & Problems

Source: https://forum.modalai.com/topic/4353/voxl2-px4-ros2-mpa-to-ros2-for-battery-voltage-problems
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: mpa
Posted: 2025-04-16 01:13:24 UTC by GlennTee
Replies: 11 · Views: 6417

## GlennTee · 2025-04-16 01:13:24 UTC

Hello. I'm attempting to try and obtain the battery voltage through code for a project I am working on where I want the drone to perform different operations based on whether the battery is low. One idea was to take the MPA battery voltage data found from doing "voxl-inspect-battery" and to send it to ROS2 to be read and obtained through there. However, I keep experiencing what appears to be syntax errors whenever I try to run "ros2 launch voxl_mpa_to_ros2 voxl_mpa_to_ros2.launch" and it shows that there is no executable found whenever I run "ros2 run voxl_mpa_to_ros2 voxl_mpa_to_ros2," and with multiple files of the same name I'm not exactly sure which one to chmod. Would anyone know anything about resolving this? I am urgently seeking a fix to this. Below is the aforementioned launch file:

<?xml version="1.0"?>

<!--
/****************************************************************************
 * Copyright 2023 Modal AI
 * Complete MPA launch file exposes all node params as arguments
 ****************************************************************************/
-->

<launch>
    <!-- start mpa node -->
    <node name="voxl_mpa_to_ros_node2" type="voxl_mpa_to_ros_node2" pkg="voxl_mpa_to_ros2" output="screen" />

</launch>

## Reply by Zachary Lowell 0 · 2025-04-16 15:22:43 UTC

@GlennTee are you sourcing the right directory? `source /opt/ros/foxy/mpa_to_ros2/install/setup.bash` then run the command you mentioned above.

Zach

## Reply by Zachary Lowell 0 · 2025-04-16 18:37:56 UTC

Also @GlennTee build this branch of px4 and then flash onto your voxl2 - it exposes battery_status over the uorb topic through the dds bridge, so now when you run ros2 topic list you still see /fmu/out/battery_status: https://github.com/modalai/px4-firmware/tree/zach/battery_status_ros2

This is also a PR currently into voxl-dev branch of PX4 so most likely will be a feautre of the next release.

Zach

## Reply by Eric Katzfey (ModalAI staff) · 2025-04-16 20:02:00 UTC (in reply to Zachary Lowell 0)

@Zachary-Lowell-0 An updated build can be found here: http://voxl-packages.modalai.com/dists/qrb5165/dev/binary-arm64/voxl-px4_1.14.0-2.0.99-202504161252_arm64.deb

## Reply by GlennTee · 2025-04-17 17:11:35 UTC (in reply to Zachary Lowell 0)

@Zachary-Lowell-0 Hello. I just tried what you mentioned and I've had no luck so far. Below is my terminal window where I tried running both commands after sourcing.
![e3685032-a26d-42e4-999e-9509dcf88e9f-image.png](https://forum.modalai.com/assets/uploads/files/1744909475191-e3685032-a26d-42e4-999e-9509dcf88e9f-image.png)

## Reply by GlennTee · 2025-04-17 18:42:30 UTC (in reply to Zachary Lowell 0)

@Zachary-Lowell-0 Would I need to wipe the drone and install the new build on to it? I also tried building your branch but I'm unsure about the location as where to put it, such as in /home/root, /opt/, etc., or if I need to use a specific build command other than "colcon build." Would you be able to clarify this? Thanks again for your help!

## Reply by Eric Katzfey (ModalAI staff) · 2025-04-18 15:08:05 UTC (in reply to GlennTee)

@GlennTee Just download the Debian (e.g. `wget http://voxl-packages.modalai.com/dists/qrb5165/dev/binary-arm64/voxl-px4_1.14.0-2.0.99-202504161252_arm64.deb`) to the VOXL 2 and then use `dpkg -i http://voxl-packages.modalai.com/dists/qrb5165/dev/binary-arm64/voxl-px4_1.14.0-2.0.99-202504161252_arm64.deb` to install it.

## Reply by GlennTee · 2025-04-18 17:06:44 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Thank you. I just tried downloading it but there appears to be a package missing that is needed. I tried looking online to find somewhere to download it from but I couldn't really find anything. Do you know where I could find it?
![c7c73b2a-2db3-4749-ae40-8dd4d2ccfb7b-image.png](https://forum.modalai.com/assets/uploads/files/1744996001638-c7c73b2a-2db3-4749-ae40-8dd4d2ccfb7b-image.png)

## Reply by Eric Katzfey (ModalAI staff) · 2025-04-18 18:57:38 UTC (in reply to GlennTee)

@GlennTee Ah, I assumed you were on the latest SDK version. You really should be. Can you first update to SDK 1.4.x?

## Reply by GlennTee · 2025-04-18 20:51:21 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Hello again. I upgraded to SDK v1.4.1 and the downloaded worked this time. I am able to echo the battery_status topic and it shows all the information. Thank you so much. I do have another question, is there a way to get tag detection as a ros2 topic just like with battery_status?

## Reply by Eric Katzfey (ModalAI staff) · 2025-04-18 21:18:13 UTC (in reply to GlennTee)

@GlennTee Can you please start a separate post for each new question? Thanks!

## Reply by GlennTee · 2025-04-18 21:38:44 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Sure!
