Comments (11)
只有Livox-SDK 的接口说明文档;
livox ros dirver 对外publish pointcloud2格式的点云数据,应用端节点只需订阅该topic即可;
from livox_ros_driver.
我是想参照 livox_ros_driver 实现一个不基于ros的livox驱动(但功能类似),你们有类似的demo吗?
from livox_ros_driver.
可以参考下Livox-SDK 下sample_cc的demo实现
from livox_ros_driver.
void LdsLidar::OnDeviceBroadcast(const BroadcastDeviceInfo *info) {
if (info == nullptr) {
return;
}
if (info->dev_type == kDeviceTypeHub) {
printf("In lidar mode, couldn't connect a hub : %s\n", info->broadcast_code);
return;
}
if (g_lidars->IsAutoConnectMode()) {
printf("In automatic connection mode, will connect %s\n", info->broadcast_code);
} else {
if (!g_lidars->FindInWhitelist(info->broadcast_code)) {
printf("Not in the whitelist, please add %s to if want to connect!\n",\
info->broadcast_code);
return;
}
}
bool result = false;
uint8_t handle = 0;
result = AddLidarToConnect(info->broadcast_code, &handle);
if (result == kStatusSuccess && handle < kMaxLidarCount) {
SetDataCallback(handle, LdsLidar::GetLidarDataCb, (void *)g_lidars);
LidarDevice* p_lidar = &(g_lidars->lidars_[handle]);
p_lidar->handle = handle;
p_lidar->connect_state = kConnectStateOff;
p_lidar->config.enable_fan = true;
p_lidar->config.return_mode = kStrongestReturn;
p_lidar->config.coordinate = kCoordinateCartesian;
p_lidar->config.imu_rate = kImuFreq200Hz;
} else {
printf("Add lidar to connect is failed : %d %d \n", result, handle);
}
}
你说的是这个回调函数吗?每次回调只返回一个点云吗?每秒钟能扫描出多少个点,这个数量是固定的吗?
from livox_ros_driver.
sample_cc/lidar 中:
void LdsLidar::GetLidarDataCb(uint8_t handle, LivoxEthPacket *data,
uint32_t data_num, void *client_data) {
或者ros driver的lds_lidar.cpp 源文件中:
void LdsLidar::OnLidarDataCb(uint8_t handle, LivoxEthPacket *data,
uint32_t data_num, void *client_data) {
每次接收一个完整的以太网包,每个以太网包中点云的个数在用户手册中有说明:
mid40/mid100 每个以太网中包含100个点,没秒总点数100K;
Horizon/tele 每个以太网中包含96个点,每秒总点数是240K;
from livox_ros_driver.
sample_cc/lidar 中:
void LdsLidar::GetLidarDataCb(uint8_t handle, LivoxEthPacket *data,
uint32_t data_num, void *client_data)
LivoxEthPacket 就是一个以太网包吗?
typedef struct {
uint8_t version; /**< Packet protocol version. */
uint8_t slot; /**< Slot number used for connecting LiDAR. */
uint8_t id; /**< LiDAR id. */
uint8_t rsvd; /**< Reserved. */
uint32_t err_code; /**< Device error status indicator information. */
uint8_t timestamp_type; /**< Timestamp type. */
/** Point cloud coordinate format, refer to \ref PointDataType . */
uint8_t data_type;
uint8_t timestamp[8]; /**< Nanosecond or UTC format timestamp. */
uint8_t data[1]; /**< Point cloud data. */
} LivoxEthPacket;
按照您上面说的,每个以太网包中包含100个点,意思是函数
void LdsLidar::GetLidarDataCb(uint8_t handle, LivoxEthPacket *data,
uint32_t data_num, void *client_data)
的LivoxEthPacket *data
里面有100个点?
不知道我这样理解是否有误?
from livox_ros_driver.
是的
from livox_ros_driver.
这只是一个简单的范例,例子中只取了一个点的数据,目的是示范如何从以太网包中取点;
可以参考ros driver的数据处理,ros driver先将整个以太网包缓存到环形队列中;然后在另外一个单独的线程中读取并解析数据
from livox_ros_driver.
/** Parsing the timestamp and the point cloud data. */
uint64_t cur_timestamp = *((uint64_t *)(data->timestamp));
std::cout << "timestamp:" << cur_timestamp << std::endl;
if(data ->data_type == kCartesian) { // 笛卡尔坐标点云
LivoxRawPoint *p_point_data = (LivoxRawPoint *)data->data;
for (int ii = 0; ii < 100; ++ii) {
std::cout << "p_point_data: "<< cnt << ", [" << p_point_data->x/1000.0 << "," << p_point_data->y/1000.0 << "," << p_point_data->z/1000.0 << "," << +p_point_data->reflectivity << "]" << std::endl;
p_point_data++;
}
}
是不是这样子访问的?
from livox_ros_driver.
是的
from livox_ros_driver.
好的,非常感谢
from livox_ros_driver.
Related Issues (20)
- pps时间同步后,点云时间戳滞后于系统时间 HOT 1
- How to run Livox Avia and Livox MID 360 simultaneously. HOT 2
- Init lds lidar failed happened about once per 100 times.
- 点云数量过少,无论室内室外
- multi_topic:=true shows no difference HOT 1
- Unable to connect to Livox MID-70 using ROS launch files
- fast_lio /lasermapping client error #livox_ros_driver/CustomMsg
- lvx file to rosbag error
- 安装ROS驱动时提示,请先安装Livox-SDK,但是我雷达是mid-360,已经安装了Livox-SDK2,请问应该怎么解决 HOT 1
- LIVOX AVIA 激光时间戳出错,imu发送逻辑问题(livox/lidar timestamp error and the publish logic of imu is weird) HOT 5
- LIVOX MID-360 not able to detect plzz help!!! HOT 23
- Communication between coral dev board and the px4
- ubuntu18.04 mid-360 ROS,not error,not data out,plzz,help!!!!!!!!!!!! HOT 1
- Need help (error while running the samples) HOT 1
- gpspps LidarSetRmcSyncTime is OK,But timestamp_type is 0。
- Question: Resetting the mid-70 ros2 driver node
- Merging with Velodyne VLP-16 on ROS2
- [ERROR] [1713941763.717755465]: Init lds lvx file fail!
- Loss of points/data packages (aka) Jumps in timestamps between frames
- Help! Confusion regarding roslaunch livox_ros_driver livox_lidar.launch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livox_ros_driver.