pioneer 移动机器人实现平滑轨迹
来源:互联网 发布:true key 是什么软件 编辑:程序博客网 时间:2024/05/22 09:38
#include "Aria.h"#include <math.h>#include <iostream>int main(int argc, char **argv){ Aria::init(); ArRobot robot; ArArgumentParser parser(&argc, argv); parser.loadDefaultArguments(); ArLog::log(ArLog::Terse, "WARNING: this program does no sensing or avoiding of obstacles, the robot WILL collide with any objects in the way! Make sure the robot has approximately 3 meters of free space on all sides."); // ArRobotConnector connects to the robot, get some initial data from it such as type and name, // and then loads parameter files for this robot. ArRobotConnector robotConnector(&parser, &robot); if(!robotConnector.connectRobot()) { ArLog::log(ArLog::Terse, "simpleMotionCommands: Could not connect to the robot."); if(parser.checkHelpAndWarnUnparsed()) { Aria::logOptions(); Aria::exit(1); return 1; } } if (!Aria::parseArgs()) { Aria::logOptions(); Aria::exit(1); return 1; } ArLog::log(ArLog::Normal, "simpleMotionCommands: Connected."); // Start the robot processing cycle running in the background. // True parameter means that if the connection is lost, then the // run loop ends. robot.runAsync(true); double v=0,w=0; double k1 = 0.6; double k2 = 50; double k3 = -50; int xg = 2000; int yg = -1000; int tg = -3.14/2 ; for(;;) { ArUtil::sleep(100); double x0 = robot.getX(); double y0 = robot.getY(); double t0 = robot.getTh()*3.14/180 + tg; std::cout <<x0<<"\t"<<y0<<"\t"<<t0<<std::endl; double distance0 = sqrt((xg-x0)*(xg-x0) +(yg-y0)*(yg-y0)); double alpha = -t0 + atan2((yg-y0),(xg-x0)); double beta = -t0 - alpha; v = k1 * distance0; if(v>150) v = 150; w = k2 * alpha +k3 * beta; if(w>45) w = 45; if(w < -45) w= -45; robot.lock(); robot.setVel(v); robot.setRotVel(w); robot.unlock(); if(abs(robot.getX()-xg)<2 && abs(robot.getY()-yg)<2 && abs(robot.getTh() - tg*180/3.14)<2) { break; } } robot.stopRunning(); // wait for the thread to stop robot.waitForRunExit(); // exit ArLog::log(ArLog::Normal, "simpleMotionCommands: Exiting."); Aria::exit(0); return 0;}
其实根本性实现就是定义了x 轴速度和z 轴旋转;
阅读全文
0 0
- pioneer 移动机器人实现平滑轨迹
- 【高德地图SDK】如何实现轨迹平滑移动?
- 类似滴滴打车,多辆小车在地图上平滑移动的实现,基于百度地图实现(轨迹已画好)
- 类似滴滴打车,多辆小车在地图上平滑移动的实现,基于百度地图实现(无轨迹)
- pioneer vs 实现简单四边形移动 和 简单避障
- 在触屏上实现。。移动轨迹(
- ROS实战_1.1 Pioneer-3DX 移动机器人平台介绍与学习指南
- 地图轨迹平滑算法
- 轨迹平滑方法
- 自主移动机器人动作设计--目标跟踪及移动轨迹设计(开发日志一)
- 利用javascript 实现锚点间平滑移动
- 解决ViewPager.setCurrentItem不能实现平滑移动
- 实现百度地图marker类平滑移动
- 机器人轨迹规划
- 机器人手臂轨迹规划
- 机器人轨迹规划
- 2、matlab机器人轨迹
- 三轮移动机器人在ros indigo下的定位、导航与轨迹规划构想
- 用xcode往码云上传项目
- Linux学习——基础入门命令
- 批量打印带文字的二维码
- transient 关键字的简单用法
- 在linux下用tomcat部署java web项目的过程与注意事项
- pioneer 移动机器人实现平滑轨迹
- 券宝网 淘宝天猫优惠券网站(可直接做兼职)
- Tomcat优化
- 魂十司机攻略
- 注解@PostConstruct与@PreDestroy讲解及实例
- DrawerLayout侧滑布局点击不响应事件
- java中文乱码问题
- shape文件的生成与打包下载
- JEECMS——web.xml配置