-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat!: split trajectory classes and implement Cartesian/JointState specializations #218
feat!: split trajectory classes and implement Cartesian/JointState specializations #218
Conversation
One side effect of the new structure is that since we are storing a flat queue but expose That is, we can no longer do: trajectory[n] = CartesianState(...) Instead, I replaced the functionality by adding |
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.
Review of the headers
source/state_representation/include/state_representation/StateType.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/CartesianTrajectory.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/CartesianTrajectory.hpp
Outdated
Show resolved
Hide resolved
@domire8 A few things I want to go over in case you review before that
Let's take the trajectory.set_reference_frame(some_pose)
// if new points different in size
trajectory.reset()
trajectory.add_points(points)
// if new points same in size
trajectory.set_points(points) // here we could set the points and then the reference frame For Joint trajectories, things are a bit more direct and the setters will directly change the joint names or robot name directly without checking something
|
Regarding the constructors, I'd also like to see for consistency
I see that adding new points with different reference frame requires multiple function calls, but in that case the user should just create a new object honestly. I feel that it's quite clear if the reference frame is set on construction, and if you want to change it you need to call Also, I'm not sure that the |
Noted, thanks for checking. Regarding the robot name, my understanding was this should be common for all |
Yes I think so, same as for the Cartesian |
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.
Still a few places where I see room for improvement and reduction of code duplication. Happy to talk about it if you disagree with my points
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/CartesianTrajectory.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/src/trajectory/CartesianTrajectory.cpp
Outdated
Show resolved
Hide resolved
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.
👍
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/TrajectoryBase.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/CartesianTrajectory.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/JointTrajectory.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/JointTrajectory.hpp
Show resolved
Hide resolved
source/state_representation/src/trajectory/CartesianTrajectory.cpp
Outdated
Show resolved
Hide resolved
source/state_representation/src/trajectory/CartesianTrajectory.cpp
Outdated
Show resolved
Hide resolved
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 think we are there now with the classes, they have become very compact with all the assertions and reused code. Nice work
source/state_representation/include/state_representation/trajectory/CartesianTrajectory.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/JointTrajectory.hpp
Outdated
Show resolved
Hide resolved
source/state_representation/include/state_representation/trajectory/JointTrajectory.hpp
Outdated
Show resolved
Hide resolved
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.
Very nice tests as well, elegant. Let's get it in and continue from there! 🔥
Description
Also resolves #217.
This PR solves the issue by splitting the existing Trajectory class to a base and 2 derived classes, namely, CartesianTrajectory and JointTrajectory.
A lot of the functionality of the base class is now marked protected and acts more as a utility for derived classes. The two new classes share similarities but require different handling when it comes to member variables and cleaning up.
This is missing python bindings for the new types. I believe it will be cleaner to add them separately.
Review guidelines
Estimated Time of Review: 20 minutes
Checklist before merging: