# VOXL MPA_to_ROS rostopics not subscribing to anything

Source: https://forum.modalai.com/topic/2667/voxl-mpa_to_ros-rostopics-not-subscribing-to-anything
Category: Development Drones (https://forum.modalai.com/category/44/development-drones)
Tags: starling
Posted: 2023-09-18 22:54:27 UTC by Darshit Desai
Replies: 13 · Views: 3439

## Darshit Desai · 2023-09-18 22:54:27 UTC

Hi I went through the voxl2 custom ros documentation for the starling drone. I started up the voxl mpa to ros script successfully as shown below:
![voxl2.png](https://forum.modalai.com/assets/uploads/files/1695077589941-voxl2.png) 

I than go to my local computer and set the ros master uri and ros IP. I am able to see the rostopic list but when I try to listen the topics by typing rostopic hz /tof_depth it says no data packets present as seen in the image below:
![rostopicmypc.png](https://forum.modalai.com/assets/uploads/files/1695077662981-rostopicmypc.png)

## Reply by Moderator (ModalAI staff) · 2023-09-19 23:31:09 UTC

@Darshit-Desai that service is setup so that it does not publish anything without a subscriber. maybe try to record a rosbag to see if you're getting data?

## Reply by ben grocholsky · 2023-09-20 00:49:20 UTC (in reply to Moderator)

`rostopic hz /tracking` should subscribe to the topic and work as you expected.
e.g. for me:
![799a4432-e73f-4686-8085-83cb6ec5a0ef-image.png](https://forum.modalai.com/assets/uploads/files/1695169788587-799a4432-e73f-4686-8085-83cb6ec5a0ef-image.png) 

I've seen two things that might be happening:
1) The `voxl-camera-service` has stopped running. Check with `voxl-inspect-services` , `voxl-inspect-qvio`, `systemctl status voxl-camera-service`.

2) Your environment variables might not be set right for ROS1 remote message transport. Setting `ROS_MASTER_URI` on your laptop to point to the master running on the voxl is enough to discover ROS1 topic names. Two more variables are needed to be set to get message transport working `ROS_IP` and `ROS_HOSTNAME`

Here's an example that works for me. Adjust it to match the IP addresses for your voxl2, laptop, and the ROS1 version you're running on your laptop. Select the image you want to view in the rqt_image_view GUI.

Script on voxl2: `start_mpa_to_ros1.sh`
```
#!/bin/bash
source /opt/ros/melodic/setup.bash

voxlIP=`hostname -I | awk '{print $1}'`
echo "VOXL IP is: " $voxlIP
export ROS_IP=$voxlIP
echo "ROS_IP is: " $ROS_IP
export ROS_HOSTNAME=$voxlIP
echo "ROS_HOSTNAME is: " $ROS_HOSTNAME
echo "ROS_MASTER_URI is: " $ROS_MASTER_URI

roslaunch voxl_mpa_to_ros voxl_mpa_to_ros.launch
```
Script on laptop: `start_rqt_imageview.sh`
```
#!/bin/bash
# change these to match the computer connecting to VOXL ROS1
MasterIP=192.168.1.100
MyIP=192.168.1.101
ROS_DIST=noetic

# set environment variables and start rqt_image_view
source /opt/ros/$ROS_DIST/setup.bash

export ROS_IP=$MyIP
export ROS_HOSTNAME=$MyIP
export ROS_MASTER_URI=http://$MasterIP:11311

rosrun rqt_image_view rqt_image_view
```

## Reply by Darshit Desai · 2023-09-20 18:03:49 UTC (in reply to ben grocholsky)

@ben-grocholsky Thanks that helped me do it.

My tof_ir, tof_conf image feed is rotated 90 degrees counter clockwise when the drone is in a normal position, is there way to change that rotation

![2d7b7216-09fe-4d10-8fdc-902a2ce2afb0-image.png](https://forum.modalai.com/assets/uploads/files/1695233028201-2d7b7216-09fe-4d10-8fdc-902a2ce2afb0-image.png)

## Reply by Darshit Desai · 2023-09-21 21:50:37 UTC (in reply to Darshit Desai)

@Darshit-Desai @Moderator Can anyone reply on this post?

## Reply by Darshit Desai · 2023-09-25 18:07:17 UTC (in reply to Darshit Desai)

@Darshit-Desai Can anyone help with this? @tom

## Reply by ben grocholsky · 2023-09-28 23:34:48 UTC (in reply to Darshit Desai)

@Darshit-Desai this is a more generic ROS `tf` transform network question than anything specific to ModalAI devices. You can get any result you'd like by adding appropriate frames to map or vehicle in the `tf` tree. For example, since `rviz` is hard coded to expect z axis upwards and everything is easier with z axis down, I'll attach an `ENU` frame to every fixed map `NED` frame and vehicle carried body `FRD` frame. That allows for all algorithms to be implemented in `NED/FRD` and still use ROS visualization by selecting `ENU` frames as `fixed` and `view`.

Check out the `tf` documentation http://wiki.ros.org/tf2

The `static transform publisher` is a quick way to test changes. Then you'll want to explore using http://wiki.ros.org/urdf

## Reply by Darshit Desai · 2023-09-29 00:20:12 UTC (in reply to ben grocholsky)

@ben-grocholsky It shows up the same in VOXL PORTAL too.
Is there a way to get camera intrinsic Matrix of the ToF camera. Also, if I want to align the depth image with the RGB image how do I do that?

## Reply by Darshit Desai · 2023-09-30 00:22:15 UTC (in reply to Darshit Desai)

@Darshit-Desai I wanted to ask one more follow up to this question? The datasheet in voxl-documentation says the PMD TOF runs at 45 fps for ranging distances less then 1 metres. Is there a way to set that?

## Reply by Darshit Desai · 2023-10-04 04:11:06 UTC (in reply to Darshit Desai)

@Darshit-Desai @ben-grocholsky @Moderator

## Reply by Moderator (ModalAI staff) · 2023-10-04 04:51:11 UTC (in reply to Darshit Desai)

@Darshit-Desai No, there is no current way to set that

## Reply by Darshit Desai · 2023-10-05 02:16:33 UTC (in reply to Darshit Desai)

@Darshit-Desai said in [VOXL MPA\_to\_ROS rostopics not subscribing to anything](/post/12454):
> @ben-grocholsky It shows up the same in VOXL PORTAL too.
> Is there a way to get camera intrinsic Matrix of the ToF camera. Also, if I want to align the depth image with the RGB image how do I do that?

@Moderator

## Reply by ben grocholsky · 2023-10-05 03:46:28 UTC (in reply to Darshit Desai)

@Darshit-Desai the recommendation to learn about `tf`, `urdf`, and `xacro` in ROS was because that's a way to achieve what you're asking for. If you get the `launch` and `config` files right then ROS tools such as `rviz` will do what ever you want without writing any code.

## Reply by Darshit Desai · 2023-10-05 03:50:45 UTC (in reply to Darshit Desai)

@Darshit-Desai said in [VOXL MPA\_to\_ROS rostopics not subscribing to anything](/post/12527):
> Is there a way to get camera intrinsic Matrix of the ToF camera. Also, if I want to align the depth image with the RGB image how do I do that?
> 
> 

Hi sorry, I wanted to ask about the intrinsics that was highlighted by mistake. @ben-grocholsky
