ros-controls / ros-controls/ros2_controllers
Dynamic memory allocation in the joint trajectory controller
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 834
- Forks
- 530
- Avg merge
- 18h 3m
- Merged PRs (30d)
- 19
Description
Here are some spots of dynamic memory allocation in the realtime update method of the JTC we should try to get rid of:
In fill_partial_goal():
https://github.com/ros-controls/ros2_controllers/blob/d8d661607f770e704b774249a31534fa0eb0d46b/joint_trajectory_controller/src/joint_trajectory_controller.cpp#L1084
And several other places.
In sort_to_local_joint_order():
output.resize(mapping.size(), 0.0);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in joint_trajectory_controller/src/joint_trajectory_controller.cpp at fill_partial_goal() and sort_to_local_joint_order(), then inspect the other allocation sites in the realtime update method. The work is complete when dynamic allocations in that path, including output.resize(mapping.size(), 0.0), are removed without changing controller behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance, robotics
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100