Pose Estimation Skill Megapose6D fixes

This commit is contained in:
shalenikol 2023-12-22 10:50:41 +00:00 committed by Igor Brylyov
parent ce03b17c48
commit 324ae82c20
9 changed files with 94102 additions and 220619 deletions

View file

@ -22,12 +22,10 @@ public:
while (!_set_params_client->wait_for_service(1s)) {
if (!rclcpp::ok()) {
RCLCPP_ERROR(_node->get_logger(),
"Interrupted while waiting for the service. Exiting.");
RCLCPP_ERROR(_node->get_logger(), "Interrupted while waiting for the service. Exiting.");
break;
}
RCLCPP_WARN(_node->get_logger(),
"service not available, waiting again...");
RCLCPP_WARN(_node->get_logger(), "service not available, waiting again...");
}
_model_name = getInput<std::string>("ObjectName").value();
@ -71,6 +69,9 @@ private:
if (req_type == "configure") {
set_mesh_param();
transition_id_ = lifecycle_msgs::msg::Transition::TRANSITION_CONFIGURE;
} else if (req_type == "calibrate") {
set_str_param();
transition_id_ = lifecycle_msgs::msg::Transition::TRANSITION_CONFIGURE;
} else if (req_type == "activate") {
transition_id_ = lifecycle_msgs::msg::Transition::TRANSITION_ACTIVATE;
} else if (req_type == "deactivate") {
@ -78,6 +79,7 @@ private:
} else if (req_type == "cleanup") {
transition_id_ = lifecycle_msgs::msg::Transition::TRANSITION_CLEANUP;
}
//calibrate
translation.set__id(transition_id_);
return translation;
}
@ -91,6 +93,13 @@ private:
return model_path;
}
void set_str_param() {
RCLCPP_INFO_STREAM(_node->get_logger(), "Set string parameter: <" + _model_name + ">");
std::vector<rclcpp::Parameter> _parameters{rclcpp::Parameter("mesh_path", _model_name)};
_set_params_client->set_parameters(_parameters);
}
void set_mesh_param() {
auto _package_name = ament_index_cpp::get_package_share_directory("rbs_perception");
_model_path = build_model_path(_model_name, _package_name);