Skip to content

Commit 5ae9e54

Browse files
committed
[bugfix] fix crash on reach action goal received
1 parent 0769964 commit 5ae9e54

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/problem/impl/Cartesian.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,13 @@ bool CartesianTaskImpl::setWayPoints(const Trajectory::WayPointVector & way_poin
405405
return false;
406406
}
407407

408+
if(getActivationState() == ActivationState::Disabled)
409+
{
410+
XBot::Logger::error("Unable to set target pose. Task '%s' is in DISABLED mode \n",
411+
getName().c_str());
412+
return false;
413+
}
414+
408415
_state = State::Reaching;
409416
_trajectory->clear();
410417
_trajectory->addWayPoint(getTime(), _T);

src/ros/server_api/CartesianRos.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ ReachActionManager::ReachActionManager(rclcpp::Node::SharedPtr node,
303303
CartesianTask::Ptr task):
304304
_task(task),
305305
_state(ReachActionState::IDLE),
306-
_name(task_name)
306+
_name(task_name),
307+
_node(node)
307308
{
308309
using namespace std::placeholders;
309310

0 commit comments

Comments
 (0)