Skip to content

Commit

Permalink
disable pep257 checks that are not applicable for us
Browse files Browse the repository at this point in the history
  • Loading branch information
whoenig committed Oct 23, 2023
1 parent 92664ff commit a0a5d53
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
20 changes: 5 additions & 15 deletions crazyflie_py/crazyflie_py/crazyflie.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ 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.
Expand Down Expand Up @@ -104,10 +103,9 @@ 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
Expand Down Expand Up @@ -345,7 +343,6 @@ 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.
Expand Down Expand Up @@ -444,7 +441,6 @@ 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
Expand Down Expand Up @@ -503,7 +499,6 @@ 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.
Expand Down Expand Up @@ -547,7 +542,6 @@ 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.
Expand Down Expand Up @@ -702,8 +696,7 @@ 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
Expand Down Expand Up @@ -873,7 +866,6 @@ 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.
Expand All @@ -898,7 +890,6 @@ 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
Expand Down Expand Up @@ -946,7 +937,6 @@ 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.
Expand Down
8 changes: 2 additions & 6 deletions crazyflie_py/crazyflie_py/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ 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.
Expand All @@ -38,13 +36,11 @@ 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.
"""
Expand Down
2 changes: 1 addition & 1 deletion crazyflie_py/test/test_pep257.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
@pytest.mark.linter
@pytest.mark.pep257
def test_pep257():
rc = main(argv=['.', 'test'])
rc = main(argv=['.', 'test', '--add-ignore', 'D406', 'D407', 'D417'])
assert rc == 0, 'Found code style errors / warnings'
13 changes: 12 additions & 1 deletion docs2/howto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,15 @@ 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'}"
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
```

0 comments on commit a0a5d53

Please sign in to comment.