-
Notifications
You must be signed in to change notification settings - Fork 2k
Support D555 and its motion profiles #3222
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,24 +107,31 @@ void RealSenseNodeFactory::getDevice(rs2::device_list list) | |
| std::vector<std::string> results; | ||
| ROS_INFO_STREAM("Device with name " << name << " was found."); | ||
| std::string port_id = parseUsbPort(pn); | ||
| if (port_id.empty()) | ||
|
|
||
| std::string pid_str(dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID)); | ||
| if(pid_str != "DDS") | ||
| { | ||
| std::stringstream msg; | ||
| msg << "Error extracting usb port from device with physical ID: " << pn << std::endl << "Please report on github issue at https://github.com/IntelRealSense/realsense-ros"; | ||
| if (_usb_port_id.empty()) | ||
| if (port_id.empty()) | ||
| { | ||
| ROS_WARN_STREAM(msg.str()); | ||
| std::stringstream msg; | ||
| msg << "Error extracting usb port from device with physical ID: " << pn << std::endl | ||
| << "Please report on github issue at https://github.com/IntelRealSense/realsense-ros"; | ||
| if (_usb_port_id.empty()) | ||
| { | ||
| ROS_WARN_STREAM(msg.str()); | ||
| } | ||
| else | ||
| { | ||
| ROS_ERROR_STREAM(msg.str()); | ||
| ROS_ERROR_STREAM("Please use serial number instead of usb port."); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The user asked for a USB port? |
||
| } | ||
| } | ||
| else | ||
| { | ||
| ROS_ERROR_STREAM(msg.str()); | ||
| ROS_ERROR_STREAM("Please use serial number instead of usb port."); | ||
| ROS_INFO_STREAM("Device with port number " << port_id << " was found."); | ||
| } | ||
| } | ||
| else | ||
| { | ||
| ROS_INFO_STREAM("Device with port number " << port_id << " was found."); | ||
| } | ||
|
|
||
| bool found_device_type(true); | ||
| if (!_device_type.empty()) | ||
| { | ||
|
|
@@ -352,8 +359,20 @@ void RealSenseNodeFactory::init() | |
| void RealSenseNodeFactory::startDevice() | ||
| { | ||
| if (_realSenseNode) _realSenseNode.reset(); | ||
| std::string device_name = _device.get_info(RS2_CAMERA_INFO_NAME); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also we have 2 lines here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed, unified the calls to be x(y) on both. |
||
| std::string pid_str(_device.get_info(RS2_CAMERA_INFO_PRODUCT_ID)); | ||
| uint16_t pid = std::stoi(pid_str, 0, 16); | ||
| uint16_t pid; | ||
|
|
||
| if (device_name == "Intel RealSense D555") | ||
| { | ||
| // currently the PID of DDS devices is hardcoded as "DDS" | ||
| // need to be fixed in librealsense | ||
| pid = RS555_PID; | ||
| } | ||
| else | ||
| { | ||
| pid = std::stoi(pid_str, 0, 16); | ||
| } | ||
| try | ||
| { | ||
| switch(pid) | ||
|
|
@@ -374,6 +393,7 @@ void RealSenseNodeFactory::startDevice() | |
| case RS435i_RGB_PID: | ||
| case RS455_PID: | ||
| case RS457_PID: | ||
| case RS555_PID: | ||
| case RS_USB2_PID: | ||
| _realSenseNode = std::unique_ptr<BaseRealSenseNode>(new BaseRealSenseNode(*this, _device, _parameters, this->get_node_options().use_intra_process_comms())); | ||
| break; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,8 +295,14 @@ void BaseRealSenseNode::startPublishers(const std::vector<stream_profile>& profi | |
| rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(qos), qos)); | ||
| // Publish Intrinsics: | ||
| info_topic_name << "~/" << stream_name << "/imu_info"; | ||
| _imu_info_publishers[sip] = _node.create_publisher<IMUInfo>(info_topic_name.str(), | ||
| rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(info_qos), info_qos)); | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where did we took the QOS before?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. before, we took it from "info_qos", but this was a buggy thing for imu_info. so, I tested it on different cameras, and it's not working as expected. So, I changed the QoS to be manually setted.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed to used rmw_qos_profile_latched, like the extrinsics topics. |
||
| // QoS settings for Latching-like behavior for the imu_info topic | ||
| // History: KeepLast(1) - Retains only the last message | ||
| // Durability: Transient Local - Ensures that late subscribers get the last message that was published | ||
| // Reliability: Ensures reliable delivery of messages | ||
| auto qos = rclcpp::QoS(rclcpp::KeepLast(1)).transient_local().reliable(); | ||
| _imu_info_publishers[sip] = _node.create_publisher<IMUInfo>(info_topic_name.str(), qos); | ||
|
|
||
| IMUInfo info_msg = getImuInfo(profile); | ||
| _imu_info_publishers[sip]->publish(info_msg); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.