Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add USB information to DeviceInfo.srv #2649

Closed
stwirth opened this issue Mar 10, 2023 · 7 comments
Closed

Feature request: Add USB information to DeviceInfo.srv #2649

stwirth opened this issue Mar 10, 2023 · 7 comments
Labels

Comments

@stwirth
Copy link
Contributor

stwirth commented Mar 10, 2023

On startup, the camera driver reports a lot of interesting information:

[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.009290]: Device with serial number 147422020966 was found.                                                           
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.009337]: Device with physical ID 5-2.1-10 was found.                                                                 
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.009356]: Device with name Intel RealSense D410 was found.                                                            
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.010046]: Device with port number 5-2.1 was found.                                                                    
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.010070]: Device USB type: 3.2                                                    
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.012230]: getParameters...                                                                                            
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.039811]: setupDevice...                                                                                              
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.039825]: JSON file is not provided                                                                                   
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.039833]: ROS Node Namespace: camera       
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.039841]: Device Name: Intel RealSense D410                                                                           
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.039847]: Device Serial No: 147422020966                
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.039853]: Device physical port: 5-2.1-10                                                                              
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.039859]: Device FW version: 05.12.07.150                                                                             
[INFO] [/camera/nodelet_manager] [2023-03-10 03:17:48.039865]: Device Product ID: 0x0AD2

I would like to have this information available at runtime, especially "port number 5-2.1" and "physical ID 5-2.1-10".
I think it would be great if this could be added to the fields in DeviceInfo.srv.

@MartyG-RealSense
Copy link
Collaborator

Hi @stwirth Camera information is published by the ROS wrapper on the /diagnostics topic. Do you get the information that you need if you echo the topic with the following command:

rostopic echo /diagnostics

@stwirth
Copy link
Contributor Author

stwirth commented Mar 10, 2023

Hi @MartyG-RealSense,
no, I don't see that information there.

@MartyG-RealSense
Copy link
Collaborator

The device information can be accessed in the wrapper through a device_info 'service call'.

ROS1
https://github.com/IntelRealSense/realsense-ros/tree/ros1-legacy#available-services

ROS2
https://github.com/IntelRealSense/realsense-ros/tree/ros2-development#available-services

@stwirth
Copy link
Contributor Author

stwirth commented Mar 10, 2023

@MartyG-RealSense sorry if I wasn't clear, I see that service, I would like to have it return additional fields regarding the USB device information.
Should be pretty trivial to add here:

void BaseRealSenseNode::getDeviceInfo(const realsense2_camera_msgs::srv::DeviceInfo::Request::SharedPtr,
realsense2_camera_msgs::srv::DeviceInfo::Response::SharedPtr res)
{
res->device_name = _dev.supports(RS2_CAMERA_INFO_NAME) ? create_graph_resource_name(_dev.get_info(RS2_CAMERA_INFO_NAME)) : "";
res->serial_number = _dev.supports(RS2_CAMERA_INFO_SERIAL_NUMBER) ? _dev.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER) : "";
res->firmware_version = _dev.supports(RS2_CAMERA_INFO_FIRMWARE_VERSION) ? _dev.get_info(RS2_CAMERA_INFO_FIRMWARE_VERSION) : "";
res->usb_type_descriptor = _dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR) ? _dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR) : "";
res->firmware_update_id = _dev.supports(RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID) ? _dev.get_info(RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID) : "";

@MartyG-RealSense
Copy link
Collaborator

You are welcome to submit an edit of rs_node_setup.cpp as a Pull Request (PR) for consideration for merging by the RealSense ROS developer team into the ROS wrapper.

https://github.com/IntelRealSense/realsense-ros/pulls

You could also create a custom 'fork' version of the wrapper on your own GitHub account and make the edit there.

image

@stwirth
Copy link
Contributor Author

stwirth commented Mar 13, 2023

PRs for ROS1 (#2654) and ROS2 (#2655) created.

@MartyG-RealSense
Copy link
Collaborator

Thanks so much for the PRs!

@Nir-Az Nir-Az closed this as completed in 7d77cb0 Mar 14, 2023
SamerKhshiboun pushed a commit to SamerKhshiboun/realsense-ros that referenced this issue Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants