Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auvlib v1.0 Work in progress #70

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/data_tools/include/data_tools/std_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <cereal/types/map.hpp>
#include <cereal/types/tuple.hpp>


#define BOOST_NO_CXX11_SCOPED_ENUMS
#include <boost/filesystem.hpp>
#include <boost/range.hpp>
Expand Down Expand Up @@ -74,11 +75,14 @@ struct sss_ping_side
double time_duration;
double tilt_angle;
double beam_width;
uint16_t initial_gain_code;
uint16_t gain_code;

template <class Archive>
void serialize( Archive & ar )
{
ar(CEREAL_NVP(pings), CEREAL_NVP(slant_range), CEREAL_NVP(time_duration), CEREAL_NVP(tilt_angle), CEREAL_NVP(beam_width));
ar(CEREAL_NVP(pings), CEREAL_NVP(slant_range), CEREAL_NVP(time_duration), CEREAL_NVP(tilt_angle),
CEREAL_NVP(beam_width), CEREAL_NVP(initial_gain_code), CEREAL_NVP(gain_code));
}
};

Expand All @@ -98,13 +102,14 @@ struct sss_ping
double lat_;
double long_;
double sound_vel_;
double altitude_;
Eigen::Vector3d pos_; // NOTE: this comes from associating ping with nav data

template <class Archive>
void serialize( Archive & ar )
{
ar(CEREAL_NVP(time_string_), CEREAL_NVP(time_stamp_), CEREAL_NVP(port), CEREAL_NVP(stbd), CEREAL_NVP(first_in_file_), CEREAL_NVP(heading_),
CEREAL_NVP(pitch_), CEREAL_NVP(roll_), CEREAL_NVP(lat_), CEREAL_NVP(long_), CEREAL_NVP(sound_vel_), CEREAL_NVP(pos_));
CEREAL_NVP(pitch_), CEREAL_NVP(roll_), CEREAL_NVP(lat_), CEREAL_NVP(long_), CEREAL_NVP(sound_vel_), CEREAL_NVP(altitude_), CEREAL_NVP(pos_));
}

EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Expand Down
3 changes: 3 additions & 0 deletions src/data_tools/src/xtf_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ xtf_sss_ping process_side_scan_ping(XTFPINGHEADER *PingHeader, XTFFILEHEADER *XT
ping.roll_ = M_PI/180.*PingHeader->SensorRoll;
ping.pitch_ = M_PI/180.*PingHeader->SensorPitch;
ping.sound_vel_ = PingHeader->SoundVelocity;
ping.altitude_ = PingHeader->SensorPrimaryAltitude;

boost::posix_time::ptime data_time(boost::gregorian::date(PingHeader->Year, PingHeader->Month, PingHeader->Day), boost::posix_time::hours(PingHeader->Hour)+boost::posix_time::minutes(PingHeader->Minute)+boost::posix_time::seconds(PingHeader->Second)+boost::posix_time::milliseconds(10*int(PingHeader->HSeconds)));
stringstream time_ss;
Expand Down Expand Up @@ -204,6 +205,8 @@ xtf_sss_ping process_side_scan_ping(XTFPINGHEADER *PingHeader, XTFFILEHEADER *XT
}
ping_channel->time_duration = ChanHeader->TimeDuration;
ping_channel->slant_range = ChanHeader->SlantRange;
ping_channel->gain_code = ChanHeader->GainCode;
ping_channel->initial_gain_code = ChanHeader->InitialGainCode;

// Do whatever processing on the sidescan imagery here.
//cout << "Processing a side scan ping!!" << endl;
Expand Down
5 changes: 4 additions & 1 deletion src/pydata_tools/src/pystd_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ PYBIND11_MODULE(std_data, m) {
.def_readwrite("slant_range", &std_data::sss_ping_side::slant_range, "Slant range")
.def_readwrite("time_duration", &std_data::sss_ping_side::time_duration, "Furthest measured intensity")
.def_readwrite("tilt_angle", &std_data::sss_ping_side::tilt_angle, "Tilt angle")
.def_readwrite("beam_width", &std_data::sss_ping_side::beam_width, "Beam width");
.def_readwrite("beam_width", &std_data::sss_ping_side::beam_width, "Beam width")
.def_readwrite("gain_code", &std_data::sss_ping_side::gain_code, "Gain code")
.def_readwrite("initial_gain_code", &std_data::sss_ping_side::initial_gain_code, "Initial gain code");

py::class_<std_data::sss_ping>(m, "sss_ping", "Class for xtf sidescan type")
.def(py::init<>())
Expand All @@ -82,6 +84,7 @@ PYBIND11_MODULE(std_data, m) {
.def_readwrite("lat_", &std_data::sss_ping::lat_, "Latitude")
.def_readwrite("long_", &std_data::sss_ping::long_, "Longitude")
.def_readwrite("sound_vel_", &std_data::sss_ping::sound_vel_, "Sound speed in m/s")
.def_readwrite("altitude_", &std_data::sss_ping::altitude_, "Sensor primary altitude in m")
.def_readwrite("pos_", &std_data::sss_ping::pos_, "Position in ENU coordinates")
.def_static("read_data", &read_data_from_str<std_data::sss_ping::PingsT>, "Read sss_ping::PingsT from .cereal file");

Expand Down
5 changes: 4 additions & 1 deletion src/pydata_tools/src/pyxtf_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ PYBIND11_MODULE(xtf_data, m) {
.def_readwrite("slant_range", &xtf_sss_ping_side::slant_range, "Slant range")
.def_readwrite("time_duration", &xtf_sss_ping_side::time_duration, "Furthest measured intensity")
.def_readwrite("tilt_angle", &xtf_sss_ping_side::tilt_angle, "Tilt angle")
.def_readwrite("beam_width", &xtf_sss_ping_side::beam_width, "Beam width");
.def_readwrite("beam_width", &xtf_sss_ping_side::beam_width, "Beam width")
.def_readwrite("gain_code", &xtf_sss_ping_side::gain_code, "Gain code")
.def_readwrite("initial_gain_code", &xtf_sss_ping_side::initial_gain_code, "Initial gain code");

py::class_<xtf_sss_ping>(m, "xtf_sss_ping", py::module_local(), "Class for xtf sidescan type")
.def(py::init<>())
Expand All @@ -44,6 +46,7 @@ PYBIND11_MODULE(xtf_data, m) {
.def_readwrite("lat_", &xtf_sss_ping::lat_, "Latitude")
.def_readwrite("long_", &xtf_sss_ping::long_, "Longitude")
.def_readwrite("sound_vel_", &xtf_sss_ping::sound_vel_, "Sound speed in m/s")
.def_readwrite("altitude_", &xtf_sss_ping::altitude_, "Sensor primary altitude in m")
.def_readwrite("pos_", &xtf_sss_ping::pos_, "Position in ENU coordinates")
.def_static("parse_file", &parse_file_from_str<xtf_sss_ping>, "Parse xtf_sss_ping from .xtf file")
.def_static("parse_folder", &parse_folder_from_str<xtf_sss_ping>, "Parse xtf_sss_ping from folder of .xtf files")
Expand Down