diff --git a/crazyflie_py/crazyflie_py/crazyflie.py b/crazyflie_py/crazyflie_py/crazyflie.py index 025cac736..03055a8bc 100644 --- a/crazyflie_py/crazyflie_py/crazyflie.py +++ b/crazyflie_py/crazyflie_py/crazyflie.py @@ -45,7 +45,8 @@ class TimeHelper: When running on real hardware, this class uses ROS time functions. The simulation equivalent does not depend on ROS. - Attributes: + Attributes + ---------- visualizer: No-op object conforming to the Visualizer API used in simulation scripts. Maintains the property that scripts should not know/care if they are running in simulation or not. @@ -103,9 +104,10 @@ def __init__(self, node, cfname, paramTypeDict): Construct Crazyflie. Args: - node: ROS node reference. - cfname (string): Name of the robot names[ace]. - paramTypeDict: dictionary of the parameter types. + ---- + node: ROS node reference + cfname (string): Name of the robot names[ace] + paramTypeDict: dictionary of the parameter types """ prefix = '/' + cfname @@ -343,6 +345,7 @@ def goTo(self, goal, yaw, duration, relative=False, groupMask=0): controller to become unstable. Args: + ---- goal (iterable of 3 floats): The goal position. Meters. yaw (float): The goal yaw angle (heading). Radians. duration (float): How long until the goal is reached. Seconds. @@ -441,6 +444,7 @@ def notifySetpointsStop(self, remainValidMillisecs=100, groupMask=0): streaming setpoint modes. Args: + ---- remainValidMillisecs (int): Number of milliseconds that the last streaming setpoint should be followed before reverting to the onboard-determined behavior. May be longer e.g. if one radio @@ -499,6 +503,7 @@ def setParam(self, name, value): See :meth:`getParam()` docs for overview of the parameter system. Args: + ---- name (str): The parameter's name. value (Any): The parameter's value. @@ -542,6 +547,7 @@ def cmdFullState(self, pos, vel, acc, yaw, omega): :meth:`goTo()` after a streaming setpoint has been sent. Args: + ---- pos (array-like of float[3]): Position. Meters. vel (array-like of float[3]): Velocity. Meters / second. acc (array-like of float[3]): Acceleration. Meters / second^2. @@ -696,7 +702,8 @@ class CrazyflieServer(rclpy.node.Node): Also is the container for the individual :obj:`Crazyflie` objects. - Attributes: + Attributes + ---------- crazyfiles (List[Crazyflie]): List of one Crazyflie object per robot, as determined by the crazyflies.yaml config file. crazyfliesById (Dict[int, Crazyflie]): Index to the same Crazyflie @@ -866,6 +873,7 @@ def goTo(self, goal, yaw, duration, groupMask=0): See docstring of :meth:`Crazyflie.goTo()` for additional details. Args: + ---- goal (iterable of 3 floats): The goal offset. Meters. yaw (float): The goal yaw angle (heading). Radians. duration (float): How long until the goal is reached. Seconds. @@ -890,6 +898,7 @@ def startTrajectory(self, trajectoryId, Asynchronous command; returns immediately. Args: + ---- trajectoryId (int): ID number as given to :meth:`Crazyflie.uploadTrajectory()`. timescale (float): Scales the trajectory duration by this factor. For example if timescale == 2.0, the trajectory will take twice @@ -937,6 +946,7 @@ def cmdFullState(self, pos, vel, acc, yaw, omega): :meth:`goTo()` after a streaming setpoint has been sent. Args: + ---- pos (array-like of float[3]): Position. Meters. vel (array-like of float[3]): Velocity. Meters / second. acc (array-like of float[3]): Acceleration. Meters / second^2. diff --git a/crazyflie_py/crazyflie_py/util.py b/crazyflie_py/crazyflie_py/util.py index 2c201ff9c..602862b5b 100644 --- a/crazyflie_py/crazyflie_py/util.py +++ b/crazyflie_py/crazyflie_py/util.py @@ -10,10 +10,12 @@ def check_ellipsoid_collisions(positions, radii): Check for collisions between a set of ellipsoids at given positions. Args: + ---- positions (array float[n, 3]): The ellipsoid centers. radii (array float[3]): The radii of the axis-aligned ellipsoids. - Returns: + Returns + ------- colliding (array bool[n]): True at index i if the i'th ellipsoid intersects any of the other ellipsoids. @@ -36,11 +38,13 @@ def poisson_disk_sample(n, dim, mindist): TODO(jpreiss): find/implement a library with a fast algorithm. Args: + ---- n (int): Number of points. dim (int): Dimensionality of points. mindist (float): Minimum Euclidean distance between any two points. - Returns: + Returns + ------- pts (array float[n, dim]): The sampled points. """ diff --git a/crazyflie_py/test/test_pep257.py b/crazyflie_py/test/test_pep257.py index bd90b5f8e..b234a3840 100644 --- a/crazyflie_py/test/test_pep257.py +++ b/crazyflie_py/test/test_pep257.py @@ -19,5 +19,5 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257(): - rc = main(argv=['.', 'test', '--add-ignore', 'D406', 'D407', 'D417']) + rc = main(argv=['.', 'test']) assert rc == 0, 'Found code style errors / warnings' diff --git a/docs2/howto.rst b/docs2/howto.rst index 7c214d872..abdeecc1c 100644 --- a/docs2/howto.rst +++ b/docs2/howto.rst @@ -90,15 +90,4 @@ To close the logblocks again, run: .. code-block:: bash ros2 service call /cf2/remove_logging crazyflie_interfaces/srv/RemoveLogging "{topic_name: 'topic_test'}" - ros2 service call /cf2/remove_logging crazyflie_interfaces/srv/RemoveLogging "{topic_name: 'pose'}" - -Run Tests Locally ------------------ - -This requires some updated pip packages for testing, see https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html, otherwise the reported failures will be inconsistent with CI. - -Then execute: - -``` -colcon test --event-handlers=console_cohesion+ --return-code-on-test-failure --packages-select crazyflie_py -``` + ros2 service call /cf2/remove_logging crazyflie_interfaces/srv/RemoveLogging "{topic_name: 'pose'}" \ No newline at end of file