Class cNode

Class Documentation

class cNode

Represents a node, i.e. the useful part of an custom_msgs::ConeWithId (position and id).

Public Functions

cNode(const double &x, const double &y, const double &xGlobal, const double &yGlobal, const uint32_t &id)

Construct a new Node object.

Parameters:
  • x[in]

  • y[in]

  • xGlobal[in]

  • yGlobal[in]

  • id[in]

cNode(const ubm_interfaces::msg::Landmark &c)

Construct a new Node object from a custom_msgs::ConeWithId.

Parameters:

c[in]

const double &x() const

Returns the Node x local coordinate.

const double &y() const

Returns the Node y local coordinate.

bool operator==(const cNode &n) const

Comparison operator. Two nodes will be equal iff their id is same.

Parameters:

n[in]

bool operator!=(const cNode &n) const

Negation of the comparison operator.

Parameters:

n[in]

const bool &belongsToSuperTriangle() const

Checks if the Node belongs to a supertriangle.

void updateLocal(const Eigen::Affine3d &tf) const

Updates the local coordinates of the Node.

Parameters:

tf[in]

const Point &point() const

Returns the point in local coordinates.

const Point &pointGlobal() const

Returns the point in global coordinates.

double distSq(const Point &p) const

Returns the distance squared from the Node’s local point to p.

Parameters:

p[in]

double angleWith(const cNode &n0, const cNode &n1) const

Returns the angle that the Node makes with the Node(s) n0 and n1.

Parameters:
  • n0[in]

  • n1[in]

Public Members

const uint32_t id

Node’s id, in principle given by the cone tracker.

Public Static Functions

static cNode superTriangleNode(const double &x, const double &y)

Returns a supertriangle Node with local coordinates (x, y).

Parameters:
  • x[in]

  • y[in]

Friends

friend std::ostream &operator<<(std::ostream &os, const cNode &n)

Cout operator.

Parameters:
  • os[inout]

  • n[in]