-
Notifications
You must be signed in to change notification settings - Fork 2
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
Milestone 3: Synthetic Optimization #11
base: camera_class_and_detections
Are you sure you want to change the base?
Milestone 3: Synthetic Optimization #11
Conversation
Switching back to "camera_class_and_detections" To make changes to mileston
…ana/robot_camera_calibration into synthetic_optimization
...but I don't know why... Transform hacks required. NB: pixel points no longer casted to int in camera.yaml
and this time on purpose!!! Thanks to Vijay's, Kiran's and Sarika's input. Major refactoring required before PR.
Need to test with real data.
Need to introduce code to deal with models.
Need to code YAML output.
…obot_camera_calibration into synthetic_optimization
rviz_simulator/include/rviz_simulator/camera_calibration_optimizer.h
Outdated
Show resolved
Hide resolved
Need to fix camera yaml output.
Included <camera_calibration_parsers/parse.h> Still some code refactoring to be done.
Following optimization, pixel coordinates of corner points are recalculated and added to YAML output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First half finished. Will review from rviz_simulator/src/camera_calibration_optimizer.cpp
tomorrow.
rviz_simulator/CMakeLists.txt
Outdated
@@ -165,22 +185,54 @@ include_directories(include | |||
## add_executable(one_marker src/one_marker.cpp) | |||
## target_link_libraries(one_marker ${catkin_LIBRARIES}) | |||
|
|||
FIND_PACKAGE(yaml-cpp REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this FIND_PACKAGE different than the calls above? If not, you should just use one version and also group these above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll address all CMakeList.txt
-related comments in a separate PR after milestone 3 is merged, since the CMakeList.txt
file from milestone 2 is the same file in milestone 3 (which is a branch of 2) and changing the file in one branch and merging with the other may result in merge conflicts.
rviz_simulator/CMakeLists.txt
Outdated
FIND_PACKAGE(yaml-cpp REQUIRED) | ||
|
||
|
||
# simulate | ||
add_executable(simulate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Maybe for readability group all similar declarations together. Example:
add_executable(exe1 path_to_exe1)
add_executable(exe2 path_to_exe2)
...
add_library(lib1 lib1_files)
add_library(lib2 lib2_files)
target_link_libraries(exe1 lib1 other_addtional_libs ...)
target_link_libraries(exe2 lib2 lib1 other_addtional_libs ...)
rviz_simulator/CMakeLists.txt
Outdated
@@ -216,4 +268,4 @@ target_link_libraries(simulate | |||
# # myfile1 | |||
# # myfile2 | |||
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | |||
# ) | |||
# ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new line here
rviz_simulator/CMakeLists.txt
Outdated
@@ -1,21 +1,37 @@ | |||
# CERES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should look at removing any irrelevant or stale comments.
rviz_simulator/src/camera.cpp
Outdated
detections_out << YAML::Value << YAML::BeginSeq; // detections sequence | ||
|
||
// processing all camera_T_target transforms | ||
for (int i = 0; i < this->world_T_targets_.size(); i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the iterating options of a vector to iterate over the targets
either
https://en.cppreference.com/w/cpp/container/vector
for (int i = 0; i < this->world_T_targets_.size(); i++) | |
for (Eigen::Affine3d world_T_target : this->world_T_targets_) |
or
http://www.cplusplus.com/reference/vector/vector/begin/
for (int i = 0; i < this->world_T_targets_.size(); i++) | |
for (std::vector<Eigen::Affine3d>::iterator it = this->world_T_targets_.begin() ; it != this->world_T_targets_.end(); ++it) | |
rviz_simulator/src/camera.cpp
Outdated
for (int i = 0; i < this->world_T_targets_.size(); i++) | ||
{ | ||
// getting camera_T_target | ||
Eigen::Affine3d camera_T_target = world_T_camera.inverse() * this->world_T_targets_[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the iterator above this can become Eigen::Affine3d camera_T_target = world_T_camera.inverse() * (*it);
or something like this
rviz_simulator/src/camera.cpp
Outdated
differences.push_back(corners[1] - corners[3]); | ||
differences.push_back(corners[0] - corners[2]); | ||
|
||
for (int i = 0; i < differences.size(); i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar note to iterate through the vectors from above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments In line but looks like you have the right idea for stuff.
for (YAML::const_iterator target_iterator = targets_node["targets"].begin(); | ||
target_iterator != targets_node["targets"].end(); ++target_iterator) | ||
{ | ||
const YAML::Node& target_node = *target_iterator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This declaration infers that the value in target_iterator
is of const
value and since we are treating this value as read_only we should just use the target_iterator alone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: Just realized that this is okay to do but I think you should use the iterator instead of introducing a new variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it this way to make the code simpler/more readable, will consider changing it.
Target target; | ||
|
||
// targetID | ||
target.targetID = target_node["targetID"].as<int>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the change above:
target.targetID = target_node["targetID"].as<int>(); | |
target.targetID = target_iterator->operator[]("targetID").as<int>(); |
or
target.targetID = target_node["targetID"].as<int>(); | |
target.targetID = (*target_iterator)["targetID"].as<int>(); |
…ana/robot_camera_calibration into synthetic_optimization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed Shivan's comments
|
||
where the `detections_directory_name` is a directory of camera, targets and detection yaml files in the `rviz_simulator` package directory. | ||
|
||
The output is written to a folder labelled "`optimized`" which is created in the `detections_directory_name` folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...wut?
for (YAML::const_iterator target_iterator = targets_node["targets"].begin(); | ||
target_iterator != targets_node["targets"].end(); ++target_iterator) | ||
{ | ||
const YAML::Node& target_node = *target_iterator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it this way to make the code simpler/more readable, will consider changing it.
Write an application that uses the ceres-solver optimization library to compute the camera’s intrinsic parameters, camera’s poses, and the fiducial poses. The optimization will use the following data
Input Data:
Variable Parameters (Each parameter will need an initial guess)
Constants: