Commit 255c80b4 authored by oscar's avatar oscar

提交消息发送类型

parent 4d6b851f
......@@ -276,6 +276,9 @@ void TrackingRos::Init(ros::NodeHandle& nh)
values.push_back(matrix_angle_r_value);
m_tracker.SetValues(values);
nh.param<int32_t>("detect_recv_msg_only", m_recvMsgBit, 0b1111);
SDK_LOG(SDK_INFO, "detect_recv_msg_only = %d", m_recvMsgBit);
YAML::Node config = YAML::LoadFile(file.c_str());
auto cfg = config["TRACKING"];
m_trans = cfg["TRANS"].as<std::vector<std::vector<double>>>();
......@@ -384,7 +387,11 @@ void TrackingRos::TrackingCallBackFunc(const jfx_common_msgs::det_tracking_array
//m_pubCloud.publish(msg->cloud);
}
inline int _GET_VALID_VALUE(unsigned char position, int bits)
{
unsigned int the_mask = (((unsigned int)1) << position);
return (the_mask &= bits) >> position;
}
void TrackingRos::TrackingCameraCallBackFunc(const jfx_common_msgs::InferResesConstPtr& msg)
{
......@@ -432,7 +439,8 @@ void TrackingRos::TrackingCameraCallBackFunc(const jfx_common_msgs::InferResesCo
}
else
continue;
objsPtr->array.push_back(obj);
if(_GET_VALID_VALUE(0, m_recvMsgBit))
objsPtr->array.push_back(obj);
}
//SDK_LOG(SDK_INFO, "camera msg [0] size = %d,[1] = %d,[2] = %d",msg->reses[0].results.size(), msg->reses[1].results.size(), msg->reses[2].results.size());
for (int i = 0; i < 3; i++)
......@@ -548,7 +556,8 @@ void TrackingRos::TrackingCameraCallBackFunc(const jfx_common_msgs::InferResesCo
//objMsg.type = 7;
//SDK_LOG(SDK_INFO, "camera 1,2 x = %f,y = %f", objMsg.x, objMsg.y);
}
objsPtr->array.push_back(objMsg);
if (_GET_VALID_VALUE(i+1, m_recvMsgBit))
objsPtr->array.push_back(objMsg);
}
}
}
......
......@@ -57,4 +57,6 @@ public:
int m_frameNum = 0;
float m_lidar_x_angle = 0.0f;//修改rot_y的参数,从配置里读取
int m_recvMsgBit = 0b1111;//处理消息的类型
};
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