Port kinematics_base submodule moveit_core#8
Conversation
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
Addressed in the top level CMakeLists.txt
Following guidelines provided at moveit#8 (comment)
Following guidelines provided at moveit#8 (comment)
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
Follows from moveit#21
|
@mlautman and @davetcoleman please have a look again at this PR. I've opted for not using |
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
Follows from moveit#8 (comment) taking into account that recommendations do currently fail to compile given the structure of RCLCPP macros
Follows from moveit#8 (comment) taking into account that recommendations do currently fail to compile given the structure of RCLCPP macros
|
@davetcoleman and @mlautman, consider again this PR |
| if (pnh.hasParam(param)) | ||
| auto parameters_lookup = std::make_shared<rclcpp::SyncParametersClient>(node); | ||
|
|
||
| auto groupname_param = parameters_lookup->get_parameters({ group_name_ + "/" + param }); |
There was a problem hiding this comment.
auto is nice where the type is obvious but in cases like this it's more confusing then helpful.
Especially since the following for loops are using auto as well this type should be made explicit.
There was a problem hiding this comment.
Also, the SyncParametersClient class contains the functions has_param() and get_parameter() which can be used to replace hasParam() and param() directly. This way we don't have to loop and compare the results as well.
There was a problem hiding this comment.
Partially complied with your request @henningkayser at b2d436f.
Please make a suggestion if you require further changes.
There was a problem hiding this comment.
get_parameters() is meant to be used for multiple parameters but here it's always called with only a single entry. In this case it's much more straightforward to query every parameter like in the sample code below:
bool param_success = node.get_parameter<T>(group_name + "/" + param, val);No need to create a parameter vector or loop over the results and also we can use the node directly and don't need to cast it to rclcpp::SyncParametersClient.
Since lookupParam() does in fact query multiple parameters in different locations we can absolutely use Node::get_parameters() but in that case including all parameter names:
val = default_val;
std::vector<std::string> param_names = {
group_name_ + "/" + param, param,
"robot_description_kinematics/" + group_name_ + "/" + param,
robot_description_kinematics/" + param
};
std::vector<rclcpp::parameter::ParameterVariant> param_results =
node.getParameters(param_names);
bool param_success = !param_results.empty();
if (param_success)
val = param_results[0].get_value<T>();
return param_success;I actually prefer the second implementation.
Please also note that your current implementation calls value_to_string() on all parameters but lookupParam() is a template function that supports all parameter types. The get_value() function takes care of using the correct type.
There was a problem hiding this comment.
I've already made some changes (on planning_scene_monitor) related to this:
There was a problem hiding this comment.
@anasarrak this looks much better. However, each if/else block can be implemented in a single line using node->get_parameter_or(param, val, default_val).
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h
Outdated
Show resolved
Hide resolved
|
@henningkayser lgtm |
* Register ruckig smoothing as a plugin via xml. Fix bad constructor in AddRuckigTrajectorySmoothing * Add add_ruckig_traj_smoothing.cpp to CMakeLists.txt
* Register ruckig smoothing as a plugin via xml. Fix bad constructor in AddRuckigTrajectorySmoothing * Add add_ruckig_traj_smoothing.cpp to CMakeLists.txt
* Register ruckig smoothing as a plugin via xml. Fix bad constructor in AddRuckigTrajectorySmoothing * Add add_ruckig_traj_smoothing.cpp to CMakeLists.txt
No description provided.