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

Robot Simulation without Gamepad #12

Closed lukasehr closed 8 months ago

lukasehr commented 8 months ago

Hi there, I am currently trying to get my Gazebo Simulation with Hyperdog running. Is it correct that I need a gamepad to make the robot move in Gazebo/Rviz2?

Or is there a way to control it via "ros2 topic pub ..."? I tried publishing to /vel_cmd, but it did not work, I guess it's because the robot has to wake up/ start walk before it can work with /vel_cmd, right?

I am sorry about those (stupid) questions, would really appreciate an answer.

NDHANA94 commented 8 months ago

Hi there!

Yes, you need a gamepad, or u can open hyperdog_joy_ctrl_cmd topic in rqt. Then you can control the robot with changing following variables of the topic msg type.

NDHANA94 commented 8 months ago

Please note that due to an issue with ros2_control package, robot is sliding over the ground in gazebo simulation.

lukasehr commented 8 months ago

Thank you for the fast answer! The Idea with rqt was brilliant! Just one more thing: The robot doesn't really start moving. This is what I am doing right now:

1) Start Gazebo with ros2 launch hyperdog_gazebo_sim hyperdog_gazebo_sim.launch.py 2) Start the teleop node with ros2 launch hyperdog_teleop hyperdog_teleop.launch.py 3) Using my Sony Dualshock 3 Controller I set the states to [true, true, false] 4) I don't know how to change the pose.position.z with my controller so I set that to 100 via rqt. 5) I also don't know how to change the gait_step.z with the controller so I set that to 100 via rqt.

As far as I understand, now I should be able to make the robot move with the Joysticks. However that does not happen? (Also the height doesn't change in gazebo?

Do you have an idea what I am doing wrong? I am using Gazebo-11 and Ros2 Humble on an Ubuntu 22.04 System.

lukasehr commented 8 months ago

Update: I realised I have to also start ros2 launch hyperdog_launch hyperdog.launch.py in order to make the whole thing work. Now the Robot does (more or less) what I want it to do and I can see it moving in Gazebo. Only thing I have to do now is order a Logitech F710 because the Gamepad I have doesn't have all the buttons I need :laughing:

Thanks a lot for helping and providing the repo!

NDHANA94 commented 8 months ago

Yeah, hyperdog.launch.py is launching all the other necessary nodes to control the robot.