Skip to content

Commit

Permalink
Navigation planning: fixed test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lianglia-apollo authored and ycool committed Jul 3, 2018
1 parent b971204 commit b4ffd43
Show file tree
Hide file tree
Showing 2 changed files with 733 additions and 732 deletions.
5 changes: 3 additions & 2 deletions modules/drivers/lidar_velodyne/pointcloud/lib/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define MODULES_DRIVERS_LIDAR_VELODYNE_POINTCLOUD_LIB_UTIL_H_

#include <fstream>
#include <string>

#include "angles/angles.h"
#include "ros/ros.h"
Expand All @@ -34,7 +35,7 @@ void dump_msg(const T& msg, const std::string& file_path) {
boost::shared_array<uint8_t> obuffer(new uint8_t[serial_size]);
ros::serialization::OStream ostream(obuffer.get(), serial_size);
ros::serialization::serialize(ostream, msg);
ofs.write((char*)obuffer.get(), serial_size);
ofs.write(reinterpret_cast<char*>(obuffer.get()), serial_size);
ofs.close();
}

Expand All @@ -49,7 +50,7 @@ void load_msg(const std::string& file_path, T* msg) {

uint32_t file_size = end - begin;
boost::shared_array<uint8_t> ibuffer(new uint8_t[file_size]);
ifs.read((char*)ibuffer.get(), file_size);
ifs.read(reinterpret_cast<char*>(ibuffer.get()), file_size);
ros::serialization::IStream istream(ibuffer.get(), file_size);
ros::serialization::deserialize(istream, *msg);
ifs.close();
Expand Down
Loading

0 comments on commit b4ffd43

Please sign in to comment.