Robotics StackExchange | Archived questions

hector_quadrotor not hovering in between key inputs while teleoperating with teleop_twist_keyboard

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

My goal is to be able to use the keys from teleoptwistkeyboard to control the motion of the hectorquadrotor. 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 hectorquadrotor stops hovering and falls to the ground.

How can I program teleoptwistkeyboard such that hectorquadrotor 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 r`ostopic pub /cmdvel geometrymsgs/Twist '{linear: {x: 0, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}'` to keep the hectorquadrotor still but how do I achieve this constantly between teleoperating inputs?

Asked by hunterlineage1 on 2023-01-31 03:57:22 UTC

Comments

Answers