From 3adf799d6be1401b9dc7d1266ec143be1e0b424c Mon Sep 17 00:00:00 2001 From: Rooholla-KhorramBakht Date: Thu, 8 Feb 2024 22:56:11 -0500 Subject: [PATCH] EStop logic is improved --- deploy/robot_ws/src/go2py_node/src/bridge.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/robot_ws/src/go2py_node/src/bridge.cpp b/deploy/robot_ws/src/go2py_node/src/bridge.cpp index 8b81577..fd4aa12 100644 --- a/deploy/robot_ws/src/go2py_node/src/bridge.cpp +++ b/deploy/robot_ws/src/go2py_node/src/bridge.cpp @@ -177,12 +177,14 @@ void Custom::lowstate_callback(unitree_go::msg::LowState::SharedPtr data) } pub_joint->publish(joint_state); pub_imu->publish(imu); + // Check for emergency stop memcpy(&_keyData, &data->wireless_remote[0], 40); if (_keyData.btn.components.R2 == 1 && _keyData.btn.components.L2 == 1) { Estop = 1; } - if (_keyData.btn.components.R1 == 1 && _keyData.btn.components.L1 == 1) + if ((_keyData.btn.components.R1 == 1 && _keyData.btn.components.L1 == 1)|| + (_keyData.btn.components.L2 == 1 && _keyData.btn.components.A == 1)) { Estop = 0; }