-
Notifications
You must be signed in to change notification settings - Fork 10
Adjust output time in costamp stack #44
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 all commits
21bf424
b8b8654
a6736cb
0ab0ed4
39b2936
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,7 +177,8 @@ AMCLLocalizer::AMCLLocalizer() | |
| double roll, pitch, yaw; | ||
| tf2::Matrix3x3(q).getRPY(roll, pitch, yaw); | ||
|
|
||
| ret << "Odometry with pose: (x: " << x << ", y: " << y << ", yaw: " << yaw << ")"; | ||
| ret << "{" << rclcpp::Time(odom.header.stamp).seconds() << " } Odometry with pose: (x: " << | ||
| x << ", y: " << y << ", yaw: " << yaw << ")"; | ||
| return ret.str(); | ||
| }); | ||
| } | ||
|
|
@@ -269,6 +270,7 @@ AMCLLocalizer::on_initialize() | |
| "initialpose", 10, std::bind(&AMCLLocalizer::init_pose_callback, this, std::placeholders::_1)); | ||
|
|
||
| last_reseed_ = get_node()->now(); | ||
| last_input_time_ = get_node()->now(); | ||
|
|
||
| get_node()->get_logger().set_level(rclcpp::Logger::Level::Debug); | ||
| } | ||
|
|
@@ -583,19 +585,22 @@ AMCLLocalizer::correct(NavState & nav_state) | |
| const auto & map_static = nav_state.get<Costmap2D>("map.static"); | ||
|
|
||
| const auto & tf_info = RTTFBuffer::getInstance()->get_tf_info(); | ||
| const auto & filtered = PointPerceptionsOpsView(perceptions) | ||
| .downsample(map_static.getResolution()) | ||
| .fuse(tf_info.robot_footprint_frame) | ||
| .filter({NAN, NAN, 0.1}, {NAN, NAN, NAN}) | ||
| .collapse({NAN, NAN, 0.1}) | ||
| .downsample(map_static.getResolution()) | ||
| .as_points(); | ||
|
|
||
| auto view = PointPerceptionsOpsView(perceptions); | ||
| view.downsample(map_static.getResolution()) | ||
| .fuse(tf_info.robot_footprint_frame) | ||
| .filter({NAN, NAN, 0.1}, {NAN, NAN, NAN}) | ||
| .collapse({NAN, NAN, 0.1}) | ||
| .downsample(map_static.getResolution()); | ||
| const auto & filtered = view.as_points(); | ||
|
|
||
| if (filtered.empty()) { | ||
| RCLCPP_WARN(get_node()->get_logger(), "No points to correct"); | ||
| return; | ||
| } | ||
|
|
||
| last_input_time_ = view.get_latest_stamp(); | ||
|
||
|
|
||
| for (auto & particle : particles_) { | ||
| int hits = 0; | ||
| int possible_hits = 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The member variable
last_input_ts_is declared but never initialized. This will lead to undefined behavior when it's first accessed infetch_required_inputs()at line 384 of the cpp file where it's used in a comparison operation. Initialize this variable in the constructor or inon_initialize()(similar to howlast_update_ts_is initialized at line 150 of the cpp file).