当前位置:网站首页>[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
边栏推荐
- 02. Go language development environment configuration
- Folio. Ink is a free, fast and easy-to-use image sharing tool
- Adapter-a technology of adaptive pre training continuous learning
- I like Takeshi Kitano's words very much: although it's hard, I will still choose that kind of hot life
- Redis list
- 在线怎么生成富文本
- 01.Go语言介绍
- Paddle框架:PaddleNLP概述【飛槳自然語言處理開發庫】
- Selenium element positioning (2)
- Computer graduation design PHP campus restaurant online ordering system
猜你喜欢
selenium 等待方式
Overview of spark RDD
Redis-列表
安装php-zbarcode扩展时报错,不知道有没有哪位大神帮我解决一下呀 php 环境用的7.3
Kubernetes stateless application expansion and contraction capacity
The intelligent material transmission system of the 6th National Games of the Blue Bridge Cup
Leetcode sum of two numbers
0211 embedded C language learning
dried food! Accelerating sparse neural network through hardware and software co design
Redis如何实现多可用区?
随机推荐
Publish your own toolkit notes using NPM
Leetcode3. Implement strstr()
Ali test open-ended questions
同一个 SqlSession 中执行两条一模一样的SQL语句查询得到的 total 数量不一样
Minecraft 1.16.5 生化8 模组 2.0版本 故事书+更多枪械
Accelerating spark data access with alluxio in kubernetes
【网络攻防实训习题】
Apicloud openframe realizes the transfer and return of parameters to the previous page - basic improvement
Derivation of Biot Savart law in College Physics
【机器人库】 awesome-robotics-libraries
02.Go语言开发环境配置
dried food! Accelerating sparse neural network through hardware and software co design
Initialize MySQL database when docker container starts
Bidding promotion process
PHP campus financial management system for computer graduation design
Pangolin Library: subgraph
国家级非遗传承人高清旺《四大美人》皮影数字藏品惊艳亮相!
Redis string type
【社区人物志】专访马龙伟:轮子不好用,那就自己造!
【clickhouse】ClickHouse Practice in EOI