From 6e4c79102640d1d4b98c3ab1ee9775d1bcc89ea0 Mon Sep 17 00:00:00 2001 From: karthee-weston Date: Wed, 9 Oct 2024 15:52:59 +0800 Subject: [PATCH] pybind: WIP updating pybind with new changes to rangerbase --- python/ugv_sdk_py/src/ranger_robot.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python/ugv_sdk_py/src/ranger_robot.cpp b/python/ugv_sdk_py/src/ranger_robot.cpp index 56b1959d..81abb8fd 100644 --- a/python/ugv_sdk_py/src/ranger_robot.cpp +++ b/python/ugv_sdk_py/src/ranger_robot.cpp @@ -13,7 +13,6 @@ namespace py = pybind11; namespace westonrobot { - // clang-format off void BindRangerRobot(pybind11::module &m) { py::module_ m_ranger_robot = m.def_submodule("ranger_robot"); @@ -99,8 +98,8 @@ void BindRangerRobot(pybind11::module &m) { // RangerRobot class py::class_(m_ranger_robot, "RangerRobot") - .def(py::init(), - py::arg("is_mini_v1") = false, + .def(py::init(), + py::arg("variant"), "Constructor for RangerRobot with model version") .def("connect", &RangerRobot::Connect, py::arg("can_name"), @@ -138,6 +137,13 @@ void BindRangerRobot(pybind11::module &m) { "Get the actuator state") .def("get_common_sensor_state", &RangerRobot::GetCommonSensorState, "Get the common sensor state"); + + py::enum_(m_ranger_robot, "Variant") + .value("kRangerMiniV1", Variant::kRangerMiniV1) + .value("kRangerMiniV2", Variant::kRangerMiniV2) + .value("kRangerMiniV3", Variant::kRangerMiniV3) + .value("kRanger", Variant::kRanger) + .export_values() } // clang-format on } // namespace westonrobot \ No newline at end of file