Skip to content

Commit

Permalink
pybind: WIP updating pybind with new changes to rangerbase
Browse files Browse the repository at this point in the history
  • Loading branch information
karthee-weston committed Oct 9, 2024
1 parent 1021299 commit 6e4c791
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python/ugv_sdk_py/src/ranger_robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -99,8 +98,8 @@ void BindRangerRobot(pybind11::module &m) {

// RangerRobot class
py::class_<RangerRobot>(m_ranger_robot, "RangerRobot")
.def(py::init<bool>(),
py::arg("is_mini_v1") = false,
.def(py::init<Variant>(),
py::arg("variant"),
"Constructor for RangerRobot with model version")
.def("connect", &RangerRobot::Connect,
py::arg("can_name"),
Expand Down Expand Up @@ -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_<RangerRobot::Variant>(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

0 comments on commit 6e4c791

Please sign in to comment.