Skip to content

Commit

Permalink
Added all the python interfaces for these changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsbore committed Sep 6, 2019
1 parent f04a25a commit 3e5d47c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pybathy_maps/src/pymap_draper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ PYBIND11_MODULE(map_draper, m) {
const xtf_sss_ping::PingsT&, const MapImageDraper::BoundsT&,
const csv_asvp_sound_speed::EntriesT&>())
.def("set_sidescan_yaw", &MapImageDraper::set_sidescan_yaw, "Set yaw correction of sidescan with respect to nav frame")
.def("set_tracing_map_size", &MapImageDraper::set_tracing_map_size, "Set size of slice of map where we do ray tracing. Smaller makes it faster but you might cut off valid sidescan angles")
.def("set_ray_tracing_enabled", &MapImageDraper::set_ray_tracing_enabled, "Set if ray tracing through water layers should be enabled. Takes more time but is recommended if there are large speed differences")
.def("set_vehicle_mesh", &MapImageDraper::set_vehicle_mesh, "Provide the viewer with a vehicle model, purely for visualization")
.def("show", &MapImageDraper::show, "Start the draping, and show the visualizer")
Expand All @@ -75,6 +76,7 @@ PYBIND11_MODULE(map_draper, m) {
const xtf_sss_ping::PingsT&, const MeasDataDraper::BoundsT&,
const csv_asvp_sound_speed::EntriesT&>())
.def("set_sidescan_yaw", &MeasDataDraper::set_sidescan_yaw, "Set yaw correction of sidescan with respect to nav frame")
.def("set_tracing_map_size", &MeasDataDraper::set_tracing_map_size, "Set size of slice of map where we do ray tracing. Smaller makes it faster but you might cut off valid sidescan angles")
.def("set_ray_tracing_enabled", &MeasDataDraper::set_ray_tracing_enabled, "Set if ray tracing through water layers should be enabled. Takes more time but is recommended if there are large speed differences")
.def("set_vehicle_mesh", &MeasDataDraper::set_vehicle_mesh, "Provide the viewer with a vehicle model, purely for visualization")
.def("show", &MeasDataDraper::show, "Start the draping, and show the visualizer")
Expand Down
1 change: 1 addition & 0 deletions src/pybathy_maps/src/pypatch_draper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ PYBIND11_MODULE(patch_draper, m) {
const xtf_sss_ping::PingsT&, const PatchDraper::BoundsT&,
const csv_asvp_sound_speed::EntriesT&>())
.def("set_sidescan_yaw", &PatchDraper::set_sidescan_yaw, "Set yaw correction of sidescan with respect to nav frame")
.def("set_tracing_map_size", &PatchDraper::set_tracing_map_size, "Set size of slice of map where we do ray tracing. Smaller makes it faster but you might cut off valid sidescan angles")
.def("set_ray_tracing_enabled", &PatchDraper::set_ray_tracing_enabled, "Set if ray tracing through water layers should be enabled. Takes more time but is recommended if there are large speed differences")
.def("set_vehicle_mesh", &PatchDraper::set_vehicle_mesh, "Provide the viewer with a vehicle model, purely for visualization")
.def("show", &PatchDraper::show, "Start the draping, and show the visualizer")
Expand Down
1 change: 1 addition & 0 deletions src/pydata_tools/src/pyall_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,5 @@ PYBIND11_MODULE(all_data, m) {
m.def("convert_matched_entries", &convert_matched_entries, "Matches xtf_sss_ping::PingsT and csv_nav_entry::EntriesT and assign pos data to pings");
m.def("match_attitude", &match_attitude, "Match mbes_ping::PingsT and all_nav_attitude::EntriesT and assign attitude data to pings");
m.def("convert_sound_speeds", &convert_sound_speeds, "Convert all_mbes_ping::PingsT to csv_asvp_sound_speed::EntriesT");
m.def("convert_attitudes", &convert_attitudes, "Convert all_nav_attitude::EntriesT to std_data::attitude_entry::EntriesT");
}
12 changes: 12 additions & 0 deletions src/pydata_tools/src/pystd_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,19 @@ PYBIND11_MODULE(std_data, m) {
.def_static("parse_folder", &parse_folder_from_str<nav_entry>, "Parse nav_entry from folder of ASCII files exported from NaviEdit")
.def_static("read_data", &read_data_from_str<nav_entry::EntriesT>, "Read nav_entry::Entries from .cereal file");

py::class_<attitude_entry>(m, "attitude_entry", "Standard class interface for working with attitude data")
.def(py::init<>())
.def_readwrite("time_string_", &attitude_entry::time_string_, "Member")
.def_readwrite("time_stamp_", &attitude_entry::time_stamp_, "Member")
.def_readwrite("first_in_file_", &attitude_entry::first_in_file_, "Member")
.def_readwrite("roll", &attitude_entry::roll, "Member")
.def_readwrite("pitch", &attitude_entry::pitch, "Member")
.def_readwrite("yaw", &attitude_entry::yaw, "Member")
.def_readwrite("heave", &attitude_entry::heave, "Member")
.def_static("read_data", &read_data_from_str<attitude_entry::EntriesT>, "Read attitude_entry::Entries from .cereal file");

m.def("write_data", &write_data_from_str<mbes_ping::PingsT>, "Write mbes_ping::PingsT to .cereal file");
m.def("write_data", &write_data_from_str<nav_entry::EntriesT>, "Write nav_entry::EntriesT to .cereal file");
m.def("write_data", &write_data_from_str<attitude_entry::EntriesT>, "Write attitude_entry::EntriesT to .cereal file");

}
1 change: 1 addition & 0 deletions src/pydata_tools/src/pyxtf_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ PYBIND11_MODULE(xtf_data, m) {
m.def("make_waterfall_image", &make_eigen_waterfall_image, "Create a cv2 waterfall image from xtf_sss_ping::PingsT");
m.def("show_waterfall_image", &show_waterfall_image, "Show a waterfall image created from xtf_sss_ping::PingsT");
m.def("correct_sensor_offset", &correct_sensor_offset, "Move the sensor onboard the vehicle with a given translation");
m.def("match_attitudes", &match_attitudes, "Get roll and pitch from std_data::attitude_entry by matching timestamps");
}

0 comments on commit 3e5d47c

Please sign in to comment.