Skip to content

Commit

Permalink
Merge branch 'humble' into 2024-07-15_revert_breaking_capabilities_ch…
Browse files Browse the repository at this point in the history
…ange
  • Loading branch information
sjahr authored Aug 19, 2024
2 parents 920dcb2 + d583c04 commit 40c7abc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

#include <pilz_industrial_motion_planner/trajectory_generator_lin.h>

#include <pilz_industrial_motion_planner/tip_frame_getter.h>

#include <cassert>
#include <sstream>
#include <time.h>
Expand Down Expand Up @@ -75,7 +77,7 @@ void TrajectoryGeneratorLIN::extractMotionPlanInfo(const planning_scene::Plannin
// goal given in joint space
if (!req.goal_constraints.front().joint_constraints.empty())
{
info.link_name = robot_model_->getJointModelGroup(req.group_name)->getSolverInstance()->getTipFrame();
info.link_name = getSolverTipFrame(robot_model_->getJointModelGroup(req.group_name));

if (req.goal_constraints.front().joint_constraints.size() !=
robot_model_->getJointModelGroup(req.group_name)->getActiveJointModelNames().size())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ TEST_F(TrajectoryFunctionsTestFlangeAndGripper, testIKSolver)
const moveit::core::JointModelGroup* jmg = robot_model_->getJointModelGroup(planning_group_);
const kinematics::KinematicsBaseConstPtr& solver = jmg->getSolverInstance();

if (!solver)
{
throw("No IK solver configured for group '" + planning_group_ + "'");
}
// robot state
moveit::core::RobotState rstate(robot_model_);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ class Ros2ControlManager : public moveit_controller_manager::MoveItControllerMan
ControllersMap::iterator c = managed_controllers_.find(it);
if (c != managed_controllers_.end())
{ // controller belongs to this manager
request->stop_controllers.push_back(c->second.name);
request->deactivate_controllers.push_back(c->second.name);
claimed_resources.right.erase(c->second.name); // remove resources
}
}
Expand All @@ -430,16 +430,16 @@ class Ros2ControlManager : public moveit_controller_manager::MoveItControllerMan
ControllersMap::iterator c = managed_controllers_.find(it);
if (c != managed_controllers_.end())
{ // controller belongs to this manager
request->start_controllers.push_back(c->second.name);
request->activate_controllers.push_back(c->second.name);
for (const auto& required_resource : c->second.required_command_interfaces)
{
resources_bimap::right_const_iterator res = claimed_resources.right.find(required_resource);
if (res != claimed_resources.right.end())
{ // resource is claimed
if (std::find(request->stop_controllers.begin(), request->stop_controllers.end(), res->second) ==
request->stop_controllers.end())
if (std::find(request->deactivate_controllers.begin(), request->deactivate_controllers.end(),
res->second) == request->deactivate_controllers.end())
{
request->stop_controllers.push_back(res->second); // add claiming controller to stop list
request->deactivate_controllers.push_back(res->second); // add claiming controller to stop list
}
claimed_resources.left.erase(res->second); // remove claimed resources
}
Expand All @@ -451,7 +451,7 @@ class Ros2ControlManager : public moveit_controller_manager::MoveItControllerMan
// successfully activated or deactivated.
request->strictness = controller_manager_msgs::srv::SwitchController::Request::STRICT;

if (!request->start_controllers.empty() || !request->stop_controllers.empty())
if (!request->activate_controllers.empty() || !request->deactivate_controllers.empty())
{ // something to switch?
auto result_future = switch_controller_service_->async_send_request(request);
if (result_future.wait_for(std::chrono::duration<double>(SERVICE_CALL_TIMEOUT)) == std::future_status::timeout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class ActionBasedControllerHandle : public ActionBasedControllerHandleBase
do
{
status = result_future.wait_for(50ms);
if ((status == std::future_status::timeout) and ((node_->now() - start) > timeout))
if ((status == std::future_status::timeout) && ((node_->now() - start) > timeout))
{
RCLCPP_WARN(LOGGER, "waitForExecution timed out");
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void PlanningSceneRender::renderPlanningScene(const planning_scene::PlanningScen
color.r = c.r;
color.g = c.g;
color.b = c.b;
color.a = c.a;
alpha = c.a;
}
for (std::size_t j = 0; j < object->shapes_.size(); ++j)
Expand Down

0 comments on commit 40c7abc

Please sign in to comment.