Robotics StackExchange | Archived questions

Commanding Position with hector_quadrotor - Melodic Release

Hello -

New user with ROS and Gazebo - so far things look really great. I'm experimenting with the hectorquadrotor vehicle and using Gazebo as the sim engine. I've run through a couple of the tutorials and see how to control the vehicle with velocities via the /cmdvel topic. I also see in the hectorquadrotorcontroller folder .cpp files for controlling position, velocity, and attitude.

I'm trying to see how to send a position / pose command to the vehicle. I found this link https://answers.gazebosim.org/question/7036/using-hector_quadrotor_gazebo-with-externally-provided-poses/ from a while back (2014) and modified the controller.launch file as indicated. But the version of controller.launch I have with the Melodic release seems to have a position controller spawning already. It has:


arg name="controllers" default=" controller/position controller/velocity controller/attitude controller/pose "/>

rosparam ns="controller" file="$(find hectorquadrotorcontrollers)/params/controller.yaml" /> rosparam file="$(find hectorquadrotorcontrollers)/params/params.yaml" />

node name="controllerspawner" pkg="controllermanager" type="spawner" respawn="false" output="screen" args=" $(arg controllers) --shutdown-timeout 3"/>


So maybe the position controller is already being spawned? Regardless, I tried the following command from the command line before and after modifying controller.launch without seeing the vehicle move:

rostopic pub /uav1/command/pose geometrymsgs/PoseStamped '{header: {stamp: now, frameid: "world"}, pose: { position: [3, 2, 2], orientation: [0,0,0,1] } }'

Am I on the right track? Any help would be appreciated! Thanks!

Asked by Jadelogan65 on 2021-02-18 15:49:53 UTC

Comments

Answers