diff --git a/test/test_type_database.py b/test/test_type_database.py index 6979111a..f52aba70 100644 --- a/test/test_type_database.py +++ b/test/test_type_database.py @@ -141,3 +141,20 @@ def check(name: str, md5sum_expected: str) -> None: check('mavros_msgs/State', '9e3d873fae342c8f48a8bd64c53d991e') check('mavros_msgs/Mavlink', '6dd71a38b8541fdc2de89a548c7dbc2f') check('rosgraph_msgs/Log', 'acffd30cd6b6de30f120938c17c593fb') + + +def test_encode_and_decode(): + db_type = load_mavros_type_db() + Waypoint = db_type['mavros_msgs/Waypoint'] + wp = Waypoint(frame=3, + command=82, + is_current=False, + autocontinue=True, + param1=2.545384369178356, + param2=0.0, + param3=0.0, + param4=0.0, + x_lat=-35.36326497378809, + y_long=149.1652387253908, + z_alt=3.45551165104657) + assert wp == Waypoint.decode(wp.encode())