Skip to content
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

Port kinematic_constraints to ROS2 #42

Merged
merged 15 commits into from
Jun 25, 2019

Conversation

vmayoral
Copy link
Contributor

Authored by @anasarrak

@@ -200,7 +200,7 @@ moveit_msgs::msg::Constraints constructGoalConstraints(const std::string& link_n
*
* @return was the construction successful?
*/
bool constructConstraints(XmlRpc::XmlRpcValue& params, moveit_msgs::msg::Constraints& constraints);
// bool constructConstraints(XmlRpc::XmlRpcValue& params, moveit_msgs::msg::Constraints& constraints);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add TODO with missing dependency. Was this removed because xmlrpc is not available? If so, it looks like it is used in the ros1_bridge

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can actually use the rclcpp parameters to fix these kind of things, or at least, the way that I'm following.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@v4hn spent a lot of time on this feature. Perhaps you and he can collaborate on the best path for porting this. In the mean time, any time you comment out a feature, please add comments explaining why the feature is being removed and what steps would be necessary before re-enabling the feature

moveit_core/kinematic_constraints/src/utils.cpp Outdated Show resolved Hide resolved
constraints.name = static_cast<std::string>(params["name"]);
return collectConstraints(params["constraints"], constraints);
}
// TODO: Is not getting called from anywhere, check if is necessary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intended to be used by application code. It enables the user to define a set of constraints in a config file and use it for both the generation of an approximated constraint manifold and the sampling of that manifold. Without this code those parameters have to be defined multiple times and may get out of sync. The tutorial on approximated constraint manifolds has some more information: https://ros-planning.github.io/moveit_tutorials/doc/planning_with_approximated_constraint_manifolds/planning_with_approximated_constraint_manifolds_tutorial.html

I believe @v4hn is working on documenting this feature better

delete m;
mk.header.frame_id = robot_model_->getModelFrame();
mk.header.stamp = ros::Time::now();
mk.header.stamp = stamp;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use clock_ros_.now() directly? I don't see stamp being used anywhere else.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes were made on the following commit b3855c3

@@ -848,25 +851,26 @@ shapes::Mesh* VisibilityConstraint::getVisibilityCone(const robot_state::RobotSt
}

void VisibilityConstraint::getMarkers(const robot_state::RobotState& state,
visualization_msgs::MarkerArray& markers) const
visualization_msgs::msg::MarkerArray& markers)
Copy link
Member

@henningkayser henningkayser Mar 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMarkers() should be const. Did you change it because of clock_ros_? In this case I would suggest creating a local instance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better, just use rclcpp::Time::now(RCL_ROS_TIME);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted back here AcutronicRobotics@beb3bca

@@ -991,7 +995,8 @@ ConstraintEvaluationResult VisibilityConstraint::decide(const robot_state::Robot
collision_detection::CollisionRequest req;
collision_detection::CollisionResult res;
collision_detection::AllowedCollisionMatrix acm;
acm.setDefaultEntry("cone", boost::bind(&VisibilityConstraint::decideContact, this, _1));
acm.setDefaultEntry("cone", (boost::function<bool(collision_detection::Contact&)>)
Copy link
Member

@henningkayser henningkayser Mar 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this function cast necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahcorde ping

Copy link
Contributor

@ahcorde ahcorde Jun 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't explain you exactly why we have this cast. Maybe @anasarrak can jump here and add some light. But I was trying today to change this to the current version but it was not working. My guess is because we are using C++14. I have tried to change this to std using std::function and std::bind because most of the packages are moving from boost to std but again I was not able to do it.

Anyhow help is wellcome.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this with this commit b3855c3

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was causing some compilation problems, the cast prevented the problem.

@ahcorde ahcorde mentioned this pull request May 24, 2019
14 tasks
if(WIN32)
# set(append_library_dirs "$<TARGET_FILE_DIR:${PROJECT_NAME}>;$<TARGET_FILE_DIR:${PROJECT_NAME}_TestPlugins1>")
else()
set(append_library_dirs "${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_BINARY_DIR}/../utils;${CMAKE_CURRENT_BINARY_DIR}/../robot_model;${CMAKE_CURRENT_BINARY_DIR}/../robot_state;${CMAKE_CURRENT_BINARY_DIR}/../collision_detection_fcl")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding relative paths is a bad idea.

I would recommend that for every library in this package that is used else ware you set a <lib_name>_lib_dir environment variable that can then be used by the tests

A good example is the rcl_lib_dir I have taken the time to show how it is used below:

/home/mike/ws_ros2/src/ros2/rcl/rcl/CMakeLists.txt:
   78  
   79: # rcl_lib_dir is passed as APPEND_LIBRARY_DIRS for each ament_add_gtest call so
   80  # the librcl that they link against is on the library path.
   81  # This is especially important on Windows.
   82  # This is overwritten each loop, but which one it points to doesn't really matter.
   83: set(rcl_lib_dir "$<TARGET_FILE_DIR:${PROJECT_NAME}>")
   84  

/home/mike/ws_ros2/src/ros2/rcl/rcl/test/CMakeLists.txt:
   16  
   17: set(extra_lib_dirs "${rcl_lib_dir}")
   18  
   
/home/mike/ws_ros2/src/ros2/rcl/rcl/test/CMakeLists.txt:
   34    rcl_add_custom_gtest(test_client${target_suffix}
   35      SRCS rcl/test_client.cpp
   36:     INCLUDE_DIRS ${osrf_testing_tools_cpp_INCLUDE_DIRS}
   37      ENV ${rmw_implementation_env_var}
   38      APPEND_LIBRARY_DIRS ${extra_lib_dirs}

The example uses rcl_add_custom_gtest but it works just as well with ament_add_gtest

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't mind I prefer to merge this. And then I will fix them all together. Because we have other merged that use this style. I can open an issue to avoid forgetting it.

@ahcorde
Copy link
Contributor

ahcorde commented Jun 3, 2019

friendly ping @mlautman @henningkayser @davetcoleman

@mlautman
Copy link
Contributor

mlautman commented Jun 3, 2019

@ahcorde Please address all feedback. I see some open questions from @henningkayser

@anasarrak
Copy link
Contributor

@mlautman
Copy link
Contributor

@henningkayser can you re-review this

@ahcorde
Copy link
Contributor

ahcorde commented Jun 24, 2019

friendly ping @mlautman @henningkayser @davetcoleman

Can we merge this?

@mlautman mlautman merged commit 3405196 into moveit:master Jun 25, 2019
MikeWrock pushed a commit to MikeWrock/moveit2 that referenced this pull request Aug 15, 2022
* visualization

* adding moveit_visual_tools depend

* install panda from src instead of deb

* minor grammar fix

* fixing maintainer list

* minor typeo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants