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

Read predict_to_current_time from ROS parameters #737

Conversation

zygfrydw
Copy link
Contributor

@zygfrydw zygfrydw commented Mar 8, 2022

I have added a parameter predict_to_current_time to read the value from ROS parameters, otherwise the member predict_to_current_time_ was not initialized.

Copy link
Collaborator

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this used? It doesn’t seem to be used anywhere in the codebase.

@zygfrydw
Copy link
Contributor Author

zygfrydw commented Mar 8, 2022

In the file ros_filter.cpp line 584 and 697 (function RosFilter<T>::integrateMeasurements) on branch galactic

bool predict_to_current_time = predict_to_current_time_;
[...]
if (filter_.getInitializedStatus() && predict_to_current_time) {
rclcpp::Duration last_update_delta =
    current_time - filter_.getLastMeasurementTime();

filter_.validateDelta(last_update_delta);
filter_.predict(current_time, last_update_delta);

// Update the last measurement time and last update time
filter_.setLastMeasurementTime(
    filter_.getLastMeasurementTime() +
    last_update_delta);
}

On noetic branch this variable is called predictToCurrentTime_

@ayrton04
Copy link
Collaborator

Yeah, looks like we just failed to load it. It gets loaded in noetic here:

nhLocal_.param("predict_to_current_time", predictToCurrentTime_, false);

@ayrton04 ayrton04 self-requested a review April 25, 2022 16:37
@ayrton04 ayrton04 merged commit a737b27 into cra-ros-pkg:galactic Apr 25, 2022
tonynajjar added a commit to logivations/robot_localization that referenced this pull request Apr 26, 2022
* SHARED linking for Geographiclib (cra-ros-pkg#624) (cra-ros-pkg#713)

* remove GeographicLib specific linking option

Co-authored-by: Achmad Fathoni <fathoni.id@gmail.com>

* Fixing code style divergence for ament_uncrustify (cra-ros-pkg#742)

* Fixed state history reversion (cra-ros-pkg#736)

Co-authored-by: Zygfryd Wieszok <zwieszok@autonomous-systems.pl>

* Read predict_to_current_time from ROS parameters (cra-ros-pkg#737)

Co-authored-by: Zygfryd Wieszok <zwieszok@autonomous-systems.pl>

* Using angles library to normalize angles (cra-ros-pkg#739)

* Using angles library for innovation angle normalization

Co-authored-by: Stephan Sundermann <stephansundermann@gmail.com>
Co-authored-by: Achmad Fathoni <fathoni.id@gmail.com>
Co-authored-by: Anish <anishgdev@gmail.com>
Co-authored-by: Zygfryd Wieszok <zygfryd.wieszok@gmail.com>
Co-authored-by: Zygfryd Wieszok <zwieszok@autonomous-systems.pl>
Co-authored-by: Marek Piechula <marpiechula@gmail.com>
tonynajjar added a commit to logivations/robot_localization that referenced this pull request Apr 26, 2022
* SHARED linking for Geographiclib (cra-ros-pkg#624) (cra-ros-pkg#713)

* remove GeographicLib specific linking option

Co-authored-by: Achmad Fathoni <fathoni.id@gmail.com>

* Fixing code style divergence for ament_uncrustify (cra-ros-pkg#742)

* Fixed state history reversion (cra-ros-pkg#736)

Co-authored-by: Zygfryd Wieszok <zwieszok@autonomous-systems.pl>

* Read predict_to_current_time from ROS parameters (cra-ros-pkg#737)

Co-authored-by: Zygfryd Wieszok <zwieszok@autonomous-systems.pl>

* Using angles library to normalize angles (cra-ros-pkg#739)

* Using angles library for innovation angle normalization

Co-authored-by: Stephan Sundermann <stephansundermann@gmail.com>
Co-authored-by: Achmad Fathoni <fathoni.id@gmail.com>
Co-authored-by: Anish <anishgdev@gmail.com>
Co-authored-by: Zygfryd Wieszok <zygfryd.wieszok@gmail.com>
Co-authored-by: Zygfryd Wieszok <zwieszok@autonomous-systems.pl>
Co-authored-by: Marek Piechula <marpiechula@gmail.com>
ayrton04 pushed a commit that referenced this pull request May 5, 2022
Co-authored-by: Zygfryd Wieszok <zwieszok@autonomous-systems.pl>
@zygfrydw zygfrydw deleted the read-predict-to-current-time-from-parameters branch June 22, 2022 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants