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

[JTC] Renaming variables, reordering trajectory checks and fixing open-loop mode by adding last commanded time. #1032

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

destogl
Copy link
Member

@destogl destogl commented Feb 9, 2024

This PR increseas readability of the JTC by renaming trajectory varialbes to be semantically correct and self explainable.

Also it reoders checks of the trajectories done in the callback. They are grouped based on the things they are checking, i.e., 1. data available, 2. time checks; 3. trajectory point checks.

Additionally, it adds "last_commanded_time_" for the open loop mode to be more correct when setting point before trajectory.

Copy link
Contributor

mergify bot commented Feb 10, 2024

This pull request is in conflict. Could you fix it @destogl?

@bmagyar
Copy link
Member

bmagyar commented Feb 11, 2024

Recently merged the wraparound feature which caused some conflicts.

Also, this may be interesting for @fmauch

@bmagyar bmagyar changed the title [JTC] Renaming varialbes, reodering trajectory checks and fixing open-loop mode by adding last commanded time. [JTC] Renaming variables, reordering trajectory checks and fixing open-loop mode by adding last commanded time. Feb 11, 2024
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

LGTM and improves readability!

@christophfroehlich
Copy link
Contributor

👀 @destogl test_no_jump_when_state_tracking_error_not_updated fails now, I guess due to the last_commanded_time_ change.

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

LGTM, apart from the following minor comment.

Now with the changes, it looks clear and good

Comment on lines +156 to +161
if (fabs(last_commanded_time_.seconds()) < std::numeric_limits<float>::epsilon())
{
last_commanded_time_ = time;
}
current_trajectory_->set_point_before_trajectory_msg(
last_commanded_time_, last_commanded_state_, joints_angle_wraparound_);
Copy link
Member

Choose a reason for hiding this comment

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

In this case, the last_command_time_ would be same for the first 2 iterations. Is that okay?. If its fine, then all good.

@bmagyar
Copy link
Member

bmagyar commented Feb 19, 2024

Please adjust / extend the tests

henrygerardmoore pushed a commit to henrygerardmoore/ros2_controllers that referenced this pull request Jul 19, 2024
@christophfroehlich christophfroehlich added backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. backport-iron labels Nov 2, 2024
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

This includes #780, which has the same failing test: test_no_jump_when_state_tracking_error_not_updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants