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

Remove rviz2 dependency from rviz_marker_tools #537

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f4cd7d5
Enable parallel planning with PipelinePlanner (#450)
sjahr Oct 4, 2023
39eeae4
set a non-infinite default timeout in CurrentState stage (#491)
sjahr Oct 6, 2023
5c4ef60
Add planner name to trajectory info (#490)
sjahr Oct 9, 2023
b25d2ba
Remove display_motion_plans and publish_planning_requests properties …
sjahr Oct 10, 2023
fb02c7f
Reset joint values in scene diff for execution (#498)
sjahr Oct 24, 2023
8375e6e
Add random pose generator stage (ros2) (#497)
sjahr Oct 24, 2023
e121b49
Run goalcallback asynchronously (#496)
sjahr Oct 27, 2023
94d6514
[ros2] Add Stage property to assign a list of controllers to use when…
schornakj Nov 2, 2023
81a5a6b
Revert implicit property inheritance (#502)
sjahr Nov 3, 2023
06b7b77
JointInterpolationPlanner: Check joint bounds (#505)
mechwiz Nov 8, 2023
2f06438
fixup! Reset joint values in scene diff for execution (#504)
rhaschke Nov 9, 2023
5319a65
Update to the more recent JumpThreshold API (#506)
marioprats Nov 10, 2023
8fc2016
Fix MTC unittests for new pipeline refactoring (#515)
sjahr Dec 8, 2023
d6af5d2
Print warning if no controllers are configured for trajectory executi…
sjahr Dec 8, 2023
db08669
Fix test_pipeline_planner parameter (#516)
henningkayser Dec 17, 2023
32604ad
Fix missing configs in demo launch files (#509)
TipluJacob Dec 18, 2023
57e8490
Add planner info to comments (#523)
Abishalini Jan 16, 2024
2ffacf8
Use tl expected
Abishalini Jan 16, 2024
823899f
Propagate errors from planners
Abishalini Jan 18, 2024
c5bf96f
Fix bug in move relative
Abishalini Jan 18, 2024
c8a75cb
tl::expected -> MoveItErrorCode
Abishalini Jan 23, 2024
32cd2b8
Remove tl::expected
Abishalini Jan 24, 2024
0d7b86e
Modify return type in comments
Abishalini Jan 24, 2024
5a2607e
Remove TODO
Abishalini Jan 24, 2024
8a89a97
Merge pull request #525 from Abishalini/pr-get-error-msg-from-planners
Abishalini Jan 25, 2024
4de8d23
Make error code more informative (#529)
sjahr Feb 7, 2024
faae908
Remove rviz2 dependency
bmagyar Feb 27, 2024
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
fail-fast: false
matrix:
env:
- IMAGE: humble-source
- IMAGE: rolling-source
NAME: ccov
TARGET_CMAKE_ARGS: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage"
Expand Down
53 changes: 35 additions & 18 deletions capabilities/src/execute_task_solution_capability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,22 @@ void ExecuteTaskSolutionCapability::initialize() {
// configure the action server
as_ = rclcpp_action::create_server<moveit_task_constructor_msgs::action::ExecuteTaskSolution>(
context_->moveit_cpp_->getNode(), "execute_task_solution",
ActionServerType::GoalCallback(std::bind(&ExecuteTaskSolutionCapability::handleNewGoal, this,
std::placeholders::_1, std::placeholders::_2)),
ActionServerType::CancelCallback(
std::bind(&ExecuteTaskSolutionCapability::preemptCallback, this, std::placeholders::_1)),
ActionServerType::AcceptedCallback(
std::bind(&ExecuteTaskSolutionCapability::goalCallback, this, std::placeholders::_1)));
[this](const rclcpp_action::GoalUUID& /*uuid*/,
const ExecuteTaskSolutionAction::Goal::ConstSharedPtr& /*goal*/) {
// Reject new goal if another goal is currently processed
if (last_goal_future_.valid() &&
last_goal_future_.wait_for(std::chrono::seconds::zero()) != std::future_status::ready) {
return rclcpp_action::GoalResponse::REJECT;
}
return rclcpp_action::GoalResponse::ACCEPT_AND_EXECUTE;
},
[this](const std::shared_ptr<rclcpp_action::ServerGoalHandle<ExecuteTaskSolutionAction>>& goal_handle) {
return preemptCallback(goal_handle);
},
[this](const std::shared_ptr<rclcpp_action::ServerGoalHandle<ExecuteTaskSolutionAction>>& goal_handle) {
last_goal_future_ =
std::async(std::launch::async, &ExecuteTaskSolutionCapability::goalCallback, this, goal_handle);
});
}

void ExecuteTaskSolutionCapability::goalCallback(
Expand Down Expand Up @@ -145,13 +155,11 @@ bool ExecuteTaskSolutionCapability::constructMotionPlan(const moveit_task_constr
plan.plan_components.reserve(solution.sub_trajectory.size());
for (size_t i = 0; i < solution.sub_trajectory.size(); ++i) {
const moveit_task_constructor_msgs::msg::SubTrajectory& sub_traj = solution.sub_trajectory[i];

plan.plan_components.emplace_back();
plan_execution::ExecutableTrajectory& exec_traj = plan.plan_components.back();

// define individual variable for use in closure below
const std::string description = std::to_string(i + 1) + "/" + std::to_string(solution.sub_trajectory.size());
exec_traj.description = description;
exec_traj.description = std::to_string(i + 1) + "/" + std::to_string(solution.sub_trajectory.size());

const moveit::core::JointModelGroup* group = nullptr;
{
Expand All @@ -170,20 +178,29 @@ bool ExecuteTaskSolutionCapability::constructMotionPlan(const moveit_task_constr
}
exec_traj.trajectory = std::make_shared<robot_trajectory::RobotTrajectory>(model, group);
exec_traj.trajectory->setRobotTrajectoryMsg(state, sub_traj.trajectory);
// Check that sub trajectories that contain a valid trajectory have controllers configured.
if (!sub_traj.trajectory.joint_trajectory.points.empty() && sub_traj.execution_info.controller_names.empty()) {
RCLCPP_WARN(LOGGER,
"The trajectory of stage '%i' from task '%s' does not have any controllers specified for "
"trajectory execution. This might lead to unexpected controller selection.",
sub_traj.info.stage_id, solution.task_id.c_str());
}
exec_traj.controller_name = sub_traj.execution_info.controller_names;

/* TODO add action feedback and markers */
exec_traj.effect_on_success = [this, sub_traj,
description](const plan_execution::ExecutableMotionPlan* /*plan*/) {
if (!moveit::core::isEmpty(sub_traj.scene_diff)) {
RCLCPP_DEBUG_STREAM(LOGGER, "apply effect of " << description);
return context_->planning_scene_monitor_->newPlanningSceneMessage(sub_traj.scene_diff);
}
return true;
};
exec_traj.effect_on_success =
[this, sub_traj, description = exec_traj.description](const plan_execution::ExecutableMotionPlan* /*plan*/) {
if (!moveit::core::isEmpty(sub_traj.scene_diff)) {
RCLCPP_DEBUG_STREAM(LOGGER, "apply effect of " << description);
return context_->planning_scene_monitor_->newPlanningSceneMessage(sub_traj.scene_diff);
}
return true;
};

if (!moveit::core::isEmpty(sub_traj.scene_diff.robot_state) &&
!moveit::core::robotStateMsgToRobotState(sub_traj.scene_diff.robot_state, state, true)) {
RCLCPP_ERROR_STREAM(LOGGER, "invalid intermediate robot state in scene diff of SubTrajectory " << description);
RCLCPP_ERROR_STREAM(LOGGER, "invalid intermediate robot state in scene diff of SubTrajectory "
<< exec_traj.description);
return false;
}
}
Expand Down
7 changes: 1 addition & 6 deletions capabilities/src/execute_task_solution_capability.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,8 @@ class ExecuteTaskSolutionCapability : public MoveGroupCapability
rclcpp_action::CancelResponse
preemptCallback(const std::shared_ptr<rclcpp_action::ServerGoalHandle<ExecuteTaskSolutionAction>>& goal_handle);

/** Always accept the goal */
rclcpp_action::GoalResponse handleNewGoal(const rclcpp_action::GoalUUID& /*uuid*/,
const ExecuteTaskSolutionAction::Goal::ConstSharedPtr& /*goal*/) const {
return rclcpp_action::GoalResponse::ACCEPT_AND_EXECUTE;
}

ActionServerType::SharedPtr as_;
std::future<void> last_goal_future_;
};

} // namespace move_group
6 changes: 4 additions & 2 deletions core/include/moveit/task_constructor/solvers/cartesian_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ class CartesianPath : public PlannerInterface

void init(const moveit::core::RobotModelConstPtr& robot_model) override;

bool plan(const planning_scene::PlanningSceneConstPtr& from, const planning_scene::PlanningSceneConstPtr& to,
MoveItErrorCode plan(const planning_scene::PlanningSceneConstPtr& from, const planning_scene::PlanningSceneConstPtr& to,
const moveit::core::JointModelGroup* jmg, double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;

bool plan(const planning_scene::PlanningSceneConstPtr& from, const moveit::core::LinkModel& link,
MoveItErrorCode plan(const planning_scene::PlanningSceneConstPtr& from, const moveit::core::LinkModel& link,
const Eigen::Isometry3d& offset, const Eigen::Isometry3d& target, const moveit::core::JointModelGroup* jmg,
double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;

std::string getPlannerId() const override { return std::string("CartesianPath"); }
};
} // namespace solvers
} // namespace task_constructor
Expand Down
18 changes: 11 additions & 7 deletions core/include/moveit/task_constructor/solvers/joint_interpolation.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ class JointInterpolationPlanner : public PlannerInterface

void init(const moveit::core::RobotModelConstPtr& robot_model) override;

bool plan(const planning_scene::PlanningSceneConstPtr& from, const planning_scene::PlanningSceneConstPtr& to,
const core::JointModelGroup* jmg, double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;
MoveItErrorCode
plan(const planning_scene::PlanningSceneConstPtr& from, const planning_scene::PlanningSceneConstPtr& to,
const core::JointModelGroup* jmg, double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;

bool plan(const planning_scene::PlanningSceneConstPtr& from, const moveit::core::LinkModel& link,
const Eigen::Isometry3d& offset, const Eigen::Isometry3d& target, const moveit::core::JointModelGroup* jmg,
double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;
MoveItErrorCode
plan(const planning_scene::PlanningSceneConstPtr& from, const moveit::core::LinkModel& link,
const Eigen::Isometry3d& offset, const Eigen::Isometry3d& target, const moveit::core::JointModelGroup* jmg,
double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;

std::string getPlannerId() const override { return std::string("JointInterpolationPlanner"); }
};
} // namespace solvers
} // namespace task_constructor
Expand Down
16 changes: 9 additions & 7 deletions core/include/moveit/task_constructor/solvers/multi_planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ class MultiPlanner : public PlannerInterface, public std::vector<solvers::Planne

void init(const moveit::core::RobotModelConstPtr& robot_model) override;

bool plan(const planning_scene::PlanningSceneConstPtr& from, const planning_scene::PlanningSceneConstPtr& to,
const moveit::core::JointModelGroup* jmg, double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;
MoveItErrorCode
plan(const planning_scene::PlanningSceneConstPtr& from, const planning_scene::PlanningSceneConstPtr& to,
const moveit::core::JointModelGroup* jmg, double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;

bool plan(const planning_scene::PlanningSceneConstPtr& from, const moveit::core::LinkModel& link,
const Eigen::Isometry3d& offset, const Eigen::Isometry3d& target, const moveit::core::JointModelGroup* jmg,
double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;
MoveItErrorCode
plan(const planning_scene::PlanningSceneConstPtr& from, const moveit::core::LinkModel& link,
const Eigen::Isometry3d& offset, const Eigen::Isometry3d& target, const moveit::core::JointModelGroup* jmg,
double timeout, robot_trajectory::RobotTrajectoryPtr& result,
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;
};
} // namespace solvers
} // namespace task_constructor
Expand Down
Loading
Loading