Jaeyoung-Lim / mavros_controllers

Aggressive trajectory tracking using mavros for PX4 enabled vehicles
BSD 3-Clause "New" or "Revised" License
400 stars 164 forks source link

trajectory publisher service interface #211

Closed nlpng closed 2 years ago

nlpng commented 2 years ago

I just came across this great code base, and had successfully run the example of sitl_trajectory_track_circle.launch, however when I started to go through the implementation of the trajectory_publisher.cpp, I am confused with the service defined in trajectory_publisher. It looks like the circle example is publishing the FlatTarget message using the refloop_timer_ callback, and the target reference is updated every time before message is published.

The ways to update start_time_ are through either triggerCallback or motionselectorCallback, but the service is not triggered anywhere in the code, either in the geometric_controller.cpp.

The part that I am not sure is where the start_time_ is initialized in the code?

trigger_time_ = (curr_time_ - start_time_).toSec();

Maybe I fundamentally misunderstood the mechanism of the code , could you provide some explanation on how the trajectory message is published using the trajectory publisher?

Jaeyoung-Lim commented 2 years ago

@nlpng The service is there to give the possibility that either an external node or even directly from a service caller in rqt can trigger a trajectory.