ethz-asl / mav_trajectory_generation

Polynomial trajectory generation and optimization, especially for rotary-wing MAVs.
Apache License 2.0
528 stars 222 forks source link

Unable to run example.launch #103

Open deepak-1530 opened 4 years ago

deepak-1530 commented 4 years ago

When I run the example.launch file and then press ENTER, I get the following error-:

[FATAL] [1582182912.640695319, 11.590000000]: Trying to publish message of type [mav_planning_msgs/PolynomialTrajectory/2daf5d705534e84f80980f4673a0e62b] on a publisher with type [mav_planning_msgs/PolynomialTrajectory4D/4d68d15524ede489eecd674bb6dc3ee8] [FATAL] [1582182912.640714553, 11.590000000]:

yvesdaoud commented 3 years ago

Was this ever solved?

Jadelogan65 commented 3 years ago

I'm receiving the same error message - any ideas?

Jadelogan65 commented 3 years ago

I looked into this a bit today. There's a small change to get it working:

Small change to /home/counterswarm/catkin_newrotors/src/mav_trajectory_generation/mav_trajectory_generation_example/src/example_planner.cc

Line 133-134 converts the planned trajectory (cleverly named trajectory) to a PolynomialTrajectory type called msg mav_planning_msgs::PolynomialTrajectory msg; mav_trajectory_generation::trajectoryToPolynomialTrajectoryMsg(trajectory, &msg);

At line 137 msg is published pub_trajectory_.publish(msg);

msg is a mav_planning_msgs/PolynomialTrajectory message type While pubtrajectory is defined as a mav_planning_msgs/PolynomialTrajectory4D message type

Change msg to mav_planning_msgs::PolynomialTrajectory4D msg;

Run catkin build and the example ran successfully for me.