【深蓝学院】移动机器人运动规划--第4章 动力学约束下的运动规划--作业

本文主要是介绍【深蓝学院】移动机器人运动规划--第4章 动力学约束下的运动规划--作业,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

  • 1. T1
    • 1.1 题目
    • 1.2 求解
    • 1.3 Pontryagin Minimum Principle 的拓展
  • 2. T2
    • 2.1 题目
    • 2.2 求解
  • 3. Reference

1. T1

1.1 题目

在这里插入图片描述

1.2 求解

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1.3 Pontryagin Minimum Principle 的拓展

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

2. T2

2.1 题目

在这里插入图片描述

2.2 求解

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
Listing1: demo_node.cpp/trajectoryLibrary()

for(int step=0 ; step<=_time_step ; step ++){/*STEP 1: finish the forward integration, the modelling has been given in the documentthe parameter of forward integration: _max_input_acc|_discretize_step|_time_interval|_time_step   all have been givenuse the pos and vel to recored the steps in the trakectory*///使用运动学公式:x=x0+v0t+1/2at^2,v=v0+at//要体现出积分,是accumulate的过程pos(0) = pos(0) + vel(0) * delta_time + 0.5 * acc_input(0) * std::pow(delta_time, 2);pos(1) = pos(1) + vel(1) * delta_time + 0.5 * acc_input(1) * std::pow(delta_time, 2);pos(2) = pos(2) + vel(2) * delta_time + 0.5 * acc_input(2) * std::pow(delta_time, 2);vel(0) = vel(0) + acc_input(0) * delta_time;vel(1) = start_velocity(1) + acc_input(1) * delta_time;vel(2) = start_velocity(2) + acc_input(2) * delta_time;Position.push_back(pos);Velocity.push_back(vel);double coord_x = pos(0);double coord_y = pos(1);double coord_z = pos(2);//check if if the trajectory face the obstacleif(_homework_tool->isObsFree(coord_x,coord_y,coord_z) != 1){collision = true;}
}

在这里插入图片描述
Listing2:hw_tool.cpp/OptimalBVP()

double Homeworktool::OptimalBVP(Eigen::Vector3d _start_position,Eigen::Vector3d _start_velocity,Eigen::Vector3d _target_position)
{double optimal_cost = 1000000; // this just to initial the optimal_cost, you can delete it/*STEP 2: go to the hw_tool.cpp and finish the function Homeworktool::OptimalBVPthe solving process has been given in the documentbecause the final point of trajectory is the start point of OBVP, so we input the pos,vel to the OBVPafter finish Homeworktool::OptimalBVP, the Trajctory_Cost will record the optimal cost of this trajectory*///直接求解一元四次方程Eigen::Matrix<double,4,4> mat44;Eigen::Matrix<complex<double>, Eigen::Dynamic, Eigen::Dynamic> matrix_eigenvalues;//求出一元四次方程的五个系数abcdedouble v_x0 = _start_velocity(0), v_y0 = _start_velocity(1), v_z0 = _start_velocity(2);double dx = _target_position(0) - _start_position(0);double dy = _target_position(1) - _start_position(1);double dz = _target_position(2) - _start_position(2);double v0_square_sum = v_x0*v_x0 + v_y0*v_y0 + v_z0*v_z0;double v0_dp_sum = v_x0*dx+v_y0*dy+v_z0*dz;double dp_square_sum = dx*dx + dy*dy + dz*dz;double a = 1.0;double b = 0.0;double c = -4 * v0_square_sum;double d = 24 * v0_dp_sum;double e = -36 * dp_square_sum;mat44 <<0, 0, 0, -e,1, 0, 0, -d,0, 1, 0, -c,0, 0, 1, -b;
//    ROS_INFO_STREAM("\nmatrix_44: \n" << mat44);matrix_eigenvalues = mat44.eigenvalues();
//    ROS_INFO_STREAM("\nmatrix_eigenvalues: \n"<<matrix_eigenvalues);for(int i=0; i<4; ++i) {if(matrix_eigenvalues(i).real() < 0)continue;double T = matrix_eigenvalues(i).real();double tmp_cost = T + 4.0/T * v0_square_sum - 12.0/(std::pow(T,2)) * v0_dp_sum + 12.0/std::pow(T,3) * dp_square_sum;ROS_INFO_STREAM("\nnow optimal_cost=" << optimal_cost <<", tmp_cost= " << tmp_cost);if(tmp_cost < optimal_cost) {ROS_INFO_STREAM("\n======now optimal_cost=" << optimal_cost <<", found lower cost= " << tmp_cost);optimal_cost = tmp_cost;}}ROS_INFO_STREAM("\nreturn optimal_cost=" << optimal_cost);return optimal_cost;
}

