Commit c5b1c0a4 authored by wangqibing's avatar wangqibing

add mark_type_text

parent 73abd3f1
......@@ -358,7 +358,11 @@ void TrackingRos::Init(ros::NodeHandle& nh)
}
//m_coordinate.Init(value[0][0], value[0][1], value[0][2], value[0][3], value[1][0], value[1][1]);
if(config["mark_type_text"])
{
mark_type_text = config["mark_type_text"].as<int>();
}
std::string fusion_topic = "/fusion_res";
std::string tracking_topic = "/tracking_res";
std::string cloud_topic = "/tracking_cloud";
......@@ -848,21 +852,49 @@ void TrackingRos::ThreadTrackingProcess()
t_marker.pose.orientation.y = 0.0;
t_marker.pose.orientation.z = 0.0;
t_marker.pose.orientation.w = 1.0;
t_marker.scale.x = 4;
t_marker.scale.y = 4;
t_marker.scale.z = 4;
if(mark_type_text ==0)
{
t_marker.scale.x = 2;
t_marker.scale.y = 2;
t_marker.scale.z = 2;
}
if(mark_type_text==1)
{
t_marker.scale.x = 4;
t_marker.scale.y = 4;
t_marker.scale.z = 4;
}
if(mark_type_text==2)
{
t_marker.scale.x = 4;
t_marker.scale.y = 4;
t_marker.scale.z = 4;
}
t_marker.color.a = 1.0;
t_marker.color.r = 0;
t_marker.color.g = 1.0;
t_marker.color.b = 0;
t_marker.color.g = 0;
t_marker.color.b = 1.0;
t_marker.lifetime = ros::Duration(0.5);
char str[512] = {};
//sprintf(str, "id:{%llu},type:{%d},type_name:{%s},v:{%.2f}m/s,No:{%s}\ncolor_name:{%s},timestamp:{%llu}",
// obj.obj_id, obj.type, obj.name.c_str(), sqrt(obj.v_x* obj.v_x + obj.v_y * obj.v_y) * 10, obj.license_plate_number.c_str(), obj.color_name.c_str(), obj.frame);
// sprintf(str, "%llu",obj.obj_id);
// sprintf(str, "%s",obj.color_name.c_str());
sprintf(str,"%llu:%.2f",obj.obj_id,sqrt(obj.v_x* obj.v_x + obj.v_y * obj.v_y) * 10);
t_marker.text = str;
if(mark_type_text ==0)
{
sprintf(str,"%d",obj.type);
t_marker.text = str;
}
if(mark_type_text==1)
{
sprintf(str,"%llu",obj.obj_id);
t_marker.text = str;
}
if(mark_type_text==2)
{
sprintf(str,"%llu:%.2f",obj.obj_id,sqrt(obj.v_x* obj.v_x + obj.v_y * obj.v_y) * 10);
t_marker.text = str;
}
//t_marker.text = 'id:{0},type:{1},type_name:{2},v:{3:.2f}m/s,No:{4}\ncolor_name:{5},timestamp:{6}'.format(msg.obj_id, msg.type, msg.name, math.sqrt(msg.v_x * msg.v_x + msg.v_y * msg.v_y) * 10, msg.license_plate_number, msg.color_name, msg.frame)
sendMarkers.markers.emplace_back(t_marker);
i += 1;
......
......@@ -67,4 +67,5 @@ public:
std::string m_root_dir;//存储统一的根目录路径
std::string m_nodeName;//点位信息,现在就是10-1,1-1等信息
YAML::Node m_config;//配置的yaml文件
int mark_type_text = 0;//0-type,1-object_id,2-text...
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment