hector_quadrotor not hovering in between key inputs while teleoperating with teleop_twist_keyboard

asked 2023-01-31 02:57:22 -0500

hunterlineage1 gravatar image

I am using hector_quadrotor with ROS melodic and gazebo in ubuntu 18.04. I am teleoperating the quadrotor using teleop_twist_keyboard.

My goal is to be able to use the keys from teleop_twist_keyboard to control the motion of the hector_quadrotor. I understand that I need to press 't' for it to move upwards (along z-direction). However, the moment I stop pressing any motion control key, the hector_quadrotor stops hovering and falls to the ground.

How can I program teleop_twist_keyboard such that hector_quadrotor hovers upon teleoperating from keyboard inputs? As in, say I want it to gain height and stay there without falling back to the ground, what code would I have to add and where? I saw this website and learned that I would need rostopic pub /cmd_vel geometry_msgs/Twist '{linear: {x: 0, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}' to keep the hector_quadrotor still but how do I achieve this constantly between teleoperating inputs?

edit retag flag offensive close merge delete