SMACC2
Loading...
Searching...
No Matches
cl_rgb::CpTablePlane Class Reference

#include <cp_table_plane.hpp>

Inheritance diagram for cl_rgb::CpTablePlane:
Inheritance graph
Collaboration diagram for cl_rgb::CpTablePlane:
Collaboration graph

Public Member Functions

 CpTablePlane (const TableParams &params)
 
 ~CpTablePlane () override
 
const TableParams & params () const
 
std::optional< cv::Vec3d > pointUnderPixel (const PinholeCamera &camera, double u, double v, double heightAboveTable=0.0) const
 
cv::Mat regionMask (const PinholeCamera &camera, const cv::Size &size) const
 
bool contains (double x, double y, double margin=0.0) const
 
- Public Member Functions inherited from smacc2::ISmaccComponent
 ISmaccComponent ()
 
virtual ~ISmaccComponent ()
 
 ISmaccComponent (const ISmaccComponent &)=delete
 
ISmaccComponent & operator= (const ISmaccComponent &)=delete
 
 ISmaccComponent (ISmaccComponent &&)=delete
 
ISmaccComponent & operator= (ISmaccComponent &&)=delete
 
virtual std::string getName () const
 

Private Attributes

TableParams params_
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::ISmaccComponent
virtual void onInitialize ()
 
template<typename TOrthogonal , typename TClient >
void onComponentInitialization ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
template<typename TOrthogonal , typename TSourceObject >
void onStateOrthogonalAllocation ()
 
template<typename TComponent >
void requiresComponent (TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
 
template<typename TComponent >
void requiresComponent (const std::string &name, TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
 
template<typename TClient >
void requiresClient (TClient *&requiredClientStorage)
 
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * createSiblingComponent (const TArgs &... targs)
 
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * createSiblingNamedComponent (const std::string &name, const TArgs &... targs)
 
rclcpp::Node::SharedPtr getNode ()
 
rclcpp::Logger getLogger () const
 
ISmaccStateMachine * getStateMachine ()
 
- Protected Attributes inherited from smacc2::ISmaccComponent
ISmaccStateMachine * stateMachine_ = nullptr
 
ISmaccClient * owner_ = nullptr
 

Detailed Description

Definition at line 29 of file cp_table_plane.hpp.

Constructor & Destructor Documentation

◆ CpTablePlane()

cl_rgb::CpTablePlane::CpTablePlane ( const TableParams & params)
explicit

Definition at line 21 of file cp_table_plane.cpp.

21: params_(params) {}
const TableParams & params() const

◆ ~CpTablePlane()

cl_rgb::CpTablePlane::~CpTablePlane ( )
override

Definition at line 23 of file cp_table_plane.cpp.

23{}

Member Function Documentation

◆ contains()

bool cl_rgb::CpTablePlane::contains ( double x,
double y,
double margin = 0.0 ) const

Definition at line 36 of file cp_table_plane.cpp.

37{
38 return x >= params_.xMin + margin && x <= params_.xMax - margin && y >= params_.yMin + margin &&
39 y <= params_.yMax - margin;
40}

References params_, cl_rgb::TableParams::xMax, cl_rgb::TableParams::xMin, cl_rgb::TableParams::yMax, and cl_rgb::TableParams::yMin.

◆ params()

const TableParams & cl_rgb::CpTablePlane::params ( ) const
inline

Definition at line 35 of file cp_table_plane.hpp.

35{ return params_; }

References params_.

Referenced by cl_rgb::CbSurveyTable::onEntry().

Here is the caller graph for this function:

◆ pointUnderPixel()

std::optional< cv::Vec3d > cl_rgb::CpTablePlane::pointUnderPixel ( const PinholeCamera & camera,
double u,
double v,
double heightAboveTable = 0.0 ) const

Definition at line 25 of file cp_table_plane.cpp.

27{
28 return camera.pixelToPlane(u, v, params_.height + heightAboveTable);
29}

References cl_rgb::TableParams::height, params_, and cl_rgb::PinholeCamera::pixelToPlane().

Here is the call graph for this function:

◆ regionMask()

cv::Mat cl_rgb::CpTablePlane::regionMask ( const PinholeCamera & camera,
const cv::Size & size ) const

Definition at line 31 of file cp_table_plane.cpp.

32{
33 return tableRegionMask(camera, size, params_);
34}
cv::Mat tableRegionMask(const PinholeCamera &camera, const cv::Size &size, const TableParams &table)

References params_, and cl_rgb::tableRegionMask().

Referenced by cl_rgb::CbSurveyTable::onEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ params_

TableParams cl_rgb::CpTablePlane::params_
private

Definition at line 49 of file cp_table_plane.hpp.

Referenced by contains(), params(), pointUnderPixel(), and regionMask().


The documentation for this class was generated from the following files: