-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: main
Are you sure you want to change the base?
Conversation
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.
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> |
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.
That argument is not actually a pointer. Should it be?
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.
It probably should be. I'll change that.
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.
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.
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.
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.
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.