Commanding Position with hector_quadrotor - Melodic Release

asked 2021-02-18 14:49:53 -0500

Hello -

New user with ROS and Gazebo - so far things look really great. I'm experimenting with the hector_quadrotor 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 /cmd_vel topic. I also see in the hector_quadrotor_controller 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/questio... 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 hector_quadrotor_controllers)/params/controller.yaml" /> rosparam file="$(find hector_quadrotor_controllers)/params/params.yaml" />

node name="controller_spawner" pkg="controller_manager" 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 geometry_msgs/PoseStamped '{header: {stamp: now, frame_id: "world"}, pose: { position: [3, 2, 2], orientation: [0,0,0,1] } }'

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

edit retag flag offensive close merge delete