Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1181b80
Reach study to rclcpp node and other changes.
livanov93 Dec 20, 2021
781229c
Add shared ptr instead xmlrpc. Add basic launch file.
livanov93 Dec 22, 2021
1888aca
Successfully build reach_core.
livanov93 Dec 23, 2021
72eeaa4
Adapt demo parameters.
livanov93 Dec 23, 2021
0569949
Install include directories correctly.
livanov93 Dec 23, 2021
ff6289a
Successfully build the whole ros2 reach package.
livanov93 Dec 23, 2021
be541e1
Address pluginlib issues.
livanov93 Dec 28, 2021
2730506
From static to dynamic libs.
livanov93 Dec 30, 2021
77898db
Add hardcoded paths for test.
livanov93 Dec 30, 2021
5e80577
Port up to publishing input cloud.
livanov93 Jan 8, 2022
98b9b61
Initial start of demo successfull.
livanov93 Jan 8, 2022
00cf151
Move rviz to start launch file.
livanov93 Jan 11, 2022
83aa8c8
Run move group with the reach analysis.
livanov93 Jan 11, 2022
be535d0
Update discretizied ik solver.
livanov93 Jan 12, 2022
f047513
Show robot state in initial reach study.
livanov93 Jan 13, 2022
39bc330
Make robot state publish in ik valid cb.
livanov93 Jan 25, 2022
77a0c88
Add flag for inner service callback.
livanov93 Jan 31, 2022
881a834
Update data loader node.
livanov93 Feb 2, 2022
bc3f898
Optional formatting.
livanov93 Feb 2, 2022
49e6056
Change constructing objects.
livanov93 Feb 2, 2022
c7457a6
Enable openmp.
livanov93 Feb 2, 2022
dc6d80b
Remove objects.
livanov93 Feb 2, 2022
f94ae77
Add robot model ptr to initialize method.
livanov93 Feb 14, 2022
d98c955
Remove sever warning caused by robot model loader.
livanov93 Feb 14, 2022
b57c963
Specific printing in data loader.
livanov93 Feb 15, 2022
0d717ec
Add special printing.
livanov93 Feb 15, 2022
a8626ec
Add param to run initial study only.
livanov93 Feb 15, 2022
a9c9a42
Extend printing format.
livanov93 Feb 15, 2022
47fc529
Fix deps.
livanov93 Feb 15, 2022
16e9896
Merge pull request #1 from livanov93/livanov/special-print
livanov93 Feb 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed COLCON_IGNORE
Empty file.
157 changes: 89 additions & 68 deletions moveit_reach_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,49 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(moveit_reach_plugins)

add_compile_options(-std=c++11)

