Skip to content

Commit

Permalink
Merge pull request #15 from shadow-robot/Fix_object_pose
Browse files Browse the repository at this point in the history
Fix object pose by removing redundant z_min correction.
  • Loading branch information
awesomebytes committed Apr 14, 2014
2 parents 7731317 + a107a36 commit af53f43
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/object/ObjectRecognizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ struct ObjectRecognizer : public object_recognition_core::db::bases::ModelReader
for (size_t i = 0; i < mesh_msg.vertices.size(); ++i)
mesh_msg.vertices[i].z -= min_z;

min_z_[document.get_field<std::string>("object_id")] = min_z;

object_recognizer_.addObject(template_db_id, mesh_msg);

std::cout << std::endl;
Expand Down Expand Up @@ -339,7 +337,7 @@ struct ObjectRecognizer : public object_recognition_core::db::bases::ModelReader
// Add the pose
const geometry_msgs::Pose &pose = result.pose_;
cv::Vec3f T(pose.position.x, pose.position.y, pose.position.z);
T[2] -= min_z_[object_id];

Eigen::Quaternionf quat(pose.orientation.w, pose.orientation.x, pose.orientation.y, pose.orientation.z);

cv::Vec3f new_T = rotations[table_index] * T + translations[table_index];
Expand Down Expand Up @@ -392,8 +390,6 @@ struct ObjectRecognizer : public object_recognition_core::db::bases::ModelReader
ecto::spore<std::string> tabletop_object_ids_;
/** map to convert from artificial household id to db id */
std::map<size_t, std::string> household_id_to_db_id_;
/** for each DB id, store the minimum z */
std::map<std::string, double> min_z_;
};
}

Expand Down

0 comments on commit af53f43

Please sign in to comment.