You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe your question
A clear and concise description of your question.
I'm calibrating lidar and imu, and I use Li _ calib, https://github.com/April-zju/lidar _ IMU _ calib.git. The problem now is that the algorithm needs to extend the radar by itself, but I can't get the required parameters correspondingly, so I hope to get help.
The part of the code that needs to be modified:
#ifndef VELODYNE_CORRECTION_HPP
#define VELODYNE_CORRECTION_HPP
/** @todo make this work for both big and little-endian machines */
static const uint16_t UPPER_BANK = 0xeeff;
static const uint16_t LOWER_BANK = 0xddff;
static const int BLOCKS_PER_PACKET = 12;
static const int PACKET_STATUS_SIZE = 2;
int FIRINGS_PER_BLOCK;
int SCANS_PER_FIRING;
float BLOCK_TDURATION;
float DSR_TOFFSET;
float FIRING_TOFFSET;
float PACKET_TIME ;
float sin_rot_table_[ROTATION_MAX_UNITS];
float cos_rot_table_[ROTATION_MAX_UNITS];
float cos_vert_angle_[32];
float sin_vert_angle_[32];
int scan_mapping_16[16];
int scan_mapping_32[32];
typedef struct raw_block {
uint16_t header; ///< UPPER_BANK or LOWER_BANK
uint16_t rotation; ///< 0-35999, divide by 100 to get degrees
uint8_t data[BLOCK_DATA_SIZE];
} raw_block_t;
union two_bytes {
uint16_t uint;
uint8_t bytes[2];
};
union four_bytes {
uint32_t uint32;
float_t float32;
};
/** configuration parameters */
typedef struct {
double max_range; ///< maximum range to publish
double min_range;
int min_angle; ///< minimum angle to publish
int max_angle; ///< maximum angle to publish
} Config;
Config m_config;
ModelType m_modelType;
double mOS32TimeBlock[1824][16];
};
}
#endif
Screenshots
If applicable, add screenshots to help explain your problem.
Platform (please complete the following information):
Describe your question
A clear and concise description of your question.
I'm calibrating lidar and imu, and I use Li _ calib, https://github.com/April-zju/lidar _ IMU _ calib.git. The problem now is that the algorithm needs to extend the radar by itself, but I can't get the required parameters correspondingly, so I hope to get help.
The part of the code that needs to be modified:
#ifndef VELODYNE_CORRECTION_HPP
#define VELODYNE_CORRECTION_HPP
#include <ros/ros.h>
#include <velodyne_msgs/VelodynePacket.h>
#include <velodyne_msgs/VelodyneScan.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl_ros/point_cloud.h>
#include <angles/angles.h>
#include
#include
#include <utils/pcl_utils.h>
namespace licalib {
class VelodyneCorrection {
public:
typedef std::shared_ptr Ptr;
enum ModelType {
ouster_32,
};
VelodyneCorrection(ModelType modelType = ouster_32) : m_modelType(modelType) {
setParameters(m_modelType);
}
void unpack_scan(const ouster_ros::Cloud::ConstPtr &lidarMsg,
TPointCloud &outPointCloud) const
{
inline double getExactTime(int dsr, int firing) const {
return mOS32TimeBlock[firing][dsr];
}
private:
void setParameters(ModelType modelType) {
m_modelType = modelType;
m_config.max_range = 120;
m_config.min_range = 0.3;
m_config.min_angle = 0;
m_config.max_angle = 36000;
// Set up cached values for sin and cos of all the possible headings
for (uint16_t rot_index = 0; rot_index < ROTATION_MAX_UNITS; ++rot_index) {
float rotation = angles::from_degrees(ROTATION_RESOLUTION * rot_index);
cos_rot_table_[rot_index] = cosf(rotation);
sin_rot_table_[rot_index] = sinf(rotation);
}
}
inline bool pointInRange(float range) const {
return (range >= m_config.min_range
&& range <= m_config.max_range);
}
private:
static const int RAW_SCAN_SIZE = 3;
static const int SCANS_PER_BLOCK = 32;
static const int BLOCK_DATA_SIZE = (SCANS_PER_BLOCK * RAW_SCAN_SIZE);
constexpr static const float ROTATION_RESOLUTION = 0.01f;
static const uint16_t ROTATION_MAX_UNITS = 36000u;
constexpr static const float DISTANCE_RESOLUTION = 0.002f;
/** @todo make this work for both big and little-endian machines */
static const uint16_t UPPER_BANK = 0xeeff;
static const uint16_t LOWER_BANK = 0xddff;
static const int BLOCKS_PER_PACKET = 12;
static const int PACKET_STATUS_SIZE = 2;
int FIRINGS_PER_BLOCK;
int SCANS_PER_FIRING;
float BLOCK_TDURATION;
float DSR_TOFFSET;
float FIRING_TOFFSET;
float PACKET_TIME ;
float sin_rot_table_[ROTATION_MAX_UNITS];
float cos_rot_table_[ROTATION_MAX_UNITS];
float cos_vert_angle_[32];
float sin_vert_angle_[32];
int scan_mapping_16[16];
int scan_mapping_32[32];
typedef struct raw_block {
uint16_t header; ///< UPPER_BANK or LOWER_BANK
uint16_t rotation; ///< 0-35999, divide by 100 to get degrees
uint8_t data[BLOCK_DATA_SIZE];
} raw_block_t;
union two_bytes {
uint16_t uint;
uint8_t bytes[2];
};
union four_bytes {
uint32_t uint32;
float_t float32;
};
typedef struct raw_packet {
raw_block_t blocks[BLOCKS_PER_PACKET];
uint32_t revolution;
uint8_t status[PACKET_STATUS_SIZE];
} raw_packet_t;
/** configuration parameters */
typedef struct {
double max_range; ///< maximum range to publish
double min_range;
int min_angle; ///< minimum angle to publish
int max_angle; ///< maximum angle to publish
} Config;
Config m_config;
ModelType m_modelType;
double mOS32TimeBlock[1824][16];
};
}
#endif
Screenshots
If applicable, add screenshots to help explain your problem.
Platform (please complete the following information):
The text was updated successfully, but these errors were encountered: