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

Noetic 2.10.2 #600

Merged
merged 10 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions depthai-ros/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package depthai-ros
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2.10.2 (2024-09-26)
-------------------
* Fix Stereo K matrix publishing
* Fix socket ID for NN detections
* Remove catching errors when starting the device since it introduced undefined behavior
* Add desqueeze to NN node

2.10.1 (2024-09-18)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion depthai-ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.10.2) # CMake version in Ubuntu 18.04 LTS

project(depthai-ros VERSION 2.10.1 LANGUAGES CXX C)
project(depthai-ros VERSION 2.10.2 LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 14)

Expand Down
2 changes: 1 addition & 1 deletion depthai-ros/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>depthai-ros</name>
<version>2.10.1</version>
<version>2.10.2</version>
<description>The depthai-ros package</description>

<maintainer email="adam.serafin@luxonis.com">Adam Serafin</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion depthai_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.10.2) # CMake version in Ubuntu 18.04 LTS
set (CMAKE_POSITION_INDEPENDENT_CODE ON)

project(depthai_bridge VERSION 2.10.1 LANGUAGES CXX C)
project(depthai_bridge VERSION 2.10.2 LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
2 changes: 1 addition & 1 deletion depthai_bridge/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>depthai_bridge</name>
<version>2.10.1</version>
<version>2.10.2</version>
<description>The depthai_bridge package</description>

<maintainer email="adam.serafin@luxonis.com">Adam Serafin</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion depthai_descriptions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2)
project(depthai_descriptions VERSION 2.10.1 LANGUAGES CXX C)
project(depthai_descriptions VERSION 2.10.2 LANGUAGES CXX C)


find_package(catkin REQUIRED
Expand Down
2 changes: 1 addition & 1 deletion depthai_descriptions/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>depthai_descriptions</name>
<version>2.10.1</version>
<version>2.10.2</version>
<description>The depthai_descriptions package</description>

<maintainer email="adam.serafin@luxonis.com">Adam Serafin</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion depthai_examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.10.2) # CMake version in Ubuntu 18.04 LTS
project(depthai_examples VERSION 2.10.1 LANGUAGES CXX C)
project(depthai_examples VERSION 2.10.2 LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
2 changes: 1 addition & 1 deletion depthai_examples/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>depthai_examples</name>
<version>2.10.1</version>
<version>2.10.2</version>
<description>The depthai_examples package</description>

<maintainer email="adam.serafin@luxonis.com">Adam Serafin</maintainer>
Expand Down
3 changes: 2 additions & 1 deletion depthai_filters/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
cmake_minimum_required(VERSION 3.10.2)
project(depthai_filters VERSION 2.10.1 LANGUAGES CXX C)
project(depthai_filters VERSION 2.10.2 LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_compile_options(-g)
add_definitions(-std=c++14)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ class Detection2DOverlay : public nodelet::Nodelet {
"car", "cat", "chair", "cow", "diningtable", "dog", "horse",
"motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"};
};
} // namespace depthai_filters
} // namespace depthai_filters
2 changes: 1 addition & 1 deletion depthai_filters/launch/example_det2d_overlay.launch
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<remap from="/nn/detections" to="$(arg name)/nn/detections"/>

</node>
</launch>
</launch>
2 changes: 1 addition & 1 deletion depthai_filters/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>depthai_filters</name>
<version>2.10.1</version>
<version>2.10.2</version>
<description>The depthai_filters package</description>

<maintainer email="adam.serafin@luxonis.com">Adam Serafin</maintainer>
Expand Down
1 change: 1 addition & 0 deletions depthai_filters/src/detection2d_overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "depthai_filters/utils.hpp"
#include "nodelet/nodelet.h"
#include "pluginlib/class_list_macros.h"
#include "sensor_msgs/CameraInfo.h"