在这里插入图片描述

在这里插入图片描述

3. Reference

[1] A Computationally Efficient Motion Primitive for Quadrocopter Trajectory Generation, Mark W. Mueller,
Markus Hehn, and Raffaello D’Andrea.

[2] Dynamic Programming and Optimal Control, D. P. Bertsekas.

[3] https://blog.csdn.net/fb_941219/article/details/102984587

这篇关于【深蓝学院】移动机器人运动规划--第4章 动力学约束下的运动规划--作业的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/710538

相关文章

MySQL数据库约束深入详解

《MySQL数据库约束深入详解》:本文主要介绍MySQL数据库约束,在MySQL数据库中,约束是用来限制进入表中的数据类型的一种技术,通过使用约束,可以确保数据的准确性、完整性和可靠性,需要的朋友... 目录一、数据库约束的概念二、约束类型三、NOT NULL 非空约束四、DEFAULT 默认值约束五、UN

C# Where 泛型约束的实现

《C#Where泛型约束的实现》本文主要介绍了C#Where泛型约束的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧... 目录使用的对象约束分类where T : structwhere T : classwhere T : ne

SpringValidation数据校验之约束注解与分组校验方式

《SpringValidation数据校验之约束注解与分组校验方式》本文将深入探讨SpringValidation的核心功能,帮助开发者掌握约束注解的使用技巧和分组校验的高级应用,从而构建更加健壮和可... 目录引言一、Spring Validation基础架构1.1 jsR-380标准与Spring整合1

SQL中的外键约束

外键约束用于表示两张表中的指标连接关系。外键约束的作用主要有以下三点: 1.确保子表中的某个字段(外键)只能引用父表中的有效记录2.主表中的列被删除时,子表中的关联列也会被删除3.主表中的列更新时,子表中的关联元素也会被更新 子表中的元素指向主表 以下是一个外键约束的实例展示

作业提交过程之HDFSMapReduce

作业提交全过程详解 (1)作业提交 第1步:Client调用job.waitForCompletion方法,向整个集群提交MapReduce作业。 第2步:Client向RM申请一个作业id。 第3步:RM给Client返回该job资源的提交路径和作业id。 第4步:Client提交jar包、切片信息和配置文件到指定的资源提交路径。 第5步:Client提交完资源后,向RM申请运行MrAp

动态规划---打家劫舍

题目: 你是一个专业的小偷,计划偷窃沿街的房屋。每间房内都藏有一定的现金,影响你偷窃的唯一制约因素就是相邻的房屋装有相互连通的防盗系统,如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警。 给定一个代表每个房屋存放金额的非负整数数组,计算你 不触动警报装置的情况下 ,一夜之内能够偷窃到的最高金额。 思路: 动态规划五部曲: 1.确定dp数组及含义 dp数组是一维数组,dp[i]代表

poj 3159 (spfa差分约束最短路) poj 1201

poj 3159: 题意: 每次给出b比a多不多于c个糖果,求n最多比1多多少个糖果。 解析: 差分约束。 这个博客讲差分约束讲的比较好: http://www.cnblogs.com/void/archive/2011/08/26/2153928.html 套个spfa。 代码: #include <iostream>#include <cstdio>#i

软考系统规划与管理师考试证书含金量高吗?

2024年软考系统规划与管理师考试报名时间节点: 报名时间:2024年上半年软考将于3月中旬陆续开始报名 考试时间:上半年5月25日到28日,下半年11月9日到12日 分数线:所有科目成绩均须达到45分以上(包括45分)方可通过考试 成绩查询:可在“中国计算机技术职业资格网”上查询软考成绩 出成绩时间:预计在11月左右 证书领取时间:一般在考试成绩公布后3~4个月,各地领取时间有所不同

poj 3169 spfa 差分约束

题意: 给n只牛,这些牛有些关系。 ml个关系:fr 与 to 牛间的距离要小于等于 cost。 md个关系:fr 与 to 牛间的距离要大于等于 cost。 隐含关系: d[ i ] <= d[ i + 1 ] 解析: 用以上关系建图,求1-n间最短路即可。 新学了一种建图的方法。。。。。。 代码: #include <iostream>#include

poj 2976 分数规划二分贪心(部分对总体的贡献度) poj 3111

poj 2976: 题意: 在n场考试中,每场考试共有b题,答对的题目有a题。 允许去掉k场考试,求能达到的最高正确率是多少。 解析: 假设已知准确率为x,则每场考试对于准确率的贡献值为: a - b * x,将贡献值大的排序排在前面舍弃掉后k个。 然后二分x就行了。 代码: #include <iostream>#include <cstdio>#incl