当前位置:网站首页>[coppeliasim] 6-DOF path planning
[coppeliasim] 6-DOF path planning
2022-07-06 02:12:00 【Ten year dream laboratory】
function sysCall_threadmain()
robotHandle=sim.getObjectHandle('Start')-- obtain dummy:Start The handle of
targetHandle=sim.getObjectHandle('End')-- Get the target dummy:End The handle of
t=simOMPL.createTask('t')-- establish OMPL Planning tasks t
ss={simOMPL.createStateSpace('6d',simOMPL.StateSpaceType.pose3d,robotHandle,{-1,-0.5,0},{1,0.5,1},1)}-- Create state space :6d, State space type - Posture 3d,Start The handle of , The border {x,y,z}->{X,Y,Z}, The weight 1
simOMPL.setStateSpace(t,ss)-- Set up tasks t State space of ss
simOMPL.setAlgorithm(t,simOMPL.Algorithm.RRTConnect)-- Set algorithm
simOMPL.setCollisionPairs(t,{sim.getObjectHandle('L_start'),sim.handle_all})-- Set up collision er Collision ee
startpos=sim.getObjectPosition(robotHandle,-1)-- take The starting position
startorient=sim.getObjectQuaternion(robotHandle,-1)-- Take the starting direction
startpose={startpos[1],startpos[2],startpos[3],startorient[1],startorient[2],startorient[3],startorient[4]}-- Initial pose state : Position and quaternion
simOMPL.setStartState(t,startpose)-- Set the initial pose state
goalpos=sim.getObjectPosition(targetHandle,-1)-- Target location
goalorient=sim.getObjectQuaternion(targetHandle,-1)-- Target attitude
goalpose={goalpos[1],goalpos[2],goalpos[3],goalorient[1],goalorient[2],goalorient[3],goalorient[4]}-- Target pose status
simOMPL.setGoalState(t,goalpose)-- Set the target pose state
r,path=simOMPL.compute(t,20,-1,200)-- Calculation :20——> Calculate the path finder in seconds. Maximum time , Maximum time to simplify the path -1 Indicates the default time ,minimum number of states to be returned The minimum number of States to return 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. Path state set
while true do
-- Simply jump through the path points, no interpolation here:
for i=1,#path-7,7 do-- Every time 7 state Move
pos={path[i],path[i+1],path[i+2]}-- Location
orient={path[i+3],path[i+4],path[i+5],path[i+6]}-- Attitude quaternion
sim.setObjectPosition(robotHandle,-1,pos)-- Set up mobile Start The location of
sim.setObjectQuaternion(robotHandle,-1,orient)-- Set posture
sim.switchThread()-- Switching thread
end
end
end
边栏推荐
- 500 lines of code to understand the principle of mecached cache client driver
- Bidding promotion process
- I like Takeshi Kitano's words very much: although it's hard, I will still choose that kind of hot life
- [flask] official tutorial -part3: blog blueprint, project installability
- Paddle framework: paddlenlp overview [propeller natural language processing development library]
- 竞赛题 2022-6-26
- A basic lintcode MySQL database problem
- VIM usage guide
- Leetcode3. Implement strstr()
- Leetcode3, implémenter strstr ()
猜你喜欢
Initialize MySQL database when docker container starts
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Executing two identical SQL statements in the same sqlsession will result in different total numbers
The intelligent material transmission system of the 6th National Games of the Blue Bridge Cup
[flask] official tutorial -part3: blog blueprint, project installability
How does redis implement multiple zones?
[flask] official tutorial -part2: Blueprint - view, template, static file
Using SA token to solve websocket handshake authentication
Know MySQL database
插卡4G工业路由器充电桩智能柜专网视频监控4G转以太网转WiFi有线网速测试 软硬件定制
随机推荐
01.Go语言介绍
[width first search] Ji Suan Ke: Suan tou Jun goes home (BFS with conditions)
729. 我的日程安排表 I / 剑指 Offer II 106. 二分图
Overview of spark RDD
[Jiudu OJ 09] two points to find student information
leetcode3、實現 strStr()
Redis daemon cannot stop the solution
阿里测开面试题
Multi function event recorder of the 5th National Games of the Blue Bridge Cup
Folio. Ink is a free, fast and easy-to-use image sharing tool
2 power view
Accelerating spark data access with alluxio in kubernetes
Sword finger offer 12 Path in matrix
Ali test open-ended questions
一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
Global and Chinese markets of nasal oxygen tubes 2022-2028: Research Report on technology, participants, trends, market size and share
Kubernetes stateless application expansion and contraction capacity
Blue Bridge Cup embedded_ STM32 learning_ Key_ Explain in detail
安装php-zbarcode扩展时报错,不知道有没有哪位大神帮我解决一下呀 php 环境用的7.3
Basic operations of databases and tables ----- default constraints