Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit c9b43bc

Browse files
committed
fix:Add a little note and change the default IP address
1 parent 74c2979 commit c9b43bc

4 files changed

Lines changed: 13 additions & 16 deletions

File tree

demo/zmq_demo/main_zmq.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
#include "udp_manager.h"
77
#include "cam_manager.h"
88
#include "data_manager.h"
9-
10-
#include "mvt_msg_imu.pb.h"
11-
#include "mvt_msg_image.pb.h"
12-
139
#include "zmq.hpp"
10+
#include "msg_imu.pb.h"
11+
#include "msg_image.pb.h"
1412

1513
void Pub(zmq::socket_t *pub, const std::string &topic, const std::string &metadata) {
1614
zmq::message_t topic_msg(topic.size());
@@ -44,7 +42,7 @@ int main() {
4442
ImuData imu_data{};
4543
while (zmq_publisher.connected()) {
4644
while (DataManger::GetInstance().GetNewImuData(imu_data)) {
47-
auto imu = std::make_shared<mvt::protocol::Imu>();
45+
auto imu = std::make_shared<protocol::Imu>();
4846
imu->mutable_header()->set_stamp(imu_data.time_stamp_us * 1000);
4947
imu->mutable_header()->set_sensor_name("imu");
5048
imu->add_angular_velocity(imu_data.gx);
@@ -57,7 +55,7 @@ int main() {
5755
auto serialized_msg = imu->SerializeAsString();
5856
Pub(&zmq_publisher, "imu", serialized_msg);
5957
}
60-
mvt::protocol::Image image;
58+
protocol::Image image;
6159
ImgData image_data{};
6260
for (auto &cam : all_cam_names) {
6361
while (DataManger::GetInstance().GetNewCamData(cam, image_data)) {
@@ -67,7 +65,7 @@ int main() {
6765
image.mutable_header()->set_stamp(image_data.time_stamp_us * 1000);
6866
image.mutable_header()->set_sensor_name(cam);
6967
image.set_name(cam);
70-
mvt::protocol::Mat mat;
68+
protocol::Mat mat;
7169
mat.set_rows(image_data.image.rows);
7270
mat.set_cols(image_data.image.cols);
7371
mat.set_channels(image_data.image.channels());
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
syntax = "proto3";
2-
package mvt.protocol;
2+
package protocol;
33

4-
message DataHeader {
4+
message Header {
55
int64 stamp = 1; // 传感器时间,单位ns
66
uint32 seq = 2;
77
string frame_id = 3;
88
string sensor_name = 4;
9-
int64 time = 5; // 计数器时间,单位ns
109
}

demo/zmq_demo/proto_msg/mvt_msg_image.proto renamed to demo/zmq_demo/proto_msg/msg_image.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
2-
package mvt.protocol;
3-
import "mvt_msg_header.proto";
2+
package protocol;
3+
import "msg_header.proto";
44

55

66
message Mat {
@@ -13,7 +13,7 @@ message Mat {
1313
}
1414

1515
message Image {
16-
DataHeader header = 1;
16+
Header header = 1;
1717
string name = 2;
1818
Mat mat = 3;
1919
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
2-
package mvt.protocol;
3-
import "mvt_msg_header.proto";
2+
package protocol;
3+
import "msg_header.proto";
44

55
message Quaternion {
66
double x = 1;
@@ -9,7 +9,7 @@ message Quaternion {
99
double w = 4;
1010
}
1111
message Imu {
12-
DataHeader header = 1;
12+
Header header = 1;
1313
repeated double angular_velocity = 2;
1414
repeated double linear_acceleration = 3;
1515
Quaternion orientation = 4;

0 commit comments

Comments
 (0)