find_package(catkin REQUIRED COMPONENTS
eigen_conversions
interactive_markers
moveit_core
moveit_msgs
moveit_ros_planning_interface
pluginlib
reach_core
reach_msgs
visualization_msgs
xmlrpcpp
)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_ros REQUIRED)
find_package(tf2_eigen REQUIRED)
find_package(interactive_markers REQUIRED)
find_package(moveit_core REQUIRED)
find_package(moveit_msgs REQUIRED)
find_package(moveit_ros_planning_interface REQUIRED)
find_package(pluginlib REQUIRED)
find_package(reach_core REQUIRED)
find_package(reach_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(geometric_shapes REQUIRED)
#find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)

catkin_package(
INCLUDE_DIRS
include
LIBRARIES
${PROJECT_NAME}_utils
evaluation_plugins
ik_solver_plugins
reach_display_plugins
CATKIN_DEPENDS
eigen_conversions
interactive_markers
moveit_core
moveit_msgs
moveit_ros_planning_interface
reach_core
reach_msgs
pluginlib
visualization_msgs
xmlrpcpp
)

###########
## BUILD ##
###########

include_directories(
include
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${reach_core_INCLUDE_DIRS}
)

# Utils Library
add_library(${PROJECT_NAME}_utils
src/utils.cpp
)
add_dependencies(${PROJECT_NAME}_utils
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
target_include_directories(${PROJECT_NAME}_utils
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(${PROJECT_NAME}_utils
${catkin_LIBRARIES}
ament_target_dependencies(${PROJECT_NAME}_utils
geometric_shapes
moveit_msgs
reach_msgs
tf2_eigen
)

# Evaluation Plugins
Expand All @@ -64,53 +52,77 @@ add_library(evaluation_plugins
src/evaluation/joint_penalty_moveit.cpp
src/evaluation/distance_penalty_moveit.cpp
)
add_dependencies(evaluation_plugins
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
target_include_directories(evaluation_plugins
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(evaluation_plugins
${catkin_LIBRARIES}
${PROJECT_NAME}_utils
${PCL_LIBRARIES}
)
ament_target_dependencies(evaluation_plugins
geometric_shapes
moveit_msgs
reach_msgs
tf2_eigen
moveit_ros_planning_interface
moveit_core
pluginlib
)
pluginlib_export_plugin_description_file(reach_core eval_plugin_description.xml)

# MoveIt IK Solver Plugin
add_library(ik_solver_plugins
src/ik/moveit_ik_solver.cpp
src/ik/discretized_moveit_ik_solver.cpp
)
add_dependencies(ik_solver_plugins
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
target_include_directories(ik_solver_plugins
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(ik_solver_plugins
${catkin_LIBRARIES}
${PROJECT_NAME}_utils
)
ament_target_dependencies(ik_solver_plugins
moveit_ros_planning_interface
geometric_shapes
reach_core
pluginlib
rclcpp
tf2_eigen
)
pluginlib_export_plugin_description_file(reach_core ik_plugin_description.xml)
target_compile_definitions(ik_solver_plugins PRIVATE "MOVEIT_REACH_PLUGINS_BUILDING_LIBRARY")

# MoveIt Reach Display Plugin
add_library(reach_display_plugins
src/display/moveit_reach_display.cpp
)
add_dependencies(reach_display_plugins
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
target_include_directories(reach_display_plugins
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(reach_display_plugins
${catkin_LIBRARIES}
${PROJECT_NAME}_utils
${PCL_LIBRARIES}
ik_solver_plugins
)
pluginlib_export_plugin_description_file(reach_core display_plugin_description.xml)

# IK Plugin Test
add_executable(ik_plugin_test
test/plugin_test_node.cpp
)
add_dependencies(ik_plugin_test
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(ik_plugin_test
${catkin_LIBRARIES}
)
#add_executable(ik_plugin_test
# test/plugin_test_node.cpp
#)
#add_dependencies(ik_plugin_test
# ${${PROJECT_NAME}_EXPORTED_TARGETS}
# ${catkin_EXPORTED_TARGETS}
#)
#target_link_libraries(ik_plugin_test
# ${catkin_LIBRARIES}
#)

#############
## INSTALL ##
Expand All @@ -122,15 +134,24 @@ install(
evaluation_plugins
ik_solver_plugins
reach_display_plugins
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
install(DIRECTORY include/
DESTINATION include/
)

install(FILES plugin_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
ament_export_libraries(
${PROJECT_NAME}_utils
evaluation_plugins
ik_solver_plugins
reach_display_plugins
)

ament_export_include_directories(
include
)
ament_package()
9 changes: 9 additions & 0 deletions moveit_reach_plugins/display_plugin_description.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Display Plugins -->
<library path="reach_display_plugins">
<!-- MoveIt Reach Display -->
<class name="moveit_reach_plugins/display/MoveItReachDisplay" type="moveit_reach_plugins::display::MoveItReachDisplay" base_class_type="reach::plugins::DisplayBase">
<description>
A reach study display plugin using the MoveIt framework
</description>
</class>
</library>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Evalution Plugins -->
<library path="lib/libevaluation_plugins">
<library path="evaluation_plugins">
<!-- Manipulability MoveIt -->
<class name="moveit_reach_plugins/evaluation/ManipulabilityMoveIt" type="moveit_reach_plugins::evaluation::ManipulabilityMoveIt" base_class_type="reach::plugins::EvaluationBase">
<description>
Expand Down Expand Up @@ -29,30 +29,3 @@
</description>
</class>
</library>

<!-- IK Plugins -->
<library path="lib/libik_solver_plugins">
<!-- MoveIt IK Solver -->
<class name="moveit_reach_plugins/ik/MoveItIKSolver" type="moveit_reach_plugins::ik::MoveItIKSolver" base_class_type="reach::plugins::IKSolverBase">
<description>
An inverse kinematics solver plugin which utilizes the MoveIt framework for solving robot inverse kinematics with respect to a given planning environment
</description>
</class>
<!-- Discretized MoveIt IK Solver -->
<class name="moveit_reach_plugins/ik/DiscretizedMoveItIKSolver" type="moveit_reach_plugins::ik::DiscretizedMoveItIKSolver" base_class_type="reach::plugins::IKSolverBase">
<description>
An inverse kinematics solver plugin which utilizes the MoveIt framework for solving robot inverse kinematics with respect to a given planning environment
This plugin discretizes the target pose around the Z-axis and outputs the solution with the highest score
</description>
</class>
</library>

<!-- Display Plugins -->
<library path="lib/libreach_display_plugins">
<!-- MoveIt Reach Display -->
<class name="moveit_reach_plugins/display/MoveItReachDisplay" type="moveit_reach_plugins::display::MoveItReachDisplay" base_class_type="reach::plugins::DisplayBase">
<description>
A reach study display plugin using the MoveIt framework
</description>
</class>
</library>
16 changes: 16 additions & 0 deletions moveit_reach_plugins/ik_plugin_description.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- IK Plugins -->
<library path="ik_solver_plugins">
<!-- MoveIt IK Solver -->
<class name="moveit_reach_plugins/ik/MoveItIKSolver" type="moveit_reach_plugins::ik::MoveItIKSolver" base_class_type="reach::plugins::IKSolverBase">
<description>
An inverse kinematics solver plugin which utilizes the MoveIt framework for solving robot inverse kinematics with respect to a given planning environment
</description>
</class>
<!-- Discretized MoveIt IK Solver -->
<class name="moveit_reach_plugins/ik/DiscretizedMoveItIKSolver" type="moveit_reach_plugins::ik::DiscretizedMoveItIKSolver" base_class_type="reach::plugins::IKSolverBase">
<description>
An inverse kinematics solver plugin which utilizes the MoveIt framework for solving robot inverse kinematics with respect to a given planning environment
This plugin discretizes the target pose around the Z-axis and outputs the solution with the highest score
</description>
</class>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@
#define MOVEIT_REACH_PLUGINS_MOVEIT_REACH_DISPLAY_H

#include <reach_core/plugins/reach_display_base.h>
#include <moveit_msgs/msg/planning_scene.hpp>

namespace moveit
{
namespace core
{
class RobotModel;
typedef std::shared_ptr<const RobotModel> RobotModelConstPtr;
class JointModelGroup;
}
}
#include <rclcpp/rclcpp.hpp>

namespace planning_scene
{
Expand All @@ -36,6 +29,10 @@ typedef std::shared_ptr<PlanningScene> PlanningScenePtr;

namespace moveit_reach_plugins
{
namespace
{
const rclcpp::Logger LOGGER = rclcpp::get_logger("moveit_reach_plugins.MoveItReachDisplay");
}
namespace display
{

Expand All @@ -45,10 +42,12 @@ class MoveItReachDisplay : public reach::plugins::DisplayBase

MoveItReachDisplay();

virtual bool initialize(XmlRpc::XmlRpcValue& config) override;
bool initialize(std::string& name, rclcpp::Node::SharedPtr node, const std::shared_ptr<const moveit::core::RobotModel> model) override;

virtual void showEnvironment() override;

virtual void showEnvironment(const std::vector<std::string> & names, const std::vector<double>& positions) override;

virtual void updateRobotPose(const std::map<std::string, double>& pose) override;

private:
Expand All @@ -59,13 +58,11 @@ class MoveItReachDisplay : public reach::plugins::DisplayBase

const moveit::core::JointModelGroup* jmg_;

std::string collision_mesh_filename_;

std::string collision_mesh_package_;
std::string collision_mesh_filename_path_;
std::string collision_mesh_frame_;

ros::NodeHandle nh_;

ros::Publisher scene_pub_;
rclcpp::Publisher<moveit_msgs::msg::PlanningScene>::SharedPtr scene_pub_;
};

} // namespace display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@
#define MOVEIT_REACH_PLUGINS_EVALUATION_DISTANCE_PENALTY_MOVEIT_H

#include <reach_core/plugins/evaluation_base.h>
#include <moveit_msgs/PlanningScene.h>

namespace moveit
{
namespace core
{
class RobotModel;
typedef std::shared_ptr<const RobotModel> RobotModelConstPtr;
class JointModelGroup;
}
}
#include <moveit_msgs/msg/planning_scene.hpp>

namespace planning_scene
{
Expand All @@ -37,6 +27,10 @@ typedef std::shared_ptr<PlanningScene> PlanningScenePtr;

namespace moveit_reach_plugins
{
namespace
{
const rclcpp::Logger LOGGER = rclcpp::get_logger("moveit_reach_plugins.DistancePenaltyMoveIt");
}
namespace evaluation
{

Expand All @@ -46,7 +40,7 @@ class DistancePenaltyMoveIt : public reach::plugins::EvaluationBase

DistancePenaltyMoveIt();

virtual bool initialize(XmlRpc::XmlRpcValue& config) override;
virtual bool initialize(std::string& name, rclcpp::Node::SharedPtr node,const std::shared_ptr<const moveit::core::RobotModel> model) override;

virtual double calculateScore(const std::map<std::string, double>& pose) override;

Expand All @@ -62,7 +56,8 @@ class DistancePenaltyMoveIt : public reach::plugins::EvaluationBase

int exponent_;

std::string collision_mesh_filename_;
std::string collision_mesh_package_;
std::string collision_mesh_filename_path_;

std::string collision_mesh_frame_;

Expand Down
Loading