当前位置:网站首页>[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
边栏推荐
- dried food! Accelerating sparse neural network through hardware and software co design
- Flowable source code comments (36) process instance migration status job processor, BPMN history cleanup job processor, external worker task completion job processor
- Kubernetes stateless application expansion and contraction capacity
- Reasonable and sensible
- Redis守护进程无法停止解决方案
- 竞价推广流程
- Redis string type
- Adapter-a technology of adaptive pre training continuous learning
- 【coppeliasim】6自由度路径规划
- Redis key operation
猜你喜欢
dried food! Accelerating sparse neural network through hardware and software co design
Grabbing and sorting out external articles -- status bar [4]
Campus second-hand transaction based on wechat applet
【机器人库】 awesome-robotics-libraries
leetcode-两数之和
selenium 等待方式
Redis如何实现多可用区?
Audio and video engineer YUV and RGB detailed explanation
SPI communication protocol
MySQL lethal serial question 1 -- are you familiar with MySQL transactions?
随机推荐
How to improve the level of pinduoduo store? Dianyingtong came to tell you
Redis守护进程无法停止解决方案
[flask] official tutorial -part3: blog blueprint, project installability
Campus second-hand transaction based on wechat applet
[solution] every time idea starts, it will build project
插卡4G工业路由器充电桩智能柜专网视频监控4G转以太网转WiFi有线网速测试 软硬件定制
Unreal browser plug-in
Flowable source code comments (36) process instance migration status job processor, BPMN history cleanup job processor, external worker task completion job processor
Selenium element positioning (2)
Derivation of Biot Savart law in College Physics
Blue Bridge Cup embedded_ STM32 learning_ Key_ Explain in detail
Minecraft 1.16.5 生化8 模组 2.0版本 故事书+更多枪械
Genius storage uses documents, a browser caching tool
02.Go语言开发环境配置
【网络攻防实训习题】
Reasonable and sensible
SPI communication protocol
2022年版图解网络PDF
National intangible cultural heritage inheritor HD Wang's shadow digital collection of "Four Beauties" made an amazing debut!
TrueType字体文件提取关键信息