当前位置:网站首页>【coppeliasim】6自由度路径规划
【coppeliasim】6自由度路径规划
2022-07-06 02:00:00 【十年一梦实验室】
function sysCall_threadmain()
robotHandle=sim.getObjectHandle('Start')--获取dummy:Start的句柄
targetHandle=sim.getObjectHandle('End')--获取目标dummy:End的句柄
t=simOMPL.createTask('t')--创建OMPL规划任务t
ss={simOMPL.createStateSpace('6d',simOMPL.StateSpaceType.pose3d,robotHandle,{-1,-0.5,0},{1,0.5,1},1)}--创建状态空间:6d,状态空间类型-姿态3d,Start的句柄,边界{x,y,z}->{X,Y,Z},权重1
simOMPL.setStateSpace(t,ss)--设置任务t的状态空间ss
simOMPL.setAlgorithm(t,simOMPL.Algorithm.RRTConnect)--设置算法
simOMPL.setCollisionPairs(t,{sim.getObjectHandle('L_start'),sim.handle_all})--设置碰撞er 碰撞ee
startpos=sim.getObjectPosition(robotHandle,-1)--取 起始位置
startorient=sim.getObjectQuaternion(robotHandle,-1)--取起始方向
startpose={startpos[1],startpos[2],startpos[3],startorient[1],startorient[2],startorient[3],startorient[4]}--起始位姿状态:位置和四元数
simOMPL.setStartState(t,startpose)--设置起始位姿状态
goalpos=sim.getObjectPosition(targetHandle,-1)--目标位置
goalorient=sim.getObjectQuaternion(targetHandle,-1)--目标姿态
goalpose={goalpos[1],goalpos[2],goalpos[3],goalorient[1],goalorient[2],goalorient[3],goalorient[4]}--目标位姿状态
simOMPL.setGoalState(t,goalpose)--设置目标位姿状态
r,path=simOMPL.compute(t,20,-1,200)--计算:20——>计算路径查找程序in seconds.最大时间,用于简化路径的最大时间-1表示默认时间,minimum number of states to be returned最少要返回的状态数200
--r=true: true if a solution has been found
--path: a table of states, representing the solution, from start to goal. States are specified linearly.路径状态集合
while true do
-- Simply jump through the path points, no interpolation here:
for i=1,#path-7,7 do--每7状态 动一下
pos={path[i],path[i+1],path[i+2]}--位置
orient={path[i+3],path[i+4],path[i+5],path[i+6]}--姿态四元数
sim.setObjectPosition(robotHandle,-1,pos)--设置移动Start的位置
sim.setObjectQuaternion(robotHandle,-1,orient)--设置姿态
sim.switchThread()--切换线程
end
end
end边栏推荐
- Unreal browser plug-in
- [width first search] Ji Suan Ke: Suan tou Jun goes home (BFS with conditions)
- Leetcode3. Implement strstr()
- NLP fourth paradigm: overview of prompt [pre train, prompt, predict] [Liu Pengfei]
- module ‘tensorflow. contrib. data‘ has no attribute ‘dataset
- Competition question 2022-6-26
- Know MySQL database
- VIM usage guide
- Ali test open-ended questions
- How to use C to copy files on UNIX- How can I copy a file on Unix using C?
猜你喜欢

论文笔记: 图神经网络 GAT

Exness: Mercedes Benz's profits exceed expectations, and it is predicted that there will be a supply chain shortage in 2022

Campus second-hand transaction based on wechat applet

Prepare for the autumn face-to-face test questions

2 power view
![[solution] every time idea starts, it will build project](/img/fc/e68f3e459768abb559f787314c2124.jpg)
[solution] every time idea starts, it will build project

1. Introduction to basic functions of power query

NLP第四范式:Prompt概述【Pre-train,Prompt(提示),Predict】【刘鹏飞】

It's wrong to install PHP zbarcode extension. I don't know if any God can help me solve it. 7.3 for PHP environment

Card 4G industrial router charging pile intelligent cabinet private network video monitoring 4G to Ethernet to WiFi wired network speed test software and hardware customization
随机推荐
Computer graduation design PHP animation information website
[flask] static file and template rendering
Folio. Ink is a free, fast and easy-to-use image sharing tool
Redis-列表
Visualstudio2019 compilation configuration lastools-v2.0.0 under win10 system
leetcode-两数之和
Get the relevant information of ID card through PHP, get the zodiac, get the constellation, get the age, and get the gender
【Flask】响应、session与Message Flashing
Adapter-a technology of adaptive pre training continuous learning
RDD creation method of spark
Leetcode sum of two numbers
02. Go language development environment configuration
Use image components to slide through photo albums and mobile phone photo album pages
Redis如何实现多可用区?
How to use C to copy files on UNIX- How can I copy a file on Unix using C?
同一个 SqlSession 中执行两条一模一样的SQL语句查询得到的 total 数量不一样
leetcode3、实现 strStr()
Online reservation system of sports venues based on PHP
This time, thoroughly understand the deep copy
Flutter Doctor:Xcode 安装不完整