| 28 | void sim_sensor::Reset(tx_sim::ResetHelper& helper) { std::cout << "reset\n"; } |
| 29 | |
| 30 | void saveJpg(const std::string fname, const std::string buf) { |
| 31 | sim_msg::CameraRaw camera; |
| 32 | if (!camera.ParseFromString(buf)) { |
| 33 | std::cout << "camera error"; |
| 34 | } |
| 35 | if (camera.type() == "JPEG") { |
| 36 | std::fstream of(fname, std::ios::out | std::ios::binary); |
| 37 | of.write(camera.image_data().c_str(), camera.image_data().size()); |
| 38 | of.close(); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | bool savePcd(const std::string fname, const std::string buf) { |
| 43 | sim_msg::LidarRaw lidar; |