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

Simplify motion control #358

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Simplify motion control #358

wants to merge 5 commits into from

Conversation

jimmy-mcelwain
Copy link
Collaborator

MotionControl.c had several instances of unused code, code that could have been replaced with a function call, and code that was otherwise duplicated.

The only real functional change of this PR is that duplicate joint names are checked for all points in queue_traj_point mode now, not just for the first point. Everything else is a readability/code duplication removal change.

Copy link
Collaborator

@ted-miller ted-miller left a comment

Choose a reason for hiding this comment

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

Just one pedantic issue

/// Given a joint name, search through each control group and axis to find
/// the control group + axis number of the corresponding joint
/// </summary>
/// <param name="jointName">Pointer to the head of the incoming trajectory</param>
Copy link
Collaborator

Choose a reason for hiding this comment

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

That argument is not actually a pointer. Should it be?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It probably should be. I'll change that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We could change it, but rosidl_runtime_c__String is essentially a wrapper around a pointer, grouped with its size and capacity fields.

That's probably 4 + 8 bytes on a YRC1. You'd save copying 8 bytes, which I would not expect to have a measurable performance impact.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I chose to change it to a pointer anyways. I know that it likely won't have a real performance, but it's more consistent. Everywhere else, I am passing a pointer rather than the full struct.

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