NDHANA94 / hyperdog_ros2

HyperDog is a quadruped robot which is fully based on ROS 2 and Micro-ROS
MIT License
67 stars 17 forks source link

hyperdog gazebo teleop commands #2

Closed atticusrussell closed 12 months ago

atticusrussell commented 1 year ago

What commands you use in particular to use the gamepad to control the hyperdog gazebo sim? I have used: ros2 launch hyperdog_gazebo_sim hyperdog_gazebo_sim.launch.py followed by ros2 launch hyperdog_teleop hyperdog_teleop.launch.py but am not sure how to get the hyperdog to be controlled by the gamepad. Am I missing any steps? It currently is just spawned stationary in Gazebo.

NDHANA94 commented 1 year ago

Hi! Please refer to the paper https://arxiv.org/abs/2209.09171

If you will find any difficulty, please write me back.

NDHANA94 commented 1 year ago

Do not forget to increase step height before start walking by pressing the LB button + D pad up buttons.

atticusrussell commented 1 year ago

~Thank you for your prompt reply. I don't see anywhere that describes what effect buttons on the controller have on the simulation. Could you point me towards such a thing? Reading your linked paper, I am only running ros2 launch hyperdog_gazebo_sim hyperdog_gazebo_sim.launch.py and am trying to make the robot move.~

I apologize - I completely missed the graphic in the paper that labels everything and just saw it. I will try that now.

atticusrussell commented 1 year ago

I have played around with it a bit and from what I can tell I should have two terminals open: ros2 launch hyperdog_gazebo_sim hyperdog_gazebo_sim.launch.py and then in a second terminal ros2 launch hyperdog_teleop hyperdog_teleop.launch.py, which I focus on and use my xbox controller in to control the robot. I had a 3rd terminal open running ros2 topic echo /hyperdog_joy_ctrl_cmd and could see (for example)

---

states:
- true
- true
- false
gait_type: 1
pose:
  position:
    x: 76.48280441435054
    y: -100.0
    z: 250.0
  orientation:
    x: 0.0
    y: -0.013685141690075397
    z: 0.0
    w: 1.0
gait_step:
  x: -0.0
  y: 0.0
  z: 90.0
---

I was able to change the states using the start, select, and right thumbstick button, and the z of the gait with the left button + D pad up buttons, but didn't see any of this reflected in the gazebo sim. Could you walk me through what buttons I should need to press on the controller to get the robot going?

The following is the output of the gazebo_sim

