gsilano / BebopS

BebopS aims to simulate the behavior of Parrot Bebop 2 by using SIL methodologies
Apache License 2.0
64 stars 30 forks source link

rostopic - command to set the trajectory #37

Closed Nelson89 closed 3 years ago

Nelson89 commented 3 years ago

Hello,

I'm trying to master the drone control using ROS and gazebo. I would like to take control using rostopic. Now I can get this by setting angular velocities. I would like to do this by designating a point in space.

If I use: $ roslaunch bebop_simulator multiple_bebop_without_controller.launch

I can see the options available to control the angular velocities.

$ rostopic list
...
/bebop_2/bebop2/command/motors
...

I can change angular velocities of motor with command: $ rostopic pub bebop_2/bebop2/command/motors mav_msgs/Actuators '{angular_velocities: [1000, 1000, 1000, 1000]}'

It works.

I have problem, when I will set a trajectory. If I run: $ roslaunch bebop_simulator multiple_task2_world.launch

I can see the option available to control a trajectory:

$ rostopic list
...
/bebop_2/bebop2/command/motors
/bebop_2/bebop2/command/trajectory
...

This is my problem: In place of the question marks, I do not know what header to insert, what values and in what order. $ rostopic pub bebop_2/bebop2/command/trajectory trajectory_msgs/MultiDOFJointTrajectory ????

The primary problem is I don't know how to check things like this? It should be in the documentation or it is somewhere in the code?

Nelson89 commented 3 years ago

I have found solution. This issue was very helpful. I used this command to set a new position of drone in space:

$ roslaunch bebop_simulator multiple_task2_world.launch

$ rostopic pub bebop_3/bebop3/command/trajectory trajectory_msgs/MultiDOFJointTrajectory "joint_names: [base_link]
points: [transforms: [translation: [x, y, z]]]"

I think it would be a good idea to add this to the readme in the Basic Usage section.