-
Notifications
You must be signed in to change notification settings - Fork 68
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
Refactor joint properties data structure (#110) #111
Refactor joint properties data structure (#110) #111
Conversation
c0267fa
to
2d121c0
Compare
- Addresses moveit#110 - Refactored joint_properties to use a map of maps for streamlined access to joint properties - Removed JointProperty struct as information contained is redundant. - Updated tests to account for new getJointProperties signature
2d121c0
to
06ccb85
Compare
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.
Approving with some small nitpicks, which I addressed in a subsequent commit.
include/srdfdom/model.h
Outdated
// Empty joint property vector | ||
static const std::vector<JointProperty> empty_vector_; | ||
// joint name -> (property name -> property value) | ||
std::map<std::string, std::map<std::string, std::string>> joint_properties_; |
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 prefer introducing descriptive alias names for such types.
include/srdfdom/model.h
Outdated
std::map<std::string, std::map<std::string, std::string>> joint_properties_; | ||
|
||
// Empty joint property map | ||
static const std::map<std::string, std::string> empty_map_; |
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 suggest to move this into the function requiring it.
- Use type aliases - Move static empty_map into the function it is used within
Please adapt your MoveIt PR accordingly. |
Thanks for cleaning this up! |
Thanks for the helpful comments! Good call on using the descriptive aliases. I'll put together a similar patch for the ROS2 branch if I can find some time this/next week. |
- Due to moveit/srdfdom#111, accessing Joint Properties has changed since properties now use a map instead of a vector. - Fixed tests/checking of joint properties to reflect this change
- Due to moveit/srdfdom#111, accessing Joint Properties has changed since properties now use a map instead of a vector. - Fixed tests/checking of joint properties to reflect this change
backport from moveit/moveit2#390 with several improvements: - accessing joint properties via map of maps (moveit/srdfdom#111) - fixing joint properties parsing, using `moveit::utils::toDouble` instead of `std::stod` - cleanup parsing of joint properties Co-authored-by: Robert Haschke <[email protected]>
This PR addresses #110 for Noetic:
getJointProperties()
.After doing incorporating these changes, I realized that this would significantly change functionality in the following ways:
getJointProperties()
JointProperty
structAs a result, if this PR gets merged, I will need to update my PR in MoveIt! (moveit/moveit#3359) to account for the modified data structures here.
Since the backport that I did for ROS1 is relatively new, merging this shouldn't cause many problems, as I doubt anyone else has started using the features I backported 2 weeks ago.
However, we should be careful about doing the same for ROS2, since it will likely break things in MoveIt2 (such as the same test in MoveIt2 here and as well as anyone else who were relying on the original joint properties data structure/function signatures).
I can definitely work on a similar PR for ROS2, but wanted to get your thoughts first.
Cheers!