-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Pose estimator enhancement * Add cpp classes in perception * clean up hancks for demo * update CHANGELOG.md * add a new class DetectedObject and update PoseEstimatorModule * minor fixes * remove the projection height from PoseEstimatorModule * document DetectedObject class * change 'id' -> 'uid' * Update include/aikido/perception/DetectedObject.hpp Co-Authored-By: yskim041 <[email protected]> * Update include/aikido/perception/DetectedObject.hpp Co-Authored-By: yskim041 <[email protected]> * Update include/aikido/perception/DetectedObject.hpp Co-Authored-By: yskim041 <[email protected]> * change the way to parse a Marker message * Allow nullptr for detectedObjects argument * Added robustness against bad YAML strings, plus more easily-parse-able UIDs * Fixed documentation per comments, tested with simple_perception in ada_demos * Added default argument to detectedObjects. * Fixed comments on pull request * Indigo compatibility (no DELETEALL) * Apply suggestions from code review Added non-refactor changes from Brian Co-Authored-By: egordon <[email protected]> * Applied comments from PR review: refactored ObjectDatabase to AssetDatabase * Clang formatted * Fixed PR comments. * Move vector push to end of for loop * Final PR nits.
- Loading branch information
Showing
10 changed files
with
312 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include "perception/AprilTagsDatabase.hpp" | ||
#include "perception/AprilTagsModule.hpp" | ||
#include "perception/AssetDatabase.hpp" | ||
#include "perception/DetectedObject.hpp" | ||
#include "perception/PerceptionModule.hpp" | ||
#include "perception/YamlAprilTagsDatabase.hpp" | ||
#include "perception/PoseEstimatorModule.hpp" | ||
#include "perception/VoxelGridModule.hpp" | ||
#include "perception/shape_conversions.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#ifndef AIKIDO_PERCEPTION_DETECTEDOBJECT_HPP_ | ||
#define AIKIDO_PERCEPTION_DETECTEDOBJECT_HPP_ | ||
|
||
#include <string> | ||
#include "aikido/io/yaml.hpp" | ||
|
||
namespace aikido { | ||
namespace perception { | ||
|
||
/// DetectedObject delegates a detected object from a third-party | ||
/// perception algorithm. | ||
|
||
/// A perception algorithm should send information for an object via ROS | ||
/// visualization_msgs/Marker message like the following: | ||
/// Marker.ns + "_" + Marker.id -> uid (identity in planner::World) | ||
/// Marker.ns -> assetKey (determines visual asset, \see AssetDatabase) | ||
/// Marker.header.frame_id -> detectionFrameID | ||
/// Marker.text -> yamlStr | ||
|
||
/// yamlStr contains any additional information in YAML format. | ||
/// It also can overwrite the Asset Database Key | ||
/// using "db_key". (\see AssetDatabase for details) | ||
/// Here is an example: | ||
/// \code | ||
/// { | ||
/// "db_key": "food_item", | ||
/// "score": 0.9, | ||
/// "success_rates": [0.4, 0.9, 0.1, 0.2], | ||
/// "strategies": ["vertical_0", "vertical_90", "tilted_0", "tilted_90"], | ||
/// } | ||
/// \endcode | ||
|
||
class DetectedObject | ||
{ | ||
public: | ||
/// Construct a \c DetectedObject | ||
/// \param[in] uid Unique ID for object in Aikido world. Same UID -> Same | ||
/// Object | ||
/// \param[in] assetKey Key for AssetDatabase passed into constructor of | ||
/// PoseEstimatorModule. Defines visuals / assets. | ||
/// \param[in] detectionFrameID Frame ID from ROS Marker | ||
/// \param[in] yamlStr String of additional parameters for object. Can | ||
/// override objAssetDBKey by specifying "db_key". | ||
DetectedObject( | ||
const std::string& uid, | ||
const std::string& assetKey, | ||
const std::string& detectionFrameID, | ||
const std::string& yamlStr); | ||
|
||
virtual ~DetectedObject() = default; | ||
|
||
/// Get the unique id of the object | ||
std::string getUid(); | ||
|
||
/// Get the object key for \c AssetDatabase | ||
std::string getAssetKey(); | ||
|
||
/// Get the detection frame id that refers the origin of this object's pose | ||
std::string getDetectionFrameID(); | ||
|
||
/// Get the map of keys to additional informations | ||
YAML::Node getYamlNode(); | ||
|
||
/// Get a specific value from the information map by a key and the typename | ||
/// of the field | ||
/// \param[in] key The key (string) of a field in the information map | ||
/// Sequence types (e.g. [1, 2]) can be read into standard containers (e.g. | ||
/// std::vector<double>) | ||
/// Map types are not supported with this function. Please get the manually | ||
/// with getYamlNode(). | ||
template <typename T> | ||
T getInfoByKey(const std::string& key); | ||
|
||
private: | ||
/// The unique id of the object | ||
std::string mUid; | ||
|
||
/// The object key for \c AssetDatabase | ||
std::string mAssetKey; | ||
|
||
/// The detection frame id that refers the origin of this object's pose | ||
std::string mDetectionFrameID; | ||
|
||
/// The information map with additional information of this object | ||
YAML::Node mYamlNode; | ||
}; | ||
|
||
} // namespace perception | ||
} // namespace aikido | ||
|
||
#endif // AIKIDO_PERCEPTION_DETECTEDOBJECT_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.