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

"getElem() should not see invalid handles" in kinetic #199

Open
Jeffrey53 opened this issue Jun 16, 2022 · 1 comment
Open

"getElem() should not see invalid handles" in kinetic #199

Jeffrey53 opened this issue Jun 16, 2022 · 1 comment

Comments

@Jeffrey53
Copy link

My program exits cause I call sendGoal and print"getElem() should not see invalid handles"

@Jeffrey53
Copy link
Author

occasionally appear.
Here is my code:

bool RosInterface::callNavModeAction(const NavModeParameter &parameter) {
if (nav_mode_action_ == nullptr) nav_mode_action_ = std::make_shared(*n_, "navigation_mode");

if (!nav_mode_action_.get()->waitForServer(ros::Duration(3))) {
if (ros_msg_callback_ != nullptr) ros_msg_callback_("action server is invalid,action:navigation_mode");
return false;
}

aic_msgs::NavigationModeGoal goal;
goal.id = parameter.id;
goal.navigation_mode = static_cast<uint8_t>(parameter.mode);
goal.waiting_timeout = parameter.wait_time;
goal.max_speed = parameter.max_speed;
goal.permitted_passage = parameter.permitted_passage;
goal.capacity = parameter.capacity;
nav_mode_action_.get()->sendGoal(goal, boost::bind(&RosInterface::navModeCB, this, _1, _2));

if (ros_msg_callback_ != nullptr) ros_msg_callback_("send goal,action:navigation_mode");
return true;
}

void RosInterface::navModeCB(const actionlib::SimpleClientGoalState& state,
const aic_msgs::NavigationModeResultConstPtr&) {
if (ros_msg_callback_ != nullptr)
ros_msg_callback_("navModeCB called,state:" + std::to_string(static_cast<int32_t>(state.state_)));
}

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

No branches or pull requests

1 participant