// 回调函数是 MoveBase::executeCb as_ = newMoveBaseActionServer(ros::NodeHandle(), "move_base", boost::bind(&MoveBase::executeCb, this, _1), false); ...... //we're all set up now so we can start the action server as_->start();
MoveBase::executeCb函数在move_base693行,过程太复杂,步骤大致如下:
验证目标位姿的欧拉角是否合理
目标位姿转换为全局frame中的位姿
1 2 3 4 5 6
//we have a goal so start the planner boost::unique_lock<boost::recursive_mutex> lock(planner_mutex_); planner_goal_ = goal; runPlanner_ = true; planner_cond_.notify_one(); lock.unlock();
在pf_pdf_gaussian_alloc函数中,对协方差矩阵进行了特征值分解。也就是协方差矩阵cx=cr cd crT ,cd是对角矩阵,取cd的三个对角元素开平方后,传入pf_ran_gaussian函数,作为set_a粒子集的初始化的标准差。yaw的方差在对角矩阵cd里不变,cd的最后一个元素仍然是initial_cov_aa
Costmap2DR0S transform timeout. Current time: 1687663324.0445, global_pose stamp 321.6492, tolerance: 0.3000 [1687663324.0756730651]: Could not get robot pose, cancelling reconfiguration [1687663324.6495552631]: MoveBase received move_base goal(48.000000, 58.000000), type: 3 [1687663324]: wx: 46.032079, wy: 46.095481, origin.x: 0.000000, origin_y_: 0.000000 [1687663324]: mx: 920, my: 921 , size_x_: 200, size_y_: 200, resolution.: 0.050000 [1687663324]: wx: 46.032079, wy: 46.095481, start_x_i: 920, start_y_i: 921 [1687663324]: The robot's start position is off the global costmap. Planning will always fail, you sure the robot has been properly localized ? [1687663324.]: move_base failed to find a plan to point(48.00, 58.00) ! [1687663324.]: wx: 46.032090, wy: 46.095525, start_x_i: 920, start_y_i: 921
Download driver directory from this repo: https://github.com/endlessm/linux/tree/master/drivers/net/wireless/rtl8821ce
You can do it by this link: https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/endlessm/linux/tree/master/drivers/net/wireless/rtl8821ce
Unpack zip archive.
Change the Makefile. Line export TopDIR ?= ... to export TopDIR ?= PATH TO EXTRACTED DIRECTORY. 再根据make的报错信息将报错的那行去掉
这个问题困扰了我几天,在网上查了很久,但网上提供的方法都没用,最后严重怀疑是网卡和Ubuntu版本不匹配的问题。最后,我用U盘做了一个Ubuntu系统,与工控机的一样,用try without install Ubuntu的方式启动,发现工控机的Ubuntu版本比我自己的电脑内核版本低。这时插上外置无线网卡,等了一会找到信号了。因此,我重装为旧内核版本的Ubuntu,结果发现插上外置无线网卡后,能发现几个无线信号,但显示是在范围之外,偶尔能连接上一次。
// 重要成员变量 Header header string ns //命名空间namespace int32 id //与命名空间联合起来,形成唯一的id,这个唯一的id可以将各个标志物区分开来,使得程序可以对指定的标志物进行操作,如果再次执行相同id,会删除上一次的标记 int32 type //类型,指哪种形状 int32 action //操作,是添加还是修改还是删除 geometry_msgs/Pose pose # 位姿 geometry_msgs/Vector3 scale # 默认1,指1米大小。一般要小于1 std_msgs/ColorRGBA color # Color [0.0-1.0],其实是普通颜色值除以255 duration lifetime # 在自动删除前维持多久,0表示永久。注意类型为duration,所以要用ros::Duration(1)初始化 bool frame_locked # If this marker should be frame-locked, i.e. retransformed into its frame every timestep
if( atoi(argv[1])==0 ) { marker.action = visualization_msgs::Marker::DELETEALL; ROS_WARN("All marker in rviz will be removed !"); } else marker.action = visualization_msgs::Marker::ADD;
// Set the frame ID and timestamp. See the TF tutorials for information on these. marker.header.frame_id = "/map"; marker.header.stamp = ros::Time::now();
// Set the namespace and id for this marker. This serves to create a unique ID // Any marker sent with the same namespace and id will overwrite the old one marker.ns = "basic_shapes"; marker.id = atoi(argv[1]);
marker.type = shape;
// Set the pose of the marker. This is a full 6DOF pose relative to the frame/time specified in the header marker.pose.position.x = edge->position.x; marker.pose.position.y = edge->position.y; marker.pose.position.z = edge->position.z; marker.pose.orientation.x = edge->orientation.x; marker.pose.orientation.y = edge->orientation.y; marker.pose.orientation.z = edge->orientation.z; marker.pose.orientation.w = edge->orientation.w;
// Set the scale of the marker -- 1x1x1 here means 1m on a side marker.scale.x = 0.1; marker.scale.y = 0.1; marker.scale.z = 0.1;
// Set the color -- set alpha to something non-zero! marker.color.r = 0.0f; marker.color.g = 0.0f; marker.color.b = 1.0f; // 不要是0,否则报警 Marker is fully transparent (color.a is 0.0). marker.color.a = 1.0; // 不加参数就是0,标识生命期为永久 marker.lifetime = ros::Duration();
// 如果rviz里没有订阅话题visualization_marker,等待2秒 while (marker_pub.getNumSubscribers() < 1) { if (!ros::ok()) { return0; } ROS_WARN_ONCE("Please create a subscriber to the marker"); sleep(2); } // 这样比较好,有了订阅者再发布 marker_pub.publish(marker); return0; }