Skip to content

Commit

Permalink
reformat python code with black
Browse files Browse the repository at this point in the history
  • Loading branch information
vooon committed Sep 9, 2023
1 parent db34cf6 commit b705cfd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
1 change: 0 additions & 1 deletion mavros/mavros/mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class QGroundControlPlan(PlanFile):


class MissionPluginBase(PluginModule):

_plugin_ns = "mission"
_plugin_list_topic = "waypoints"

Expand Down
3 changes: 0 additions & 3 deletions mavros/test/mavros_py/test_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def test_ParamDict_set():
)

with patch("mavros.utils.call_set_parameters", MagicMock(return_value={})) as csp:

pm.TEST_B = True
pm.TEST_I = 3
pm.TEST_F = 4.0
Expand All @@ -71,7 +70,6 @@ def test_ParamDict_set():
assert pm.TEST_F.value == 4.0

with patch("mavros.utils.call_set_parameters", MagicMock(return_value={})) as csp:

pm.setdefault("TEST_D", 5)

csp.assert_not_called()
Expand Down Expand Up @@ -164,7 +162,6 @@ def test_ParamFile_load(file_class, file_name, expected_len):
],
)
def test_ParamFile_save(file_class, expected_output):

pf = file_class()
pf.parameters = SAVE_PARAMS
pf.tgt_system = 2
Expand Down
22 changes: 9 additions & 13 deletions test_mavros/scripts/test_mavlink_convert_to_rosmsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,21 @@
DRONE_NO = 1
TOPIC_MAVLINK = f"/uas{DRONE_NO}/mavlink_sink"


class fifo(object):
""" A simple buffer """
"""A simple buffer"""

def __init__(self):
self.buf = []

def write(self, data):
self.buf += data
return len(data)

def read(self):
return self.buf.pop(0)


class MyNode(Node):
def __init__(self) -> None:
node_name = "mav_writer"
Expand All @@ -62,19 +67,9 @@ def __init__(self) -> None:
def set_home(self) -> None:
target_system = 0 # broadcast to everyone
msg = ardupilotmega.MAVLink_command_long_message(
target_system,
1,
ardupilotmega.MAV_CMD_DO_SET_HOME,
0,
0,
0,
0,
0,
0,
0,
0
target_system, 1, ardupilotmega.MAV_CMD_DO_SET_HOME, 0, 0, 0, 0, 0, 0, 0, 0
)

msg.pack(self.__mav)
current = Clock().now()
sec, nanosec = current.seconds_nanoseconds()
Expand All @@ -83,6 +78,7 @@ def set_home(self) -> None:
self.__pub_mavlink.publish(ros_msg)
print(ros_msg)


def main(args=None):
rclpy.init(args=args)
node = MyNode()
Expand Down

0 comments on commit b705cfd

Please sign in to comment.