mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-08 05:47:45 +08:00
fix: update device changed callback unregistration to use INVALID_CALLBACK_ID constant
This commit is contained in:
@@ -167,10 +167,10 @@ OBCameraNodeDriver::~OBCameraNodeDriver() {
|
||||
}
|
||||
|
||||
// Unregister device changed callback before destroying context
|
||||
if (ctx_ && device_changed_callback_id_ != 0) {
|
||||
if (ctx_ && device_changed_callback_id_ != INVALID_CALLBACK_ID) {
|
||||
try {
|
||||
ctx_->unregisterDeviceChangedCallback(device_changed_callback_id_);
|
||||
device_changed_callback_id_ = 0;
|
||||
device_changed_callback_id_ = INVALID_CALLBACK_ID;
|
||||
} catch (...) {
|
||||
RCLCPP_WARN_STREAM(logger_,
|
||||
"Exception during device changed callback unregister in destructor");
|
||||
|
||||
@@ -199,8 +199,6 @@ void savePointsToPly(const std::shared_ptr<ob::Frame> &frame, const std::string
|
||||
|
||||
tf2::Quaternion rotationMatrixToQuaternion(const float rotation[9]) {
|
||||
Eigen::Matrix3f m;
|
||||
// We need to be careful about the order, as RS2 rotation matrix is
|
||||
// column-major, while Eigen::Matrix3f expects row-major.
|
||||
m << rotation[0], rotation[1], rotation[2], rotation[3], rotation[4], rotation[5], rotation[6],
|
||||
rotation[7], rotation[8];
|
||||
Eigen::Quaternionf q(m);
|
||||
|
||||
Reference in New Issue
Block a user