|
@@ -60,6 +60,10 @@ pilot_autoware_bridge::pilot_autoware_bridge() : Node("pilot_autoware_bridge")
|
|
|
pose_sub_ = create_subscription<geometry_msgs::msg::PoseStamped>(
|
|
|
"pose", queue_size, std::bind(&pilot_autoware_bridge::callbackPose, this, _1));
|
|
|
|
|
|
+ detected_object_with_feature_sub_ = create_subscription<tier4_perception_msgs::msg::DetectedObjectsWithFeature>(
|
|
|
+ "/perception/object_recognition/detection/labeled_clusters", queue_size, std::bind(&pilot_autoware_bridge::callbackObject, this, _1));
|
|
|
+
|
|
|
+
|
|
|
pub_odom_ = create_publisher<Odometry>("/localization/kinematic_state", durable_qos);
|
|
|
pub_tf_ = create_publisher<tf2_msgs::msg::TFMessage>("/tf", durable_qos);
|
|
|
|
|
@@ -576,3 +580,55 @@ void pilot_autoware_bridge::UpdateGPSIMU(const char * strdata,const unsigned int
|
|
|
publish_acceleration();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+void pilot_autoware_bridge::callbackObject(tier4_perception_msgs::msg::DetectedObjectsWithFeature::SharedPtr obj_msg_ptr)
|
|
|
+{
|
|
|
+ (void)obj_msg_ptr;
|
|
|
+ std::cout<<"recv obj. "<<std::endl;
|
|
|
+ std::cout<<"obj cout: "<<obj_msg_ptr->feature_objects.size()<<std::endl;
|
|
|
+ tier4_perception_msgs::msg::DetectedObjectWithFeature feature_object;
|
|
|
+ int nsize = obj_msg_ptr->feature_objects.size();
|
|
|
+ int i;
|
|
|
+ for(i=0;i<nsize;i++)
|
|
|
+ {
|
|
|
+ feature_object = obj_msg_ptr->feature_objects.at(i);
|
|
|
+
|
|
|
+ std::cout<<" class: "<<feature_object.object.classification.size()<<std::endl;
|
|
|
+ if(feature_object.object.classification.size()>0)
|
|
|
+ {
|
|
|
+ std::cout<<" label: "<<(int)feature_object.object.classification.at(0).label<<"probability"<<feature_object.object.classification.at(0).probability<<std::endl;
|
|
|
+ }
|
|
|
+
|
|
|
+ geometry_msgs::msg::PoseWithCovariance pose;
|
|
|
+ geometry_msgs::msg::TwistWithCovariance twist;
|
|
|
+
|
|
|
+ pose = feature_object.object.kinematics.pose_with_covariance;
|
|
|
+ twist = feature_object.object.kinematics.twist_with_covariance;
|
|
|
+ std::cout<<" x:"<< pose.pose.position.x<<" y: "<<pose.pose.position.y<<std::endl;;
|
|
|
+ std::cout<<" vel: "<<twist.twist.linear.x<<std::endl;
|
|
|
+
|
|
|
+ autoware_auto_perception_msgs::msg::Shape shape= feature_object.object.shape;
|
|
|
+ std::cout<<"dim: x:"<<shape.dimensions.x<<" y:"<<shape.dimensions.y<<" z:"<<shape.dimensions.z<<std::endl;
|
|
|
+ std::cout<<" shape type: "<<(int)shape.type<<std::endl;
|
|
|
+ int j;
|
|
|
+ int sizepoint = shape.footprint.points.size();
|
|
|
+ std::cout<<" shape point size: "<<sizepoint<<std::endl;
|
|
|
+ for(j=0;j<sizepoint;j++)
|
|
|
+ {
|
|
|
+ std::cout<<" index"<<j<<" : x: "<<shape.footprint.points.at(j).x<<" y: "<<shape.footprint.points.at(j).y<<std::endl;
|
|
|
+ }
|
|
|
+
|
|
|
+// feature_object.object.classification.push_back(object.classification);
|
|
|
+// feature_object.object.kinematics.pose_with_covariance = object.initial_state.pose_covariance;
|
|
|
+// feature_object.object.kinematics.twist_with_covariance =
|
|
|
+// object.initial_state.twist_covariance;
|
|
|
+// feature_object.object.kinematics.orientation_availability =
|
|
|
+// autoware_auto_perception_msgs::msg::DetectedObjectKinematics::UNAVAILABLE;
|
|
|
+// feature_object.object.kinematics.has_twist = false;
|
|
|
+// tf2::toMsg(
|
|
|
+// tf_base_link2noised_moved_object,
|
|
|
+// feature_object.object.kinematics.pose_with_covariance.pose);
|
|
|
+// feature_object.object.shape = object.shape;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|