Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

kinect_rgbd launch file does not parse sensor_sn properly #264

Open
TheodoroCardoso opened this issue Jan 4, 2023 · 3 comments
Open

kinect_rgbd launch file does not parse sensor_sn properly #264

TheodoroCardoso opened this issue Jan 4, 2023 · 3 comments
Labels
bug Something isn't working triage needed The Issue still needs to be reviewed by the Azure Kinect ROS Driver Team

Comments

@TheodoroCardoso
Copy link

TheodoroCardoso commented Jan 4, 2023

Describe the bug
As opposed to driver.launch which actually uses the correct serial number (sensor_sn parameter), the kinect_rgbd.launch file seems to ignore it, even though it's passed into the k4a_ros_bridge nodelet

To Reproduce
roslaunch azure_kinect_ros_driver kinect_rgbd.launch sensor_sn:=999

Expected behavior
Parse the parameter properly, print it, and launch the camera that has the provided serial number when multiple devices are connected.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 - ROS Noetic

Additional context
roslaunch azure_kinect_ros_driver driver.launch sensor_sn:=999
Prints:

[ INFO] [1672839922.394529610]: K4A Parameters:
[ INFO] [1672839922.395489727]: sensor_sn - std::string : 999

roslaunch azure_kinect_ros_driver kinect_rgbd.launch sensor_sn:=999
Prints:

[ INFO] [1672839906.401629522]: K4A ROS Nodelet Start
[ INFO] [1672839906.429111080]: K4A Parameters:
[ INFO] [1672839906.429242463]: sensor_sn - std::string : 
@TheodoroCardoso TheodoroCardoso added bug Something isn't working triage needed The Issue still needs to be reviewed by the Azure Kinect ROS Driver Team labels Jan 4, 2023
@farazxavor
Copy link

Hello Theo,

You need to specify the type of the sensor_sn param on line 96 as follows

<param name="sensor_sn" type="string" value="$(arg sensor_sn)" />

For some reason, the sensor_sn parameter doesn't get parsed in C++ code without specifying the argument type.

@TheodoroCardoso
Copy link
Author

Hey farazxavor,

This indeed does the trick.

Just tested it with real hardware.
Here's my fork with type added to all params just like in driver.launch
melodic...TheodoroCardoso:Azure_Kinect_ROS_Driver:melodic

Thanks for pointing that out!

@Pempafugue
Copy link

Hello,
So I have been struggling with this problem too on Ubuntu 22.04
I first tried to use
sensor_sn_value = ParameterValue(value=LaunchConfiguration('sensor_sn'), value_type=str)
And it worked fine for a serial number, but when I tried for 001087594512 somehow, I get the error that I am sending a double to the node.
It may be cause by the way python process numbers starting by 00 in the background, converting them into double.
My workaround is to add a letter to the string, such as S001087594512 and add
if(params_.sensor_sn != ""){ params_.sensor_sn.erase(0, 1); } in the k4a_ros_device.cpp, and it works fine

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working triage needed The Issue still needs to be reviewed by the Azure Kinect ROS Driver Team
Projects
None yet
Development

No branches or pull requests

3 participants