yinzixuan126 / mpc_path_follower_ros

based on ros navigation stack, using mpc to do path tracking
83 stars 51 forks source link

编译报错 #7

Closed qycqycqyc closed 1 year ago

qycqycqyc commented 2 years ago

[ 50%] Building CXX object mpc_path_follower_ros/CMakeFiles/mpc_path_follower.dir/src/mpc_path_follower_ros.cpp.o In file included from /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:9:0: /home/qyc/mpc_ws/src/mpc_path_follower_ros/include/mpc_path_follower/mpc_path_follower_ros.h:39:43: error: ‘tf’ has not been declared void initialize(std::string name, tf::TransformListener tf, ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/include/mpc_path_follower/mpc_path_follower_ros.h:39:64: error: expected ‘,’ or ‘...’ before ‘’ token void initialize(std::string name, tf::TransformListener tf, ^ /home/qyc/mpc_ws/src/mpc_path_follower_ros/include/mpc_path_follower/mpc_path_follower_ros.h:103:9: error: ‘tf’ does not name a type; did you mean ‘Lf’? tf::TransformListener tf_; ///< @brief Used for transforming point clouds ^~ Lf /home/qyc/mpc_ws/src/mpc_path_follower_ros/include/mpc_path_follower/mpc_path_follower_ros.h:104:9: error: ‘tf’ does not name a type; did you mean ‘Lf’? tf::TransformListener _tf_listener; ^~ Lf /home/qyc/mpc_ws/src/mpc_path_follower_ros/include/mpc_path_follower/mpc_path_follower_ros.h:116:9: error: ‘tf’ does not name a type; did you mean ‘Lf’? tf::Stamped currentpose; ^~ Lf /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:22:44: error: ‘tf’ has not been declared tf::TransformListener tf, ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:22:66: error: expected ‘,’ or ‘...’ before ‘’ token tf::TransformListener tf, ^ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp: In member function ‘void mpc_path_follower::MpcPathFollowerRos::initialize(std::__cxx11::string, int)’: /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_followerros.cpp:34:13: error: ‘tf’ was not declared in this scope tf_ = tf; ^~~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_followerros.cpp:34:19: error: ‘tf’ was not declared in this scope tf = tf; ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_followerros.cpp:34:19: note: suggested alternative: ‘Lf’ tf = tf; ^~ Lf /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:35:28: error: ‘costmap_ros’ was not declared in this scope costmapros = costmap_ros; ^~~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:35:28: note: suggested alternative: ‘costmapros’ costmapros = costmap_ros; ^~~ costmapros /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:36:40: error: ‘currentpose’ was not declared in this scope costmapros->getRobotPose(currentpose); ^~~~~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp: In member function ‘virtual bool mpc_path_follower::MpcPathFollowerRos::computeVelocityCommands(geometry_msgs::Twist&)’: /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:57:43: error: ‘currentpose’ was not declared in this scope if ( ! costmapros->getRobotPose(currentpose)) { ^~~~~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:62:43: error: ‘currentpose’ was not declared in this scope if ( ! plannerutil.getLocalPlan(currentpose, transformed_plan)) { ^~~~~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp: In member function ‘bool mpc_path_follower::MpcPathFollowerRos::mpcComputeVelocityCommands(std::vector<geometrymsgs::PoseStamped<std::allocator > >&, geometry_msgs::Twist&)’: /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:98:9: error: ‘tf’ has not been declared tf::Stamped robot_vel; ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:98:21: error: ‘tf’ has not been declared tf::Stamped robot_vel; ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:98:31: error: ‘robot_vel’ was not declared in this scope tf::Stamped robot_vel; ^~~~~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:101:59: error: ‘tf’ has not been declared robot_vel.getOrigin().getY(), tf::getYaw(robot_vel.getRotation())); ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:120:9: error: ‘tf’ has not been declared tf::Pose pose; ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:121:9: error: ‘tf’ has not been declared tf::poseMsgToTF(odom.pose.pose, pose); ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:121:41: error: ‘pose’ was not declared in this scope tf::poseMsgToTF(odom.pose.pose, pose); ^~~~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:121:41: note: suggested alternative: ‘powh’ tf::poseMsgToTF(odom.pose.pose, pose); ^~~~ powh /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:122:22: error: ‘tf’ has not been declared double psi = tf::getYaw(pose.getRotation()); ^~ /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp: In member function ‘virtual bool mpc_path_follower::MpcPathFollowerRos::isGoalReached()’: /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:241:43: error: ‘currentpose’ was not declared in this scope if ( ! costmapros->getRobotPose(currentpose)) { ^~~~~ In file included from /opt/ros/melodic/include/class_loader/class_loader_core.hpp:47:0, from /opt/ros/melodic/include/class_loader/class_loader.hpp:46, from /opt/ros/melodic/include/class_loader/multi_library_class_loader.hpp:42, from /opt/ros/melodic/include/pluginlib/class_loader.hpp:38, from /opt/ros/melodic/include/costmap_2d/costmap_2d_ros.h:50, from /opt/ros/melodic/include/nav_core/base_local_planner.h:42, from /home/qyc/mpc_ws/src/mpc_path_follower_ros/include/mpc_path_follower/mpc_path_follower_ros.h:16, from /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:9: /opt/ros/melodic/include/class_loader/meta_object.hpp: In instantiation of ‘B class_loader::impl::MetaObject<C, B>::create() const [with C = mpc_path_follower::MpcPathFollowerRos; B = nav_core::BaseLocalPlanner]’: /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:289:2: required from here /opt/ros/melodic/include/class_loader/meta_object.hpp:196:12: error: invalid new-expression of abstract class type ‘mpc_path_follower::MpcPathFollowerRos’ return new C; ^~~~~ In file included from /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:9:0: /home/qyc/mpc_ws/src/mpc_path_follower_ros/include/mpc_path_follower/mpc_path_follower_ros.h:23:11: note: because the following virtual functions are pure within ‘mpc_path_follower::MpcPathFollowerRos’: class MpcPathFollowerRos : public nav_core::BaseLocalPlanner{ ^~~~~~ In file included from /home/qyc/mpc_ws/src/mpc_path_follower_ros/include/mpc_path_follower/mpc_path_follower_ros.h:16:0, from /home/qyc/mpc_ws/src/mpc_path_follower_ros/src/mpc_path_follower_ros.cpp:9: /opt/ros/melodic/include/nav_core/base_local_planner.h:78:20: note: virtual void nav_core::BaseLocalPlanner::initialize(std::__cxx11::string, tf2_ros::Buffer, costmap_2d::Costmap2DROS) virtual void initialize(std::string name, tf2_ros::Buffer tf, costmap_2d::Costmap2DROS costmap_ros) = 0; ^~~~~~ mpc_path_follower_ros/CMakeFiles/mpc_path_follower.dir/build.make:62: recipe for target 'mpc_path_follower_ros/CMakeFiles/mpc_path_follower.dir/src/mpc_path_follower_ros.cpp.o' failed make[2]: [mpc_path_follower_ros/CMakeFiles/mpc_path_follower.dir/src/mpc_path_follower_ros.cpp.o] Error 1 CMakeFiles/Makefile2:1405: recipe for target 'mpc_path_follower_ros/CMakeFiles/mpc_path_follower.dir/all' failed make[1]: [mpc_path_follower_ros/CMakeFiles/mpc_path_follower.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j16 -l16" failed