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

[Sprint 22 / PD-121] - [WIP] Implement Spline Interpolation on Akushon #39

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

Conversation

hiikariri
Copy link
Contributor

Jira Link: https://ichiro-its.atlassian.net/browse/PD-121

Description

Implement spline interpolation in akushon for smoother motions.
spline interpolation can be enabled/disabled through actions json.

Type of Change

  • Bugfix
  • Enhancement
  • New feature
  • Breaking change (fix or feature that would cause the existing functionality to not work as expected)

How Has This Been Tested?

  • New unit tests added.
  • Manual tested.

Checklist:

  • Using Branch Name Convention
    • feature/JIRA-ID-SHORT-DESCRIPTION if has a JIRA ticket
    • enhancement/SHORT-DESCRIPTION if has/has no JIRA ticket and contain enhancement
    • hotfix/SHORT-DESCRIPTION if the change doesn't need to be tested (urgent)
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have made the documentation for the corresponding changes.

include/akushon/action/model/action.hpp Outdated Show resolved Hide resolved
src/akushon/action/model/action.cpp Outdated Show resolved Hide resolved
src/akushon/action/model/action.cpp Outdated Show resolved Hide resolved
@segara2410 segara2410 marked this pull request as draft December 28, 2023 12:27
Comment on lines 128 to 132
const auto it = joint_splines.find(joint.get_id());
if (it == joint_splines.end()) {
joint_splines.emplace(joint.get_id(), std::make_shared<keisan::SmoothSpline>());
}
it->second->add_point(joint.get_position(), pose.get_time());
Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry, there's a bug in here. Please don't follow my suggestion blindly.

in case it is not found, after emplacing it, we should update the it:

Suggested change
const auto it = joint_splines.find(joint.get_id());
if (it == joint_splines.end()) {
joint_splines.emplace(joint.get_id(), std::make_shared<keisan::SmoothSpline>());
}
it->second->add_point(joint.get_position(), pose.get_time());
auto it = joint_splines.find(joint.get_id());
if (it == joint_splines.end()) {
it = joint_splines.emplace(joint.get_id(), std::make_shared<keisan::SmoothSpline>()).first;
}
it->second->add_point(joint.get_position(), pose.get_time());

@hiikariri hiikariri force-pushed the feature/implement-spline-interpolation-on-akushon branch from 5b5cb81 to f4993eb Compare March 16, 2024 05:53
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.

2 participants