MCPcopy Create free account
hub / github.com/InternRobotics/OpenHomie / JoystickStep

Method JoystickStep

HomieDeploy/unitree_sdk2/g1_control.cpp:335–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333 }
334
335 void JoystickStep() {
336 {
337 std::lock_guard<std::mutex> lock(joystick_mutex);
338 gamepad.Update(joystick_msg);
339 }
340
341 rc_command.left_stick[0] = gamepad.lx;
342 rc_command.left_stick[1] = gamepad.ly; // +up is 1, +right is 0
343 rc_command.right_stick[0] = gamepad.rx;
344 rc_command.right_stick[1] = gamepad.ry;
345 rc_command.right_lower_right_switch = gamepad.R2.pressed;
346
347 _simpleLCM.publish("rc_command", &rc_command);
348 }
349
350 void Control() {
351 // set rpy of observation; for projected gravity later

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected