Commit 9766af35 authored by oscar's avatar oscar

修改读取nuScenes数据集逻辑

parent fd241b6c
...@@ -72,6 +72,7 @@ include_directories( ...@@ -72,6 +72,7 @@ include_directories(
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
${PROJECT_SOURCE_DIR}/src/main.cpp ${PROJECT_SOURCE_DIR}/src/main.cpp
${PROJECT_SOURCE_DIR}/src/SendRosMsg.cpp ${PROJECT_SOURCE_DIR}/src/SendRosMsg.cpp
${PROJECT_SOURCE_DIR}/src/NuScenesRosMsg.cpp
) )
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS}) target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
......
<launch> <launch>
<arg name="parampath" default="$(find jfx_node_ros)/config/params.yaml"/> <arg name="parampath" default="$(find jfx_node_ros)/config/params.yaml"/>
<arg name="run_mode" default="1"/> <arg name="run_mode" default="3"/>
<arg name="originDataPath" default="/media/sf_originData/data"/> <arg name="originDataPath" default="/media/sf_originData/data"/>
<arg name="gps_load_file" default="/media/sf_originData/102022041610.nav/102022041610_traj.txt"/> <arg name="gps_load_file" default="/media/sf_originData/102022041610.nav/102022041610_traj.txt"/>
<arg name="outPutSaveDir" default="/media/sf_originData/detect_data/"/> <arg name="outPutSaveDir" default="/media/sf_originData/detect_data/"/>
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
<arg name="play_save_pcd_folder" default="/media/sf_originData/save_data/60_90_csv31_1650064407084/pcd"/> <arg name="play_save_pcd_folder" default="/media/sf_originData/save_data/60_90_csv31_1650064407084/pcd"/>
<arg name="play_save_image0_folder" default="/media/sf_originData/save_data/60_90_csv31_1650064407084/image0"/> <arg name="play_save_image0_folder" default="/media/sf_originData/save_data/60_90_csv31_1650064407084/image0"/>
<arg name="play_save_image1_folder" default="/media/sf_originData/save_data/60_90_csv31_1650064407084/image1"/> <arg name="play_save_image1_folder" default="/media/sf_originData/save_data/60_90_csv31_1650064407084/image1"/>
<node pkg="jfx_node_ros" type="jfx_node_ros" name="jfx_node_ros" output="screen" > <arg name="nuScenes_json_dir" default="/media/sf_shared/nuScenes"/>
<arg name="scene_name" default="scene-1100"/>
<arg name="nuScenes_save_dir" default="/media/sf_shared/nuScenes/output"/>
<node pkg="jfx_node_ros" type="jfx_node_ros" name="jfx_node_ros" output="screen" launch-prefix="gdb -ex run --args">
<param name="parampath" value="$(arg parampath)" /> <param name="parampath" value="$(arg parampath)" />
<param name="run_mode" value="$(arg run_mode)" /> <param name="run_mode" value="$(arg run_mode)" />
<param name="originDataPath" value="$(arg originDataPath)" /> <param name="originDataPath" value="$(arg originDataPath)" />
...@@ -38,5 +41,8 @@ ...@@ -38,5 +41,8 @@
<param name="play_save_pcd_folder" value="$(arg play_save_pcd_folder)" /> <param name="play_save_pcd_folder" value="$(arg play_save_pcd_folder)" />
<param name="play_save_image0_folder" value="$(arg play_save_image0_folder)" /> <param name="play_save_image0_folder" value="$(arg play_save_image0_folder)" />
<param name="play_save_image1_folder" value="$(arg play_save_image1_folder)" /> <param name="play_save_image1_folder" value="$(arg play_save_image1_folder)" />
<param name="nuScenes_json_dir" value="$(arg nuScenes_json_dir)" />
<param name="scene_name" value="$(arg scene_name)" />
<param name="nuScenes_save_dir" value="$(arg nuScenes_save_dir)" />
</node> </node>
</launch> </launch>
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include "SendRosMsg.hpp" #include "SendRosMsg.hpp"
#include "nlohmann_json/json.hpp"
#include "NuScenesRosMsg.hpp"
struct FileInfo struct FileInfo
{ {
...@@ -216,7 +218,21 @@ int main(int argc, char** argv) { ...@@ -216,7 +218,21 @@ int main(int argc, char** argv) {
printf("finish error ret = %d",ret); printf("finish error ret = %d",ret);
ros::spin(); ros::spin();
} }
else if(run_mode == 3)
{
NuScenesRosMsg nuScenesMsg = {};
nuScenesMsg.Play(phpriv_nh);
ros::spin();
}
else if(run_mode == 4)
{
NuScenesRosMsg nuScenesMsg = {};
nuScenesMsg.SaveGT(phpriv_nh);
ros::spin();
}
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment