66 lines
1.6 KiB
C++
66 lines
1.6 KiB
C++
![]() |
#pragma once
|
||
|
|
||
|
#include <string>
|
||
|
#include <geometry_msgs/msg/pose.hpp>
|
||
|
#include "scene_monitor_interfaces/msg/grasp_pose.hpp"
|
||
|
// #include "scene_monitor_interfaces/msg/bounding_box.hpp"
|
||
|
// #include "scene_monitor_interfaces/msg/principal_properties.hpp"
|
||
|
#include "nlohmann_json/json.hpp"
|
||
|
|
||
|
namespace component_state_monitor
|
||
|
{
|
||
|
|
||
|
using json = nlohmann::json;
|
||
|
|
||
|
/*
|
||
|
Description:
|
||
|
Initialized:
|
||
|
- state when model is initialized by provided metadata
|
||
|
Printed:
|
||
|
- model is ready for manipulation and other operations in sim/real
|
||
|
Posted:
|
||
|
- model is posted with another
|
||
|
*/
|
||
|
enum ComponentState
|
||
|
{
|
||
|
Initialized,
|
||
|
Printed,
|
||
|
Posted
|
||
|
};
|
||
|
|
||
|
class Component
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
Component();
|
||
|
Component(const std::string &frame_name);
|
||
|
|
||
|
ComponentState getCurrentState() const;
|
||
|
std::string getFrameName() const;
|
||
|
scene_monitor_interfaces::msg::GraspPose getGraspPose() const;
|
||
|
geometry_msgs::msg::Pose getPlacementPose() const;
|
||
|
|
||
|
void initializeFromJson(json &input);
|
||
|
/*
|
||
|
TODO
|
||
|
- create methods for get all recently needed component
|
||
|
from metadata class
|
||
|
*/
|
||
|
|
||
|
void updateState(const ComponentState &state);
|
||
|
|
||
|
|
||
|
private:
|
||
|
|
||
|
// float _volume;
|
||
|
std::string _frame_name;
|
||
|
ComponentState _current_state;
|
||
|
geometry_msgs::msg::Pose _placement;
|
||
|
// geometry_msgs::msg::Point _center_of_mass;
|
||
|
std::map<std::string, scene_monitor_interfaces::msg::GraspPose> _grasp_poses;
|
||
|
// scene_monitor_interfaces::msg::BoundingBox _bounding_box;
|
||
|
// scene_monitor_interfaces::msg::PrincipalProperties _principal_properties;
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|