namespace depthai_filters {
void Detection2DOverlay::onInit() {
Expand Down
2 changes: 1 addition & 1 deletion depthai_ros_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16.3)
project(depthai_ros_driver VERSION 2.10.1)
project(depthai_ros_driver VERSION 2.10.2)
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class Detection : public BaseNode {
if(ph->getParam<bool>("i_disable_resize")) {
width = ph->getOtherNodeParam<int>(socketName, "i_preview_width");
height = ph->getOtherNodeParam<int>(socketName, "i_preview_height");
} else if(ph->getParam<bool>("i_desqueeze_output")) {
width = ph->getOtherNodeParam<int>(socketName, "i_width");
height = ph->getOtherNodeParam<int>(socketName, "i_height");
} else {
width = imageManip->initialConfig.getResizeConfig().width;
height = imageManip->initialConfig.getResizeConfig().height;
Expand All @@ -86,9 +89,12 @@ class Detection : public BaseNode {
convConf.updateROSBaseTimeOnRosMsg = ph->getParam<bool>("i_update_ros_base_time_on_ros_msg");

utils::ImgPublisherConfig pubConf;
pubConf.width = width;
pubConf.height = height;
pubConf.daiNodeName = getName();
pubConf.topicName = "~/" + getName();
pubConf.topicSuffix = "passthrough";
pubConf.topicName = getName() + "/passthrough";
pubConf.infoSuffix = "/passthrough";
pubConf.infoMgrSuffix = "/passthrough";
pubConf.socket = static_cast<dai::CameraBoardSocket>(ph->getParam<int>("i_board_socket_id"));

ptPub->setup(device, convConf, pubConf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ class SpatialDetection : public BaseNode {
pubConf.width = width;
pubConf.height = height;
pubConf.daiNodeName = getName();
pubConf.topicName = "~/" + getName();
pubConf.topicSuffix = "passthrough";
pubConf.topicName = getName() + "/passthrough";
pubConf.infoSuffix = "/passthrough";
pubConf.infoMgrSuffix = "/passthrough";
pubConf.socket = static_cast<dai::CameraBoardSocket>(ph->getParam<int>("i_board_socket_id"));

ptPub->setup(device, convConf, pubConf);
Expand All @@ -100,8 +101,9 @@ class SpatialDetection : public BaseNode {
pubConf.width = ph->getOtherNodeParam<int>(sensor_helpers::getNodeName(getROSNode(), sensor_helpers::NodeNameEnum::Stereo), "i_width");
pubConf.height = ph->getOtherNodeParam<int>(sensor_helpers::getNodeName(getROSNode(), sensor_helpers::NodeNameEnum::Stereo), "i_height");
pubConf.daiNodeName = getName();
pubConf.topicName = "~/" + getName();
pubConf.topicSuffix = "/passthrough_depth";
pubConf.topicName = getName() + "/passthrough_depth";
pubConf.infoSuffix = "/passthrough_depth";
pubConf.infoMgrSuffix = "/passthrough_depth";
pubConf.socket = socket;

ptDepthPub->setup(device, convConf, pubConf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class NNParamHandler : public BaseParamHandler {
template <typename T>
void declareParams(std::shared_ptr<T> nn, std::shared_ptr<dai::node::ImageManip> imageManip) {
declareAndLogParam<bool>("i_disable_resize", false);
declareAndLogParam<bool>("i_desqueeze_output", false);
declareAndLogParam<bool>("i_enable_passthrough", false);
declareAndLogParam<bool>("i_enable_passthrough_depth", false);
declareAndLogParam<bool>("i_get_base_device_timestamp", false);
Expand Down Expand Up @@ -106,11 +107,15 @@ class NNParamHandler : public BaseParamHandler {
json data = json::parse(f);
if(data.contains("model") && data.contains("nn_config")) {
auto modelPath = getModelPath(data);
setImageManip(modelPath, imageManip);
modelPath = declareAndLogParam<std::string>("i_model_path", modelPath);
if(!getParam<bool>("i_disable_resize")) {
setImageManip(modelPath, imageManip);
}
nn->setBlobPath(modelPath);
nn->setNumPoolFrames(4);
nn->setNumInferenceThreads(2);
nn->setNumPoolFrames(declareAndLogParam<int>("i_num_pool_frames", 4));
nn->setNumInferenceThreads(declareAndLogParam<int>("i_num_inference_threads", 2));
nn->input.setBlocking(false);
declareAndLogParam<int>("i_max_q_size", 30);
setNNParams(data, nn);
}
}
Expand All @@ -124,4 +129,4 @@ class NNParamHandler : public BaseParamHandler {
std::vector<std::string> labels;
};
} // namespace param_handlers
} // namespace depthai_ros_driver
} // namespace depthai_ros_driver
1 change: 1 addition & 0 deletions depthai_ros_driver/include/depthai_ros_driver/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct ImgPublisherConfig {
dai::CameraBoardSocket rightSocket = dai::CameraBoardSocket::CAM_C;
std::string calibrationFile = "";
std::string topicSuffix = "/image_raw";
std::string infoSuffix = "";
std::string compressedTopicSuffix = "/image_raw/compressed";
std::string infoMgrSuffix = "";
bool rectified = false;
Expand Down
2 changes: 1 addition & 1 deletion depthai_ros_driver/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>depthai_ros_driver</name>
<version>2.10.1</version>
<version>2.10.2</version>
<description>Depthai ROS Monolithic node.</description>
<maintainer email="adam.serafin@luxonis.com">Adam Serafin</maintainer>
<author>Adam Serafin</author>
Expand Down
19 changes: 5 additions & 14 deletions depthai_ros_driver/src/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,11 @@ void Camera::diagCB(const diagnostic_msgs::DiagnosticArray::ConstPtr& msg) {
}

void Camera::start() {
bool success = false;
while(!success) {
try {
ROS_INFO("Starting camera.");
if(!camRunning) {
onConfigure();
} else {
ROS_INFO("Camera already running!.");
}
success = true;
} catch(const std::exception& e) {
ROS_ERROR("Exception occurred: %s. Retry", e.what());
camRunning = false;
}
ROS_INFO("Starting camera.");
if(!camRunning) {
onConfigure();
} else {
ROS_INFO("Camera already running!.");
}
}
void Camera::stop() {
Expand Down
6 changes: 3 additions & 3 deletions depthai_ros_driver/src/dai_nodes/nn/nn_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ NNWrapper::NNWrapper(const std::string& daiNodeName, ros::NodeHandle node, std::
auto family = ph->getNNFamily();
switch(family) {
case param_handlers::nn::NNFamily::Yolo: {
nnNode = std::make_unique<dai_nodes::nn::Detection<dai::node::YoloDetectionNetwork>>(getName(), getROSNode(), pipeline);
nnNode = std::make_unique<dai_nodes::nn::Detection<dai::node::YoloDetectionNetwork>>(getName(), getROSNode(), pipeline, socket);
break;
}
case param_handlers::nn::NNFamily::Mobilenet: {
nnNode = std::make_unique<dai_nodes::nn::Detection<dai::node::MobileNetDetectionNetwork>>(getName(), getROSNode(), pipeline);
nnNode = std::make_unique<dai_nodes::nn::Detection<dai::node::MobileNetDetectionNetwork>>(getName(), getROSNode(), pipeline, socket);
break;
}
case param_handlers::nn::NNFamily::Segmentation: {
nnNode = std::make_unique<dai_nodes::nn::Segmentation>(getName(), getROSNode(), pipeline);
nnNode = std::make_unique<dai_nodes::nn::Segmentation>(getName(), getROSNode(), pipeline, socket);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions depthai_ros_driver/src/dai_nodes/nn/spatial_nn_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ SpatialNNWrapper::SpatialNNWrapper(const std::string& daiNodeName,
auto family = ph->getNNFamily();
switch(family) {
case param_handlers::nn::NNFamily::Yolo: {
nnNode = std::make_unique<dai_nodes::nn::SpatialDetection<dai::node::YoloSpatialDetectionNetwork>>(getName(), getROSNode(), pipeline);
nnNode = std::make_unique<dai_nodes::nn::SpatialDetection<dai::node::YoloSpatialDetectionNetwork>>(getName(), getROSNode(), pipeline, socket);
break;
}
case param_handlers::nn::NNFamily::Mobilenet: {
nnNode = std::make_unique<dai_nodes::nn::SpatialDetection<dai::node::MobileNetSpatialDetectionNetwork>>(getName(), getROSNode(), pipeline);
nnNode = std::make_unique<dai_nodes::nn::SpatialDetection<dai::node::MobileNetSpatialDetectionNetwork>>(getName(), getROSNode(), pipeline, socket);
break;
}
case param_handlers::nn::NNFamily::Segmentation: {
Expand Down
5 changes: 2 additions & 3 deletions depthai_ros_driver/src/dai_nodes/sensors/img_pub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void ImagePublisher::setup(std::shared_ptr<dai::Device> device, const utils::Img
} else {
ffmpegPub = node.advertise<depthai_ros_msgs::FFMPEGPacket>(pubConfig.topicName + pubConfig.compressedTopicSuffix, 10);
}
infoPub = node.advertise<sensor_msgs::CameraInfo>(pubConfig.topicName + "/camera_info", 10);
infoPub = node.advertise<sensor_msgs::CameraInfo>(pubConfig.topicName + pubConfig.infoSuffix + "/camera_info", 10);
} else {
imgPubIT = it.advertiseCamera(pubConfig.topicName + pubConfig.topicSuffix, 10);
}
Expand Down Expand Up @@ -110,13 +110,12 @@ std::shared_ptr<dai::node::VideoEncoder> ImagePublisher::createEncoder(std::shar
return enc;
}
void ImagePublisher::createInfoManager(std::shared_ptr<dai::Device> device) {
infoManager = std::make_shared<camera_info_manager::CameraInfoManager>(ros::NodeHandle(node, pubConfig.daiNodeName),
infoManager = std::make_shared<camera_info_manager::CameraInfoManager>(ros::NodeHandle(node, pubConfig.daiNodeName + pubConfig.infoMgrSuffix),
"/" + pubConfig.daiNodeName + pubConfig.infoMgrSuffix);
if(pubConfig.calibrationFile.empty()) {
auto info = sensor_helpers::getCalibInfo(converter, device, pubConfig.socket, pubConfig.width, pubConfig.height);
if(pubConfig.rectified) {
std::fill(info.D.begin(), info.D.end(), 0.0);
std::fill(info.K.begin(), info.K.end(), 0.0);
info.R[0] = info.R[4] = info.R[8] = 1.0;
}
infoManager->setCameraInfo(info);
Expand Down
3 changes: 2 additions & 1 deletion depthai_ros_driver/src/dai_nodes/sensors/rgb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void RGB::setupQueues(std::shared_ptr<dai::Device> device) {

utils::ImgPublisherConfig pubConfig;
pubConfig.daiNodeName = getName();
pubConfig.topicName = "~/" + getName();
pubConfig.topicName = getName();
pubConfig.lazyPub = ph->getParam<bool>("i_enable_lazy_publisher");
pubConfig.socket = static_cast<dai::CameraBoardSocket>(ph->getParam<int>("i_board_socket_id"));
pubConfig.calibrationFile = ph->getParam<std::string>("i_calibration_file");
Expand All @@ -108,6 +108,7 @@ void RGB::setupQueues(std::shared_ptr<dai::Device> device) {
pubConfig.height = ph->getParam<int>("i_preview_height");
pubConfig.maxQSize = ph->getParam<int>("i_max_q_size");
pubConfig.topicSuffix = "/preview/image_raw";
pubConfig.infoMgrSuffix = "/preview";

previewPub->setup(device, convConfig, pubConfig);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ SensorWrapper::SensorWrapper(const std::string& daiNodeName,
converter = std::make_unique<dai::ros::ImageConverter>(true);
setNames();
setXinXout(pipeline);
socketID = ph->getParam<int>("i_board_socket_id");
}
socketID = ph->getParam<int>("i_board_socket_id");
if(ph->getParam<bool>("i_disable_node") && ph->getParam<bool>("i_simulate_from_topic")) {
ROS_INFO("Disabling node %s, pipeline data taken from topic.", getName().c_str());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void SensorParamHandler::declareCommonParams(dai::CameraBoardSocket socket) {
declareAndLogParam<std::string>("i_simulated_topic_name", "");
declareAndLogParam<bool>("i_disable_node", false);
declareAndLogParam<bool>("i_get_base_device_timestamp", false);
socketID = static_cast<dai::CameraBoardSocket>(declareAndLogParam<int>("i_board_socket_id", static_cast<int>(socket), 0));
socketID = static_cast<dai::CameraBoardSocket>(declareAndLogParam<int>("i_board_socket_id", static_cast<int>(socket), false));
declareAndLogParam<bool>("i_update_ros_base_time_on_ros_msg", false);
declareAndLogParam<bool>("i_enable_feature_tracker", false);
declareAndLogParam<bool>("i_enable_nn", false);
Expand Down
2 changes: 1 addition & 1 deletion depthai_ros_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.10.2) # CMake version in Ubuntu 18.04 LTS

project (depthai_ros_msgs VERSION 2.10.1)
project (depthai_ros_msgs VERSION 2.10.2)

if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
Expand Down
2 changes: 1 addition & 1 deletion depthai_ros_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>depthai_ros_msgs</name>
<version>2.10.1</version>
<version>2.10.2</version>
<description>Package to keep interface independent of the driver</description>

<maintainer email="adam.serafin@luxonis.com">Adam Serafin</maintainer>
Expand Down
Loading