$ ros2 launch hyperdog_gazebo_sim hyperdog_gazebo_sim.launch.py
[INFO] [launch]: All log files can be found below /home/atticus/.ros/log/2023-02-28-01-32-51-251314-AJR-L5Pro-27010
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gzserver-1]: process started with pid [27012]
[INFO] [gzclient   -2]: process started with pid [27014]
[INFO] [robot_state_publisher-3]: process started with pid [27018]
[INFO] [spawn_entity.py-4]: process started with pid [27020]
[INFO] [ros2-5]: process started with pid [27022]
[INFO] [ros2-6]: process started with pid [27024]
[INFO] [ros2-7]: process started with pid [27026]
[robot_state_publisher-3] Parsing robot urdf xml string.
[robot_state_publisher-3] The root link rob_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[robot_state_publisher-3] Link BL_hip_link had 1 children
[robot_state_publisher-3] Link BL_uleg_link had 1 children
[robot_state_publisher-3] Link BL_lleg_link had 0 children
[robot_state_publisher-3] Link BR_hip_link had 1 children
[robot_state_publisher-3] Link BR_uleg_link had 1 children
[robot_state_publisher-3] Link BR_lleg_link had 0 children
[robot_state_publisher-3] Link FL_hip_link had 1 children
[robot_state_publisher-3] Link FL_uleg_link had 1 children
[robot_state_publisher-3] Link FL_lleg_link had 0 children
[robot_state_publisher-3] Link FR_hip_link had 1 children
[robot_state_publisher-3] Link FR_uleg_link had 1 children
[robot_state_publisher-3] Link FR_lleg_link had 0 children
[robot_state_publisher-3] [INFO] [1677565971.918636230] [robot_state_publisher]: got segment BL_hip_link
[robot_state_publisher-3] [INFO] [1677565971.918742669] [robot_state_publisher]: got segment BL_lleg_link
[robot_state_publisher-3] [INFO] [1677565971.918751025] [robot_state_publisher]: got segment BL_uleg_link
[robot_state_publisher-3] [INFO] [1677565971.918754972] [robot_state_publisher]: got segment BR_hip_link
[robot_state_publisher-3] [INFO] [1677565971.918758208] [robot_state_publisher]: got segment BR_lleg_link
[robot_state_publisher-3] [INFO] [1677565971.918761805] [robot_state_publisher]: got segment BR_uleg_link
[robot_state_publisher-3] [INFO] [1677565971.918765021] [robot_state_publisher]: got segment FL_hip_link
[robot_state_publisher-3] [INFO] [1677565971.918768237] [robot_state_publisher]: got segment FL_lleg_link
[robot_state_publisher-3] [INFO] [1677565971.918771693] [robot_state_publisher]: got segment FL_uleg_link
[robot_state_publisher-3] [INFO] [1677565971.918774879] [robot_state_publisher]: got segment FR_hip_link
[robot_state_publisher-3] [INFO] [1677565971.918778376] [robot_state_publisher]: got segment FR_lleg_link
[robot_state_publisher-3] [INFO] [1677565971.918781893] [robot_state_publisher]: got segment FR_uleg_link
[robot_state_publisher-3] [INFO] [1677565971.918785179] [robot_state_publisher]: got segment rob_link
[spawn_entity.py-4] [INFO] [1677565972.268642443] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1677565972.269705866] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-4] [INFO] [1677565972.271941517] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-4] [INFO] [1677565972.286584294] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-4] [INFO] [1677565972.287607131] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-4] [INFO] [1677565973.793410278] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-4] [INFO] [1677565974.084268756] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [HyperDog]
[INFO] [spawn_entity.py-4]: process has finished cleanly [pid 27020]
[gzserver-1] [INFO] [1677565974.354980344] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin
[gzserver-1] [INFO] [1677565974.361244248] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: /
[gzserver-1] [INFO] [1677565974.361470843] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control
[gzserver-1] [INFO] [1677565974.361499537] [gazebo_ros2_control]: Loading parameter file /home/atticus/ws/hyperdog_ws/install/hyperdog_gazebo_sim/share/hyperdog_gazebo_sim/config/hyperdog_joint_controller.yaml
[gzserver-1]
[gzserver-1] [INFO] [1677565974.365076339] [gazebo_ros2_control]: connected to service!! robot_state_publisher
[gzserver-1] [INFO] [1677565974.365796299] [gazebo_ros2_control]: Recieved urdf from param server, parsing...
[gzserver-1] [INFO] [1677565974.373077056] [gazebo_ros2_control]: Loading joint: FR_hip_joint
[gzserver-1] [INFO] [1677565974.373126830] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373134354] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373154732] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373160543] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373176192] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373181532] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373193444] [gazebo_ros2_control]: Loading joint: FR_uleg_joint
[gzserver-1] [INFO] [1677565974.373198233] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373202652] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373207010] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373210827] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373215005] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373219323] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373223902] [gazebo_ros2_control]: Loading joint: FR_lleg_joint
[gzserver-1] [INFO] [1677565974.373227779] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373231716] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373235603] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373239521] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373243458] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373247275] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373252415] [gazebo_ros2_control]: Loading joint: FL_hip_joint
[gzserver-1] [INFO] [1677565974.373256412] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373260260] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373264157] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373268164] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373272222] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373276280] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373281229] [gazebo_ros2_control]: Loading joint: FL_uleg_joint
[gzserver-1] [INFO] [1677565974.373285126] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373288843] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373292721] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373296608] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373300455] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373304483] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373308700] [gazebo_ros2_control]: Loading joint: FL_lleg_joint
[gzserver-1] [INFO] [1677565974.373312468] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373316255] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373320192] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373324079] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373327987] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373332355] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373336813] [gazebo_ros2_control]: Loading joint: BR_hip_joint
[gzserver-1] [INFO] [1677565974.373340731] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373344407] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373348164] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373351931] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373355658] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373359696] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373363794] [gazebo_ros2_control]: Loading joint: BR_uleg_joint
[gzserver-1] [INFO] [1677565974.373367781] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373393770] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373398469] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373402416] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373406303] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373410261] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373414799] [gazebo_ros2_control]: Loading joint: BR_lleg_joint
[gzserver-1] [INFO] [1677565974.373418657] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373422414] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373426672] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373430599] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373434536] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373438554] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373442571] [gazebo_ros2_control]: Loading joint: BL_hip_joint
[gzserver-1] [INFO] [1677565974.373446419] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373450536] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373454454] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373458351] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373462248] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373466045] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373470273] [gazebo_ros2_control]: Loading joint: BL_uleg_joint
[gzserver-1] [INFO] [1677565974.373474050] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373477727] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373481484] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373485722] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373489539] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373493327] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373498616] [gazebo_ros2_control]: Loading joint: BL_lleg_joint
[gzserver-1] [INFO] [1677565974.373502714] [gazebo_ros2_control]:       Command:
[gzserver-1] [INFO] [1677565974.373506511] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373510489] [gazebo_ros2_control]:       State:
[gzserver-1] [INFO] [1677565974.373514306] [gazebo_ros2_control]:                position
[gzserver-1] [INFO] [1677565974.373518604] [gazebo_ros2_control]:                velocity
[gzserver-1] [INFO] [1677565974.373522371] [gazebo_ros2_control]:                effort
[gzserver-1] [INFO] [1677565974.373654819] [gazebo_ros2_control]: Loading controller_manager
[gzserver-1] [WARN] [1677565974.389834809] [gazebo_ros2_control]:  Desired controller update period (0.01 s) is slower than the gazebo simulation period (0.001 s).
[gzserver-1] [INFO] [1677565974.389933093] [gazebo_ros2_control]: Loaded gazebo_ros2_control.
[gzserver-1] [INFO] [1677565974.415355353] [controller_manager]: Loading controller 'joint_state_broadcaster'
[gzserver-1] [INFO] [1677565974.429999382] [controller_manager]: Configuring controller 'joint_state_broadcaster'
[ros2-5] Sucessfully loaded controller joint_state_broadcaster into state active
[INFO] [ros2-5]: process has finished cleanly [pid 27022]
[gzserver-1] [INFO] [1677565974.633877459] [controller_manager]: Loading controller 'gazebo_joint_controller'
[gzserver-1] [INFO] [1677565974.648081324] [controller_manager]: Configuring controller 'gazebo_joint_controller'
[gzserver-1] [INFO] [1677565974.649194029] [gazebo_joint_controller]: configure successful
[ros2-6] Sucessfully loaded controller gazebo_joint_controller into state active
[INFO] [ros2-6]: process has finished cleanly [pid 27024]
NDHANA94 commented 1 year ago

The first bool in state of the /hyperdog_joy_ctrl_cmd is for enabling the gamepad, second bool of the state is for enabling walking, and 3rd for switching right side joystick's cmd to move the robot on liner path in y direction (left/right) or to move in angular trajectory. in my case, since I am using f710 logitech gamepad, the first bool can be toggled by 'start' button. enable/disable walk bool can be toggled by 'back' button, 3rd bool can be toggled by left joystick buttn (pressing the left joystick down).

only when the first bool is true, other buttons are enabled. once 1st bool is true, increase the robot height (pose:position:z) by pressing 'hat up" button (to decrease "hat down"). then press the button 'X' and make the 2nd bool true. Then increase step height (gait_step:z) to be more than 90 by keep pressing left button (LB) and "hat up" (decrease gait_step:z by keep pressing LB and "hat down"). Now you should be able to enable the selected gait and control the robot by right joystick. Left joystick for changing the roll and pitch, Left and right triggers control yaw angle.