fqdemo_nodes.PySubPub module

class fqdemo_nodes.PySubPub.PySubPub(*args: Any, **kwargs: Any)

Bases: rclpy.node.Node

Node to simulate a sample filter to an incoming topic, publishing result.

# Main documentation for this ROS2 node

Listens for a message with a number and power. Publishes a message with that number to that power, and to that root. Part of a demonstration of a ROS2 package with supporting quality features.

## Node Name: py_node

## Topics Subscribed: - @b num_power (type @b fqdemo_msgs.msg.NumPwrData)

## Topics Published: - @b power_result (type @b fqdemo_msgs.msg.NumPwrResult)

## Class API

static apply_powers(number, exponent)

! Given a number and an exponent, calculate its power and root. @param number Base value to take to a power or root @param exponent Value to use as exponent for power or root @return -> tuple(float, float) Result of (pow(number, exponent), pow(number, 1./exponent))

run()

! main program for the node

topic_callback(msg: fqdemo_msgs.msg.NumPwrData)

! callback for subscription to num_power