当前位置: 首页 > news >正文

多个域名URL转发到一个网站软件推广

多个域名URL转发到一个网站,软件推广,分销渠道的三种模式,无锡做网站品牌公司最近在做AGV改造项目,其中涉及到了odom—>base_link的坐标转换,那么odom即里程计信息主要由伺服电机自带的增量式编码器求取。 void ROSTCP::cal_pulse(int &current , int &receive , int &delta) {delta (receive - current);//* M_P…

最近在做AGV改造项目,其中涉及到了odom—>base_link的坐标转换,那么odom即里程计信息主要由伺服电机自带的增量式编码器求取。

void ROSTCP::cal_pulse(int &current , int &receive , int &delta)
{delta = (receive - current);//* M_PI * 0.2 / 200000.0;current = receive;
}
void ROSTCP::handle_speed_msg()
{cal_pulse(cur_left_ , recv_left_ , delta_left);      //左轮移动距离cal_pulse(cur_right_ , recv_right_ , delta_right);   //右轮移动距离   cout << "left: " << delta_left << "right: " << delta_right << endl;now_ = ros::Time::now();if(start_flag_){accumulation_x_ = accumulation_y_ = accumulation_th_ = 0.0;last_time_ = now_;start_flag_ = false;return; }delta_time = (now_ - last_time_).toSec();double dxy_ave = (delta_left + delta_right) * M_PI * wheel_diameter_/(2.0  * 200000);   // dxy_ave为左右轮的移动距离均值,认为是中心点的移动距离double dth = (delta_left - delta_right) / (wheel_track_ * 200000);      // dth 为通过为中心点的转动角度,通过弧长公式 θ = l / R double vxy = dxy_ave / delta_time;                  // V=vxy 为位移对时间的微分double vth = dth / delta_time;                      // vth 为角速度,为转动角度对时间的倒数cout << "dxy_ave: " << dxy_ave << "dth: " << dth << endl;double dx = cos(dth) * dxy_ave;                     //dx中心点处的位移在base_link坐标系xoy轴上的投影double dy = -sin(dth) * dxy_ave;                   //dy中心点处的位移在base_link坐标系xoy轴上的投影cout << "dx: " << dx << "  dy: " << dy << endl;cout << "cos(accumulation_th_) * dx - sin(accumulation_th_) * dy:" << cos(accumulation_th_) * dx - sin(accumulation_th_) * dy << endl;accumulation_x_ += (cos(accumulation_th_) * dx - sin(accumulation_th_) * dy); //将base_link坐标系转换到odom坐标系accumulation_y_ += (sin(accumulation_th_) * dx + cos(accumulation_th_) * dy);accumulation_th_ += dth;geometry_msgs::Quaternion odom_quat = tf::createQuaternionMsgFromYaw(accumulation_th_);transformStamped_.header.stamp = ros::Time::now();transformStamped_.header.frame_id = odom_frame_;transformStamped_.child_frame_id = base_frame_;transformStamped_.transform.translation.x = accumulation_x_;transformStamped_.transform.translation.y = accumulation_y_;transformStamped_.transform.translation.z = 0.0;//tf2::Quaternion q;//q.setRPY(0, 0, accumulation_th_);transformStamped_.transform.rotation = odom_quat;br_.sendTransform(transformStamped_);odom_.header.frame_id = odom_frame_;odom_.child_frame_id = base_frame_;odom_.header.stamp = now_;odom_.pose.pose.position.x = accumulation_x_;odom_.pose.pose.position.y = accumulation_y_;odom_.pose.pose.position.z = 0;//odom_.pose.pose.orientation = odom_quat;odom_.pose.pose.orientation.x = odom_quat.x;odom_.pose.pose.orientation.y = odom_quat.y;odom_.pose.pose.orientation.z = odom_quat.z;odom_.pose.pose.orientation.w = odom_quat.w;odom_.twist.twist.linear.x = vxy;odom_.twist.twist.linear.y = 0;odom_.twist.twist.angular.z = vth;odom_pub_.publish(odom_);cout<<"accumulation_x: " << accumulation_x_ << "; accumulation_y: " << accumulation_y_ <<"; accumulation_th: " << accumulation_th_<<endl;//}last_time_ = now_;
}


首先求取两个编码器的增量,用当前时刻收到的脉冲数减去上一时刻收到的脉冲数,delta_left为左轮脉冲增量,delta_right为右轮脉冲增量。

cal_pulse(cur_left_ , recv_left_ , delta_left);      //左轮移动距离
cal_pulse(cur_right_ , recv_right_ , delta_right);   //右轮移动距离  

设置初始值,假设odom初始时刻x方向移动0,y方向移动0,转动角度为0

if(start_flag_){accumulation_x_ = accumulation_y_ = accumulation_th_ = 0.0;last_time_ = now_;start_flag_ = false;return; }

计算时间间隔,用来求取速度等信息

delta_time = (now_ - last_time_).toSec();

求取左右轮中心点移动距离,根据两轮差速模型v = (vl + vr) / 2,即左轮速度加上右轮速度除2,

代码中wheel_diameter为车轮直径,M_PI*wheel_diameter为轮子周长,200000为轮子走一圈,编码器输出的脉冲数,所以M_PI*wheel_diameter/200000为编码器转动一个脉冲,轮子前进多少米。最后dxy_ave为左编码器增量脉冲与右编码器增量脉冲求取的中心点前进了多少米

double dxy_ave = (delta_left + delta_right) * M_PI * wheel_diameter_/(2.0  * 200000); 

http://www.zhongyajixie.com/news/5816.html

相关文章:

  • 网站连接跳转怎么做百度搜图
  • 信金在线制作网站网络营销主要做些什么
  • 系统官网网站模板适合推广的app有哪些
  • 日本做衣服的网站有哪些久久seo综合查询
  • 网站首页设计特点有哪些百度平台商家客服
  • 军队网站建设方案百度问答平台入口
  • 安吉城乡建设局网站全媒体运营师报考官网在哪里
  • 桌面网站怎么做公司官网制作开发
  • 上海内贸网站建设全国免费发布信息平台
  • 有了阿里云服务器怎么做网站外链
  • 最好的建站平台厦门seo招聘
  • 做一个电影网站需要多少钱上海百度推广开户
  • 上海工业网站建设抖音seo优化怎么做
  • 大连做企业网站排名广州引流推广公司
  • 有ecs怎么做网站2022最新新闻素材摘抄
  • ps做网站要求lol今日赛事直播
  • 成绩查询网站怎么做seo推广软件
  • 教做高级料理的网站潍坊做网站公司
  • 台州北京网站建设必应搜索引擎网站
  • 开发游戏用什么软件青岛seo关键词
  • 零基础建设网站视频教程中国十大网络销售公司
  • 贵港建设局网站查询新闻头条最新消息今日头条
  • 即墨网站制作百度seo排名优化系统
  • 四川省住房和城乡建设厅官网查询做seo需要投入的成本
  • 广州快速建站哪家服务专业seo站长之家
  • 新闻网站怎么做湖南网站seo公司
  • 网站推广的步骤南昌seo报价
  • 企业网站 留言板品牌公关
  • 网站产品使用说明书怎么做北京百度推广代理公司
  • 网站的ci设计怎么做怎样在百度打广告