-
Notifications
You must be signed in to change notification settings - Fork 5
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
Initial Bonn Integration #18
Conversation
Adds rules for downloading and processing the Bonn RGB-D Dynamic Dataset
Based off TUM implementation due to documentation mentioning "The sequences are in the same format as the TUM RGB-D Dataset, so that the same evaluation tools can be used." Regex was adapted to handle scientific values found in some of the Bonn groundtruth.txt files. A few Bonn depth.txt files referenced depth images that do not exist, when this happens the specific file is logged to console and that depth frame is dropped.
Provide direct access to intrinsic / distortion parameter instead of copying them.
Need some feedback on a design approach: I am tidying up the way regex is used across Bonn Method A:const std::string& t = RegexPattern::timestamp;
const std::string& w = RegexPattern::whitespace;
const std::string& n = RegexPattern::number;
const std::string& start = RegexPattern::start;
const std::string& end = RegexPattern::end;
// format: timestamp tx ty tz qx qy qz qw
std::vector<std::string> expression{start,
t, w, // timestamp
n, w, // tx
n, w, // ty
n, w, // tz
n, w, // qx
n, w, // qy
n, w, // qz
n, end}; // qw
boost::regex expr = boost::regex(std::accumulate(expression.begin(), expression.end(), std::string())); Instead of vector + accumulate these could be combined value the + operator. Method B:// format: timestamp tx ty tz qx qy qz qw
std::vector<std::string> expression2{RegexPattern::start,
RegexPattern::timestamp, RegexPattern::whitespace, // timestamp
RegexPattern::number, RegexPattern::whitespace, // tx
RegexPattern::number, RegexPattern::whitespace, // ty
RegexPattern::number, RegexPattern::whitespace, // tz
RegexPattern::number, RegexPattern::whitespace, // qx
RegexPattern::number, RegexPattern::whitespace, // qy
RegexPattern::number, RegexPattern::whitespace, // qz
RegexPattern::number, RegexPattern::end}; // qw
boost::regex expr = boost::regex(std::accumulate(expression.begin(), expression.end(), std::string())); The main difference is having a copy for clarity and avoiding repeating RegexPattern too many times. @mihaibujanca what do you think? |
Slightly simpler: const std::string& t = RegexPattern::timestamp;
const std::string& w = RegexPattern::whitespace;
const std::string& n = RegexPattern::number;
const std::string& start = RegexPattern::start;
const std::string& end = RegexPattern::end;
// format: timestamp tx ty tz qx qy qz qw
std::string expr = start
+ t + w // timestamp
+ n + w // tx
+ n + w // ty
+ n + w // tz
+ n + w // qx
+ n + w // qy
+ n + w // qz
+ n + end; // qw
boost::regex groundtruth = boost::regex(expr); |
I quite like this. Perhaps also a midway between clarity and simplicity is using "time" or "ts" instead of "t" and "num" instead of "n"? |
Cool I'll go for that - saves the unnecessary use of vector and accumulate, and I agree about the names!! |
Regex literals pulled out into a class in data-tools for reuse and cleaner code.
Good job! Perhaps one suggestion would be moving It might seem a bit overkill when there's just one file in the directory but we don't know what else we might add there in the future (e.g perhaps the loadDatasetSensor kind of functions?) |
Yeah sure, that makes sense – I'm working on the refactoring / other utils in another branch called |
Happy for this to be merged whenever you're done with it, nicely done! |
Integrating Bonn RGB-D Dynamic Dataset into SLAMBench.
Added as WIP to allow better viablity.
Will submit PR after tidying up the new approach to regex!