Hi there,
I am currently performing all the navigation and control in offboard mode with an algorithm to set my waypoints and adapt the route if there are any obstacle on the way. Now this works as expected but I would like to try this method with the waypoints and the Bezier(looks very cool).
I know that this is currently being used in the local_planner and global_planner from the avoidance(https://github.com/PX4/avoidance) package. But from what I see in the /mavros/trajectory/desired and generated only one point is being set. Correct?
I read already the available docs regarding this path/trajectory planning. Still not 100% clear if this is suppose to do what I aim to do :wink:
Mavlink Path Planning(Trajectory)Protocol and Px4 Path Planning Interface
Here is what I tried so far:
I made a test case just to try the trajectory in waypoint mode, by setting 3 waypoints as below.
obst_avoid.point_1.position.x = pose.pose.position.x;
obst_avoid.point_1.position.y = pose.pose.position.y;
obst_avoid.point_1.position.z = pose.pose.position.z;
obst_avoid.point_1.velocity.x = NAN;
obst_avoid.point_1.velocity.y = NAN;
obst_avoid.point_1.velocity.z = NAN;
obst_avoid.point_1.acceleration_or_force.x = NAN;
obst_avoid.point_1.acceleration_or_force.y = NAN;
obst_avoid.point_1.acceleration_or_force.z = NAN;
obst_avoid.point_1.yaw = tf::getYaw(pose.pose.orientation);
obst_avoid.point_1.yaw_rate = -vel.angular.z;
obst_avoid.point_valid = {true, true, true, false, false};
obst_avoid.command = {0, 0, 0, 0, 0}; // this is unclear because only TAKEOFF LOITER LAND are available as in the mavlink_messages.cpp module. and actually 0 is the default. or should it be the Position?
I performed the same for point 2 and 3 just with different coordinates. Just for testing.
I am publishing this trajectory message at 5Hz nh.advertise<mavros_msgs::Trajectory>("/mavros/trajectory/generated", 10);
COM_OBS_AVOID is set to 1.
I also set the /mavros/companion_process/status = 196; /// MAV_COMPONENT_ID_AVOIDANCE
I start the nodes and everything looks good .
[ INFO] [1600960481.367579651, 4.132000000]: FCU: Avoidance system connected
I set it to AUTO.TAKEOFF and arm it . after a while I set it to mission.
The drone starts moving to Waypoint 1 at (3;3;5), once this is reached it stay in LOITER mode.
From rostopic echo /mavros/trajectory/desired I get the following:
So what am I missing here ? Why it only setpoints the WP1 and does it doesn't fly to the next waypoint?
My questions
Can the Trajectory(waypoint) method be used to send 5 waypoints in way that I can dynamically update them. For example I set WP 1 to 5 and along the way I update 2 and 3?
Is there a simple functional example to demonstrate this at work?
What should be set under mavros_msgs::Trajectory. command () ?
Can the same be performed under bezier method ? Send the 5 WP and adapt along the way?
How to set WPs MAV_CMD? So that they land, loiter etc when the WP is reached?
If anyone could shed some light on this topic, I believe that there will be more people using this method in the future.
Hi there, I am currently performing all the navigation and control in offboard mode with an algorithm to set my waypoints and adapt the route if there are any obstacle on the way. Now this works as expected but I would like to try this method with the waypoints and the Bezier(looks very cool). I know that this is currently being used in the local_planner and global_planner from the avoidance(https://github.com/PX4/avoidance) package. But from what I see in the /mavros/trajectory/desired and generated only one point is being set. Correct? I read already the available docs regarding this path/trajectory planning. Still not 100% clear if this is suppose to do what I aim to do :wink: Mavlink Path Planning(Trajectory) Protocol and Px4 Path Planning Interface
Here is what I tried so far: I made a test case just to try the trajectory in waypoint mode, by setting 3 waypoints as below.
I performed the same for point 2 and 3 just with different coordinates. Just for testing.
I start the nodes and everything looks good . [ INFO] [1600960481.367579651, 4.132000000]: FCU: Avoidance system connected
I set it to AUTO.TAKEOFF and arm it . after a while I set it to mission. The drone starts moving to Waypoint 1 at (3;3;5), once this is reached it stay in LOITER mode.
From rostopic echo /mavros/trajectory/desired I get the following:
from PX4 shell it looks like the waypoints are being correctly published.
and from listener trajectory_setpoint
So what am I missing here ? Why it only setpoints the WP1 and does it doesn't fly to the next waypoint?
My questions
If anyone could shed some light on this topic, I believe that there will be more people using this method in the future.
Greetings, Pedro