Changes to build on ROS humble.

This commit is contained in:
James Goppert
2022-07-25 22:41:10 -04:00
parent b81009b9f6
commit 97b5bb1785
8 changed files with 32 additions and 33 deletions
+7 -8
View File
@@ -680,7 +680,7 @@ CoreWrapper::CoreWrapper(const rclcpp::NodeOptions & options) :
if(!odomFrameId_.empty())
{
mapToOdomMutex_.lock();
rclcpp::Time tfExpiration = now() + rclcpp::Duration(tfTolerance*10e9);
rclcpp::Time tfExpiration = now() + rclcpp::Duration::from_seconds(tfTolerance*10e9);
geometry_msgs::msg::TransformStamped msg;
msg.child_frame_id = odomFrameId_;
msg.header.frame_id = mapFrameId_;
@@ -906,7 +906,7 @@ void CoreWrapper::defaultCallback(const sensor_msgs::msg::Image::ConstSharedPtr
if(rate_>0.0f)
{
if(previousStamp_.seconds() > 0.0 && stamp.seconds() > previousStamp_.seconds() && stamp - previousStamp_ < rclcpp::Duration(1.0f/rate_))
if(previousStamp_.seconds() > 0.0 && stamp.seconds() > previousStamp_.seconds() && stamp - previousStamp_ < rclcpp::Duration::from_seconds(1.0f/rate_))
{
return;
}
@@ -3592,7 +3592,7 @@ void CoreWrapper::publishMapCallback(
marker.color.r = 1.0;
marker.color.g = 1.0;
marker.color.b = 0.0;
marker.lifetime = rclcpp::Duration(2.0f/rate_);
marker.lifetime = rclcpp::Duration::from_seconds(2.0f/rate_);
marker.type = visualization_msgs::msg::Marker::TEXT_VIEW_FACING;
marker.text = uNumber2Str(iter->first);
@@ -3705,7 +3705,7 @@ void CoreWrapper::publishMapCallback(
marker.color.r = 1.0;
marker.color.g = 1.0;
marker.color.b = 1.0;
marker.lifetime = rclcpp::Duration(2.0f/rate_);
marker.lifetime = rclcpp::Duration::from_seconds(2.0f/rate_);
marker.type = visualization_msgs::msg::Marker::TEXT_VIEW_FACING;
marker.text = uNumber2Str(iter->first);
@@ -4279,7 +4279,7 @@ void CoreWrapper::publishStats(const rclcpp::Time & stamp)
marker.color.r = 0.0;
marker.color.g = 1.0;
marker.color.b = 0.0;
marker.lifetime = rclcpp::Duration(2.0f/rate_);
marker.lifetime = rclcpp::Duration::from_seconds(2.0f/rate_);
marker.type = visualization_msgs::msg::Marker::TEXT_VIEW_FACING;
marker.text = uNumber2Str(iter->first);
@@ -4360,7 +4360,7 @@ void CoreWrapper::publishStats(const rclcpp::Time & stamp)
marker.color.r = 1.0;
marker.color.g = 1.0;
marker.color.b = 1.0;
marker.lifetime = rclcpp::Duration(2.0f/rate_);
marker.lifetime = rclcpp::Duration::from_seconds(2.0f/rate_);
marker.type = visualization_msgs::msg::Marker::TEXT_VIEW_FACING;
marker.text = uNumber2Str(poseIter->first);
@@ -4445,9 +4445,8 @@ void CoreWrapper::publishCurrentGoal(const rclcpp::Time & stamp)
}
void CoreWrapper::goalResponseCallback(
std::shared_future<GoalHandleNav2::SharedPtr> future)
const GoalHandleNav2::SharedPtr & goal_handle)
{
auto goal_handle = future.get();
if (!goal_handle) {
RCLCPP_ERROR(this->get_logger(), "Goal was rejected by server");
rtabmap_.clearPath(1);
+1 -1
View File
@@ -2134,7 +2134,7 @@ bool convertScanMsg(
rtabmap::Transform tmpT = getTransform(
odomFrameId.empty()?frameId:odomFrameId,
scan2dMsg.header.frame_id,
rclcpp::Time(scan2dMsg.header.stamp.sec, scan2dMsg.header.stamp.nanosec) + rclcpp::Duration(scan2dMsg.ranges.size()*scan2dMsg.time_increment*10e9),
rclcpp::Time(scan2dMsg.header.stamp.sec, scan2dMsg.header.stamp.nanosec) + rclcpp::Duration::from_seconds(scan2dMsg.ranges.size()*scan2dMsg.time_increment*10e9),
tfBuffer,
waitForTransform);
if(tmpT.isNull())
+1 -1
View File
@@ -306,7 +306,7 @@ void ICPOdometry::callbackScan(const sensor_msgs::msg::LaserScan::SharedPtr scan
// make sure the frame of the laser is updated too
Transform localScanTransform = getTransform(this->frameId(),
scanMsg->header.frame_id,
rclcpp::Time(scanMsg->header.stamp.sec, scanMsg->header.stamp.nanosec) + rclcpp::Duration(scanMsg->ranges.size()*scanMsg->time_increment*10e9),
rclcpp::Time(scanMsg->header.stamp.sec, scanMsg->header.stamp.nanosec) + rclcpp::Duration::from_seconds(scanMsg->ranges.size()*scanMsg->time_increment*10e9),
tfBuffer(), waitForTransform());
if(localScanTransform.isNull())
{
+1 -1
View File
@@ -145,7 +145,7 @@ void RGBSync::callback(
bool publishCompressed = true;
if (compressedRate_ > 0.0)
{
if ( lastCompressedPublished_ + rclcpp::Duration(1.0/compressedRate_) > now())
if ( lastCompressedPublished_ + rclcpp::Duration::from_seconds(1.0/compressedRate_) > now())
{
RCLCPP_DEBUG(this->get_logger(), "throttle last update at %f skipping", lastCompressedPublished_.seconds());
publishCompressed = false;
+1 -1
View File
@@ -190,7 +190,7 @@ void RGBDSync::callback(
bool publishCompressed = true;
if (compressedRate_ > 0.0)
{
if ( lastCompressedPublished_ + rclcpp::Duration(1.0/compressedRate_) > now())
if ( lastCompressedPublished_ + rclcpp::Duration::from_seconds(1.0/compressedRate_) > now())
{
RCLCPP_DEBUG(this->get_logger(), "throttle last update at %f skipping", lastCompressedPublished_.seconds());
publishCompressed = false;
+1 -1
View File
@@ -146,7 +146,7 @@ void StereoSync::callback(
bool publishCompressed = true;
if (compressedRate_ > 0.0)
{
if ( lastCompressedPublished_ + rclcpp::Duration(1.0/compressedRate_) > now())
if ( lastCompressedPublished_ + rclcpp::Duration::from_seconds(1.0/compressedRate_) > now())
{
RCLCPP_DEBUG(this->get_logger(), "throttle last update at %f skipping", lastCompressedPublished_.seconds());
publishCompressed = false;