Skip to content

Commit 10ce437

Browse files
authored
Noetic 2.10.1 (#590)
1 parent e4e7013 commit 10ce437

File tree

83 files changed

+3100
-1250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3100
-1250
lines changed

depthai-ros/CHANGELOG.rst

+23
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
Changelog for package depthai-ros
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
2.10.1 (2024-09-18)
6+
-------------------
7+
* Fix ToF synced publishing
8+
* Add camera_info publishing when publishing compressed images
9+
* Catch errors when starting the device
10+
11+
2.10.0 (2024-08-29)
12+
-------------------
13+
* Adding stl files for SR and LR models by @danilo-pejovic in https://github.com/luxonis/depthai-ros/pull/491
14+
* No imu fix Humble by @Serafadam in https://github.com/luxonis/depthai-ros/pull/500
15+
* Tracking converter for ROS2 Humble by @daniqsilva25 in https://github.com/luxonis/depthai-ros/pull/505
16+
* Added Env Hooks so that depthai xacro can be used with gazebo sim by @r4hul77 in https://github.com/luxonis/depthai-ros/pull/507
17+
* Fix resource paths for Ignition Gazebo by @Nibanovic in https://github.com/luxonis/depthai-ros/pull/511
18+
* Use simulation flag to decide how to load meshes. by @destogl in https://github.com/luxonis/depthai-ros/pull/524
19+
* Add new launch file for starting multiple rgbd cameras on robots. by @destogl in https://github.com/luxonis/depthai-ros/pull/532
20+
* Missing fields in detection messages Humble by @Serafadam in https://github.com/luxonis/depthai-ros/pull/574
21+
* Ip autodiscovery fix Humble by @Serafadam in https://github.com/luxonis/depthai-ros/pull/561
22+
* RS Mode & Sync - Humble by @Serafadam in https://github.com/luxonis/depthai-ros/pull/578
23+
* Compressed image publishers by @Serafadam in https://github.com/luxonis/depthai-ros/pull/580
24+
* ToF Support Humble by @Serafadam in https://github.com/luxonis/depthai-ros/pull/581
25+
* WLS fix humble by @Serafadam in https://github.com/luxonis/depthai-ros/pull/582
26+
* Syncing & RS updates Humble by @Serafadam in https://github.com/luxonis/depthai-ros/pull/586
27+
528
2.9.0 (2024-01-24)
629
-------------------
730

depthai-ros/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required (VERSION 3.10.2) # CMake version in Ubuntu 18.04 LTS
22

3-
project(depthai-ros VERSION 2.9.0 LANGUAGES CXX C)
3+
project(depthai-ros VERSION 2.10.1 LANGUAGES CXX C)
44

55
set(CMAKE_CXX_STANDARD 14)
66

depthai-ros/package.xml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<?xml version="1.0"?>
22
<package format="3">
33
<name>depthai-ros</name>
4-
<version>2.9.0</version>
4+
<version>2.10.1</version>
55
<description>The depthai-ros package</description>
66

7-
<!-- One maintainer tag required, multiple allowed, one person per tag -->
8-
<!-- Example: -->
9-
<!-- <maintainer email="[email protected]">Jane Doe</maintainer> -->
10-
<maintainer email="[email protected]">sachin</maintainer>
7+
<maintainer email="[email protected]">Adam Serafin</maintainer>
118
<author>Sachin Guruswamy</author>
129

1310
<license>MIT</license>

depthai_bridge/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
cmake_minimum_required (VERSION 3.10.2) # CMake version in Ubuntu 18.04 LTS
22
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
33

4-
project(depthai_bridge VERSION 2.9.0 LANGUAGES CXX C)
4+
project(depthai_bridge VERSION 2.10.1 LANGUAGES CXX C)
55

66
set(CMAKE_CXX_STANDARD 14)
77
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
89

910
# Update the policy setting to avoid an error when loading the ament_cmake package
1011
# at the current cmake version level
@@ -55,6 +56,8 @@ FILE(GLOB LIB_SRC
5556
"src/ImuConverter.cpp"
5657
"src/TFPublisher.cpp"
5758
"src/TrackedFeaturesConverter.cpp"
59+
"src/TrackedDetectionConverter.cpp"
60+
"src/TrackedSpatialDetectionConverter.cpp"
5861
)
5962

6063
catkin_package(

depthai_bridge/include/depthai_bridge/ImageConverter.hpp

+36-18
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
#include "depthai-shared/common/CameraBoardSocket.hpp"
1010
#include "depthai-shared/common/Point2f.hpp"
1111
#include "depthai/device/CalibrationHandler.hpp"
12+
#include "depthai/pipeline/datatype/EncodedFrame.hpp"
1213
#include "depthai/pipeline/datatype/ImgFrame.hpp"
14+
#include "depthai_ros_msgs/FFMPEGPacket.h"
1315
#include "ros/time.h"
1416
#include "sensor_msgs/CameraInfo.h"
17+
#include "sensor_msgs/CompressedImage.h"
1518
#include "sensor_msgs/Image.h"
1619
#include "std_msgs/Header.h"
1720

@@ -21,8 +24,11 @@ namespace ros {
2124

2225
namespace StdMsgs = std_msgs;
2326
namespace ImageMsgs = sensor_msgs;
27+
namespace DepthAiRosMsgs = depthai_ros_msgs;
2428
using ImagePtr = ImageMsgs::ImagePtr;
2529
using TimePoint = std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration>;
30+
using FFMPegImagePtr = DepthAiRosMsgs::FFMPEGPacketPtr;
31+
using CompImagePtr = ImageMsgs::CompressedImagePtr;
2632

2733
class ImageConverter {
2834
public:
@@ -44,7 +50,7 @@ class ImageConverter {
4450
* @param update: bool whether to automatically update the ROS base time on message conversion
4551
*/
4652
void setUpdateRosBaseTimeOnToRosMsg(bool update = true) {
47-
_updateRosBaseTimeOnToRosMsg = update;
53+
updateRosBaseTimeOnToRosMsg = update;
4854
}
4955

5056
/**
@@ -77,10 +83,20 @@ class ImageConverter {
7783
*/
7884
void setAlphaScaling(double alphaScalingFactor = 0.0);
7985

86+
/**
87+
* @brief Sets the encoding of the image when converting to FFMPEG message. Default is libx264.
88+
* @param encoding: The encoding to be used.
89+
*/
90+
void setFFMPEGEncoding(const std::string& encoding);
91+
8092
ImageMsgs::Image toRosMsgRawPtr(std::shared_ptr<dai::ImgFrame> inData, const sensor_msgs::CameraInfo& info = sensor_msgs::CameraInfo());
8193
void toRosMsg(std::shared_ptr<dai::ImgFrame> inData, std::deque<ImageMsgs::Image>& outImageMsgs);
8294
ImagePtr toRosMsgPtr(std::shared_ptr<dai::ImgFrame> inData);
8395

96+
DepthAiRosMsgs::FFMPEGPacket toRosFFMPEGPacket(std::shared_ptr<dai::EncodedFrame> inData);
97+
98+
ImageMsgs::CompressedImage toRosCompressedMsg(std::shared_ptr<dai::ImgFrame> inData);
99+
84100
void toDaiMsg(const ImageMsgs::Image& inMsg, dai::ImgFrame& outData);
85101

86102
/** TODO(sachin): Add support for ros msg to cv mat since we have some
@@ -99,29 +115,31 @@ class ImageConverter {
99115
static std::unordered_map<dai::RawImgFrame::Type, std::string> encodingEnumMap;
100116
static std::unordered_map<dai::RawImgFrame::Type, std::string> planarEncodingEnumMap;
101117

102-
// dai::RawImgFrame::Type _srcType;
103-
bool _daiInterleaved;
118+
bool daiInterleaved;
104119
// bool c
105-
const std::string _frameName = "";
120+
const std::string frameName = "";
106121
void planarToInterleaved(const std::vector<uint8_t>& srcData, std::vector<uint8_t>& destData, int w, int h, int numPlanes, int bpp);
107122
void interleavedToPlanar(const std::vector<uint8_t>& srcData, std::vector<uint8_t>& destData, int w, int h, int numPlanes, int bpp);
108-
std::chrono::time_point<std::chrono::steady_clock> _steadyBaseTime;
123+
std::chrono::time_point<std::chrono::steady_clock> steadyBaseTime;
109124

110-
::ros::Time _rosBaseTime;
111-
bool _getBaseDeviceTimestamp;
125+
::ros::Time rosBaseTime;
126+
bool getBaseDeviceTimestamp;
112127
// For handling ROS time shifts and debugging
113-
int64_t _totalNsChange{0};
128+
int64_t totalNsChange{0};
114129
// Whether to update the ROS base time on each message conversion
115-
bool _updateRosBaseTimeOnToRosMsg{false};
116-
dai::RawImgFrame::Type _srcType;
117-
bool _fromBitstream = false;
118-
bool _convertDispToDepth = false;
119-
bool _addExpOffset = false;
120-
dai::CameraExposureOffset _expOffset;
121-
bool _reverseStereoSocketOrder = false;
122-
double _baseline;
123-
bool _alphaScalingEnabled = false;
124-
double _alphaScalingFactor = 0.0;
130+
bool updateRosBaseTimeOnToRosMsg{false};
131+
dai::RawImgFrame::Type srcType;
132+
bool fromBitstream = false;
133+
bool dispToDepth = false;
134+
bool addExpOffset = false;
135+
dai::CameraExposureOffset expOffset;
136+
bool reversedStereoSocketOrder = false;
137+
double baseline;
138+
bool alphaScalingEnabled = false;
139+
double alphaScalingFactor = 0.0;
140+
int camHeight = -1;
141+
int camWidth = -1;
142+
std::string ffmpegEncoding = "libx264";
125143
};
126144

127145
} // namespace ros

depthai_bridge/include/depthai_bridge/TFPublisher.hpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ class TFPublisher {
6565
*/
6666
bool modelNameAvailable();
6767
std::string getCamSocketName(int socketNum);
68-
std::shared_ptr<tf2_ros::StaticTransformBroadcaster> _tfPub;
69-
std::shared_ptr<robot_state_publisher::RobotStatePublisher> _rsp;
70-
std::string _camName;
71-
std::string _camModel;
72-
std::string _baseFrame;
73-
std::string _parentFrame;
74-
std::string _camPosX;
75-
std::string _camPosY;
76-
std::string _camPosZ;
77-
std::string _camRoll;
78-
std::string _camPitch;
79-
std::string _camYaw;
80-
std::string _imuFromDescr;
81-
std::string _customURDFLocation;
82-
std::string _customXacroArgs;
83-
std::vector<dai::CameraFeatures> _camFeatures;
84-
const std::unordered_map<dai::CameraBoardSocket, std::string> _socketNameMap = {
68+
std::shared_ptr<tf2_ros::StaticTransformBroadcaster> tfPub;
69+
std::shared_ptr<robot_state_publisher::RobotStatePublisher> rsp;
70+
std::string camName;
71+
std::string camModel;
72+
std::string baseFrame;
73+
std::string parentFrame;
74+
std::string camPosX;
75+
std::string camPosY;
76+
std::string camPosZ;
77+
std::string camRoll;
78+
std::string camPitch;
79+
std::string camYaw;
80+
std::string imuFromDescr;
81+
std::string customURDFLocation;
82+
std::string customXacroArgs;
83+
std::vector<dai::CameraFeatures> camFeatures;
84+
const std::unordered_map<dai::CameraBoardSocket, std::string> socketNameMap = {
8585
{dai::CameraBoardSocket::AUTO, "rgb"},
8686
{dai::CameraBoardSocket::CAM_A, "rgb"},
8787
{dai::CameraBoardSocket::CAM_B, "left"},
@@ -91,4 +91,4 @@ class TFPublisher {
9191
};
9292
};
9393
} // namespace ros
94-
} // namespace dai
94+
} // namespace dai
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#pragma once
2+
3+
#include <deque>
4+
#include <memory>
5+
#include <tuple>
6+
7+
#include "depthai/pipeline/datatype/Tracklets.hpp"
8+
#include "depthai_ros_msgs/TrackDetection2DArray.h"
9+
#include "ros/time.h"
10+
#include "vision_msgs/Detection2DArray.h"
11+
12+
namespace dai {
13+
14+
namespace ros {
15+
16+
class TrackDetectionConverter {
17+
public:
18+
TrackDetectionConverter(std::string frameName, int width, int height, bool normalized, float thresh, bool getBaseDeviceTimestamp = false);
19+
~TrackDetectionConverter() = default;
20+
21+
/**
22+
* @brief Handles cases in which the ROS time shifts forward or backward
23+
* Should be called at regular intervals or on-change of ROS time, depending
24+
* on monitoring.
25+
*
26+
*/
27+
void updateRosBaseTime();
28+
29+
/**
30+
* @brief Commands the converter to automatically update the ROS base time on message conversion based on variable
31+
*
32+
* @param update: bool whether to automatically update the ROS base time on message conversion
33+
*/
34+
void setUpdateRosBaseTimeOnToRosMsg(bool update = true) {
35+
_updateRosBaseTimeOnToRosMsg = update;
36+
}
37+
38+
void toRosMsg(std::shared_ptr<dai::Tracklets> trackData, std::deque<depthai_ros_msgs::TrackDetection2DArray>& opDetectionMsgs);
39+
40+
depthai_ros_msgs::TrackDetection2DArray::Ptr toRosMsgPtr(std::shared_ptr<dai::Tracklets> trackData);
41+
42+
private:
43+
int _width, _height;
44+
const std::string _frameName;
45+
bool _normalized;
46+
float _thresh;
47+
std::chrono::time_point<std::chrono::steady_clock> _steadyBaseTime;
48+
::ros::Time _rosBaseTime;
49+
bool _getBaseDeviceTimestamp;
50+
// For handling ROS time shifts and debugging
51+
int64_t _totalNsChange{0};
52+
// Whether to update the ROS base time on each message conversion
53+
bool _updateRosBaseTimeOnToRosMsg{false};
54+
};
55+
} // namespace ros
56+
} // namespace dai
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#pragma once
2+
3+
#include <deque>
4+
#include <memory>
5+
#include <string>
6+
7+
#include "depthai/pipeline/datatype/Tracklets.hpp"
8+
#include "depthai_ros_msgs/TrackDetection2DArray.h"
9+
#include "ros/time.h"
10+
#include "vision_msgs/Detection2DArray.h"
11+
12+
namespace dai {
13+
14+
namespace ros {
15+
16+
class TrackSpatialDetectionConverter {
17+
public:
18+
TrackSpatialDetectionConverter(std::string frameName, int width, int height, bool normalized, bool getBaseDeviceTimestamp = false);
19+
~TrackSpatialDetectionConverter() = default;
20+
21+
/**
22+
* @brief Handles cases in which the ROS time shifts forward or backward
23+
* Should be called at regular intervals or on-change of ROS time, depending
24+
* on monitoring.
25+
*
26+
*/
27+
void updateRosBaseTime();
28+
29+
/**
30+
* @brief Commands the converter to automatically update the ROS base time on message conversion based on variable
31+
*
32+
* @param update: bool whether to automatically update the ROS base time on message conversion
33+
*/
34+
void setUpdateRosBaseTimeOnToRosMsg(bool update = true) {
35+
_updateRosBaseTimeOnToRosMsg = update;
36+
}
37+
38+
void toRosMsg(std::shared_ptr<dai::Tracklets> trackData, std::deque<depthai_ros_msgs::TrackDetection2DArray>& opDetectionMsgs);
39+
40+
depthai_ros_msgs::TrackDetection2DArray::Ptr toRosMsgPtr(std::shared_ptr<dai::Tracklets> trackData);
41+
42+
private:
43+
int _width, _height;
44+
const std::string _frameName;
45+
bool _normalized;
46+
float _thresh;
47+
std::chrono::time_point<std::chrono::steady_clock> _steadyBaseTime;
48+
::ros::Time _rosBaseTime;
49+
bool _getBaseDeviceTimestamp;
50+
// For handling ROS time shifts and debugging
51+
int64_t _totalNsChange{0};
52+
// Whether to update the ROS base time on each message conversion
53+
bool _updateRosBaseTimeOnToRosMsg{false};
54+
};
55+
56+
} // namespace ros
57+
58+
namespace rosBridge = ros;
59+
60+
} // namespace dai

depthai_bridge/package.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0"?>
22
<package format="3">
33
<name>depthai_bridge</name>
4-
<version>2.9.0</version>
4+
<version>2.10.1</version>
55
<description>The depthai_bridge package</description>
66

7-
<maintainer email="sachin@luxonis.com">Sachin Guruswamy</maintainer>
7+
<maintainer email="adam.serafin@luxonis.com">Adam Serafin</maintainer>
88
<author>Sachin Guruswamy</author>
99

1010
<license>MIT</license>

0 commit comments

Comments
 (0)