A few questions about Unit 4: ROS Actions- Part 1

Great lesson! But a few questions remained:

1- Could anybody explain the code below:

    takeoff = rospy.Publisher('/drone/takeoff', Empty, queue_size=1) #Create a Publisher to takeoff the drone
    takeoff_msg = Empty() #Create the message to takeoff the drone

Or, more specifically, how would I know that the object “takeoff” would need a message Empty() as argument? (OK, just solved that myself: “rostopic info /drone/takeoff” gives you that!)

I may have missed something before, but I wouldn’t think about creating an object publisher, with takeoff and landing, I was trying to publish directly on cmd_vel (without much success). How can I get to know these things, without the help of the experts?

Thank you in advance,

1 Like

So mainly this normally you can know it through several paths:

  1. As you said, you can rostopic info about the topics that you want to know more about how they work or at least how they interface.
  2. You have worked with the simulation/realrobot and you know how those topics are generated and what they trigger. That means digging inside the code of controllers and simulation plugins.
  3. Documentation about the robot in question: ROSwiki has a lot of info about most of the main packages. You can also learn from here RobotIgniteAcademy with a more practical approach.

Hope it was useful