V-rep学习笔记:Geometric Constraint Solver(几何约束求解)

2023-11-16

  The geometric constraint solver is slower and less precise at solving kinematic problems, but might be easier and more intuitive to use. Moreover, it allows interacting with a mechanism in a more flexible way than the inverse kinematics calculation module. Following figures illustrate the geometric constraint solver applied to a complicated mechanism:

 

[Geometric constraint solver handling a complicated mechanism:  (1) initial situation, (2) during simulation, (3) interaction with the mechanism]

 

  V-REP's geometric constraint solver functionality operates in a similar way as the kinematics calculation module, with the difference that the solver will try to automatically identify kinematic chains, and handle them in an appropriate way (automatic constraint adjustments, loop closures, etc.). Typically, the user has to tell the solver:

  • which objects (dummies) should coincide (in order to close a loop for instance)
  • what mechanism has to be handled by the geometric constraint solver
  • which additional constraints should be applied to the mechanism

 

 Specifying closure constraints 

  Closure constraints can be seen as constraints that require two object's configurations (position and orientation) to be identical. The idea is illustrated in following figures:

[The geometric constraint solver closure constraint]

[Closing action of the geometric constraint solver (1) intermediate situation, (2) final situation]

  GCS会试图将closure pair的位置以及姿态重合,因此机构要有足够的自由度。对于平面机构(如铰链四杆机构)来说使用GCS保持机构闭合就不合适,可以考虑用IK,tip-target来构成闭环。The geometric constraint solver will try to overlap the position and orientation of the two objects while trying to keep the mechanism coherent (i.e. by only adjusting the joints in IK mode in the mechanism to reach that overlap situation). The objects that the geometric constraint solver uses to specify closure constraints are dummies. To this end, two dummies need to be marked as closure pair. This can be adjusted in the dummy properties by selecting the opposite dummy as Linked dummy and specifying GCS, overlap constraint for the Link type. Following figure illustrates two linked dummies specifying a geometric constraint solver closure constraint:

[Two linked dummies specifying a closure constraint]

 

 Specifying the mechanism to be solved 

  All objects that can be reached from a given object by following a path that can go will be considered as the same mechanism: 

  1. from one object to its parent object.
  2. from one object to its child objects.
  3. from one dummy to its linked dummy (however only links of type GCS, overlap constraint)

  即按照上面3种方式从运动链(elements)上某一点开始探索,能够到达的节点都属于同一个机构。如果两个运动链没有公共的节点,但是由类型为GCS,overlap constraint的dummy相连,则这两个运动链仍属于同一个机构。Two object trees that don't share any common parent objects (referred hereafter as elements), can also be part of the same mechanism if two linked dummies join them. This is illustrated in following figure:

[One mechanism composed by 3 elements (object trees)]

  The last parent object of the object that is chosen as the starting point of the mechanism exploration (path exploration) is referred to as the base object of the mechanism. When the geometric constraint solver tries to solve a mechanism, it will try to do so by keeping the base object of the mechanism in place(求解几何约束时选作base的object会固定住不动). This is important to remember. To specify a mechanism to be solved, select an object parented with the base object of the mechanism and in the geometric constraint solver dialog click insert new object. One same mechanism can only be registered once for solving. Mechanisms that do not include at least one joint in IK mode will not be handled by the solver.

 

 Specifying additional constraints 

  Additional positional constraints can be specified for a mechanism. This can be done with two linked dummies that form a tip-target pair (specify GCS, tip/GCS, target as Link type in the dummy properties). Following figures illustrate two linked dummies, where one is marked as target:

[The geometric constraint solver position constraint]

  注意GCS, tip/GCS, target与GCS, overlap constraint的区别是:GCS, target不会被当做机构的一部分,解算时target不动tip移动到与target重合;而GCS, overlap constraint类型的dummy则属于同一个机构,解算时会同时移动直到重合。The dummy marked as target is not considered as part of the mechanism and therefore will not move during geometric constraint resolution, while the other dummy will try to reach the same position as the dummy marked as target.

[Position constraint action of the geometric constraint solver (1) intermediate situation, (2) final situation]

 

  使用GCS(几何约束求解器),可以用鼠标拖动场景中的物体进行直观地控制。During simulation, a mechanism that was previously registered to be solved with the geometric constraint solver can be manipulated in a flexible way with the mouse, when the mechanism navigation mode is selected. That mode can be enabled via following API call: simSetNavigationModeSimply click and drag any shape object that is part of the mechanism, and the solver will try to take into account that additional position constraint.

[Mechanism with two additional position constraints]

  It is good practice to build your mechanism as a tree structure (i.e. where all objects in the mechanism have at least one common parent object) and have linked dummies be in charge of closing certain tree branches. By doing so you reduce the mechanism's complexity, you simplify the mechanism's scene hierarchy representation, and you will be able to handle the mechanism as a model. 

  下面是一个简单的例子,用鼠标选中门并按住左键拖动,可以看到门能跟着鼠标运动。修改Model browser/Models/infrastructure/doors/manual door中的场景和代码,添加一个控制球和一组Dummy(类型分别设置为GCS, tip/GCS, target),然后在Calculation Modules的Geometric Constraint Solver选项页中将根节点door设为机构的base 。最后将旋转关节设为Inverse kinematics模式,进行仿真:

   代码如下:

if (sim_call_type==sim_childscriptcall_initialization) then 

    jointHandle=simGetObjectHandle('_doorJoint')
    sphereHandle=simGetObjectHandle('manipulationSphere')

    -- Retrieves the navigation and selection mode for the mouse
    initialMode=simGetNavigationMode() 

    -- Sets the navigation and selection mode for the mouse. 
    simSetNavigationMode(sim_navigation_objectshift+
                            sim_navigation_clickselection+
                            sim_navigation_ctrlselection+
                            sim_navigation_shiftselection+
                            sim_navigation_camerazoomwheel+
                            sim_navigation_camerarotaterightbutton)

    tipDummyHandle=simGetObjectHandle('tip')

    -- sim_intparam_prox_sensor_select_down: Allows to enable message or callback generation when a shape 
    -- was clicked (down-click) in the scene. The click is a "geometric" click. This value is set to zero 
    -- at simulation start and simulation stop.
    -- (-1: enabled for all visible shapes in the scene)
    simSetInt32Parameter(sim_intparam_prox_sensor_select_down, -1)  

    simDisplayDialog("info","You can click and drag the door",sim_dlgstyle_ok,false)

end 



if (sim_call_type==sim_childscriptcall_sensing) then

    -- auxiliaryData[1]: objectID
    -- auxiliaryData2[1] ~ auxiliaryData2[3]: coordinates of clicked point
    local message,data,data2 = simGetSimulatorMessage()

    while message>-1 do  -- (-1 if no message is available or in case of an error)
        if message == sim_message_prox_sensor_select_down then

            -- move manipulation sphere according the position of clicked point
            simSetObjectPosition(sphereHandle,-1,{data2[1],data2[2],data2[3]}) 

            simSetObjectPosition(tipDummyHandle,-1,{data2[1],data2[2],data2[3]})
            simSetObjectParent(tipDummyHandle, data[1], true)

            -- select the manipulation sphere to move
            simRemoveObjectFromSelection(sim_handle_all)
            simAddObjectToSelection(sim_handle_single,sphereHandle)
        end
        message,data,data2 = simGetSimulatorMessage()
    end
end



if (sim_call_type==sim_childscriptcall_cleanup) then 
    simRemoveObjectFromSelection(sim_handle_all) -- removes all objects from the selection
    simSetInt32Parameter(sim_intparam_prox_sensor_select_down, 0) -- 0: disabled
    simSetNavigationMode(initialMode)
end 
View Code

   下面是一个修改自V-REP_PRO_EDU\scenes\constraintSolverExample.ttt的例子,用鼠标选中机构上任意杆件进行拖拽,可以看到机构能跟着一起运动而不散开:

 Geometric constraint solver operation 

  When building a mechanism that will be solved by the geometric constraint solver, make sure that the mechanism is coherent and that constraints are not impossible (i.e. that there are enough degrees of freedom for the mechanism to work). Following figures show an example of a mechanism and its resolution:

 

[(1) Mechanism containing 3 elements before and (2) during simulation]

 

[Same mechanism, but different base object (1) before and (2) during simulation]

 

[(1) Mechanism containing 2 elements before and (2) during simulation]

 

 

 

 

参考:

Using the geometric constraint solver

Solving IK and FK for any type of mechanism

Good example of GCS?

control the model using mouse in simulation mode

V-rep学习笔记:曲柄摇杆机构

V-rep学习笔记:并联机构正逆运动学

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

V-rep学习笔记:Geometric Constraint Solver(几何约束求解) 的相关文章

  • Lua代码提示和方法跳转

    前言 当在一个大型工程中编写大量的lua脚本时 代码提示和方法跳转等功能很实用 据我所了解的目前除LuaStudio之外 似乎还没有一个很好的编辑器 但今天讲述的是Idea EmmyLua插件 达到很强大的功能 我的使用环境 idea 20
  • centos7 基础命令

    一 linux基础 1 查看服务器的IP信息 ip add showifconfig 2 操作网卡命令 重启网络和启用网卡 systemctl restart networksystemctl start networksystemctl
  • Visual Studio Code如何打开多个tab标签

    原创 Visual Studio Code如何打开多个tab标签 SweetTool的专栏 CSDN博客 在打开文件夹预览的模式下VS Code默认单击打开文件时仅保存一个tab 例如当前window打开一个tabA 然后点击另外一个文件B
  • CSDN编辑一些代码

    图片居中 只需要在图片下方代码页最后的括号内加上 pic center即可
  • 【JEECG技术博文】简单实例讲解JEECG ONLINE表单权限控制(jeecg3.6)

    简单实例讲解JEECGONLINE表单权限控制 jeecg3 6 原文 http blog itpub net 30066956 viewspace 1872409 相关博文 http blog itpub net 30066956 vie
  • tomcat没有日志输出--解决办法

    程序没有问题 只是控制台信息卡 感觉像程序休眠了一样 然后在控制台点backspace或是enter 程序恢复正常 控制台日志正常输出 静态文件访问可以 解决办法 转载于 https blog 51cto com 13693838 2398
  • Java Eclipse进行断点调试

    如何调试Java程序 大家最开始学习Java 都会觉得IDE调试好高端有木有 其实很简单了 下文会尽量简单直观的教会你在Eclipse中调试 其他的IDE调试步骤也是类似的 1 在你觉得有错的地方设置断点 在代码行数前 点击右键 注意是右键
  • [转] 解读IntelliJ IDEA的优缺点

    昨天去TW参加了pre class 就是类似于新员工入职前的培训 有很多很cool的东西 给我印象最深的就是IntelliJ IDEA了 coder么 刚才在网上搜了搜 发现很少有她的介绍资料 所以贴过来一个让大家看看 文章中有一句话值得大
  • IntelliJ IDEA中代码被覆盖了怎么恢复

    在你git pull 拉去代码的时候 在IntelliJ IDEA中一不小心将你本地代码给覆盖了 这个时候 你撤回是无效的时候 是不是有点小激动 还有点小慌 辛辛苦苦写的代码没啦 被覆盖了 不要慌 只要用的是IntelliJ IDEA这个工
  • E:Package 'Vim' has no installation candidate问题解决

    不多说 直接上干货 问题描述 root zhouls virtual machine apt get install vim Reading package lists DoneBuilding dependency tree Readin
  • org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

    idea下Maven项目 Spring Mybatis 查询时报错 org apache ibatis binding BindingException Invalid bound statement not found 解决方案 org
  • 常用的IDEA插件

    IDEA是程序员用的最多的开发工具 很多程序员想把它打造成一站式开发工具 于是安装了各种各样的插件 通过插件在IDEA中完成各种操作 无需安装其他软件 确实很方便 今天给大家分享下我平时常用的IDEA插件 个个是精品 Key Promote
  • pycharm内存不足时如何修改设置?

    Help gt Find Action gt type VM Options gt Click Edit Custom VM Options Pycharm 2016 2 will open the appropriate vmoption
  • visual studio2019(C#/.NET)安装教程

    前言 好久没有跟新版本了 博主还用的2017 看到最新的2019功能还是很强大的 版本可能越高越好 所以博主写了一个详细的博客 希望可以帮助到大家 一 visual studio 2019 下载 1 下载地址 visual studio官方
  • Sublime Text 常用快捷键

    文章目录 通用 General 编辑 Editing 选择 Selecting 查找 替换 Finding Replacing 跳转 Jumping 窗口 Window 屏幕 Screen 工欲善其事 必先利其器 本文收集 Sublime
  • Matplotlib画条形图和柱形图并添加数据标注

    这里放上我比较喜欢的一种条形图设置 使用的是之前爬取的重庆地区链家二手房数据 数据如下 链接 https pan baidu com s 17CMwUAdseO8tJWHEQiA8 A 提取码 dl2g import pandas as p
  • Selenium2+python自动化10-登录案例

    前言 前面几篇都是讲一些基础的定位方法 没具体的案例 小伙伴看起来比较枯燥 有不少小伙伴给小编提建议以后多出一些具体的案例 本篇就是拿部落论坛作为测试项目 写一个简单的登录测试脚本 在写登录脚本的时候呢 先要保证流程能跑起来 然后才是去想办
  • Java代码生成器Easy Code

    EasyCode是基于IntelliJ IDEA开发的代码生成插件 支持自定义任意模板 Java html js xml 只要是与数据库相关的代码都可以通过自定义模板来生成 支持数据库类型与java类型映射关系配置 支持同时生成生成多张表的
  • Visual Studio和idea自用快捷键

    写代码不停的在键盘与鼠标之间切换真的是非常影响心情 多学点快捷键 一能服务自己 二能在妹子前耍帅 何乐不为 因为自己还是菜鸡一个 很多功能自己还用不到 所以先贴上几个自己常用的还有想用的吧 网上的太全了自己看着也不方便 VS Studio快
  • 远程控制 ToDesk

    ToDesk 远程控制软件 支持跨平台的远程控制 有且不限于PC对PC iOS Android也可以直接控制 最近发现的一个好用的远程连接软件 也是近些年非常火热的 远程控制软件 ToDesk 虽然 QQ 和 向日葵 也都可以满足我们实现的

随机推荐

  • 攻防世界-MISC-练习区-12(功夫再高也怕菜刀)

    题目描述 菜狗决定用菜刀和菜鸡决一死战 这是攻防世界里面训练区的一道流量分析题 用wireshark 打开流量包 然后一级搜索http 二级用分组字节流搜索flag 按CTRL F 并找到no 1367 在Line based text d
  • 移动NB模块M5311(lwm2m协议登录详解)

    身为一个通信专业大三狗 第一次和别人对接项目今天属于我的功能总算是结束了 接下来就是等待联调 心情愉悦 首先NB是什么 这个我就不详细的解释了 我相信大多数人看这篇文章是以实践为开始的 那么多余的就不说了 接下来说具体流程 首先M5311模
  • 确实有必要好好学英语

    前言 工作已经6年多了 最近忽然明悟一些道理 零度觉得分享出来可能可以帮助一些人 这些道理可能很多成功的 牛逼的人早就知道这些了 随着技术的迭代更新越来越快 新技术不断产生 很多很多人都在焦虑 但是有一个道理的确是这样的 你不学习 未来终将
  • 【微信小程序】项目开发-----百度翻译API接口开发微信翻译小程序

    开发环境 微信开发者工具 V1 02 1902010版本以上 开发语言 JavaSript语言 HTML语言 API接口 百度翻译开发平台开放接口 界面预览 开发 基础配置 1 app js App onLaunch function 展示
  • AVPlay播放视频

    property nonatomic retain nullable AVPlayer player NSString urlStr NSBundle mainBundle pathForResource demo mp4 ofType n
  • 将灰度图片转成三通道(RGB)图片(MatLab)

    运行程序报错 RuntimeError output with shape 1 224 224 doesn t match the broadcast shape 3 224 224 报错原因 原模型输入的图片为RGB三通道 我输入的为单通
  • pytorch混合常量、变量

    有矩阵 X R n d X in R n times d
  • 蓝桥杯2015年第六届真题-赢球票

    题目 题目链接 题解 暴力 模拟 枚举每次从哪个位置开始 也就是有n种情况要枚举 对于每一种情况 我们都模拟这个过程 更新最大值 取牌操作结束的条件是还未被取走的数中的最大值都小于报的数了 说明没有办法取走任何一张了 此时结束 注意答案要求
  • docker安装rabbitmq

    1 准备 需要安装好docker环境 可以阅读文章在Centos和Redhat上安装Docker 小帅虎丶丿的博客 CSDN博客 学习如何安装docker 需要安装docker compose 了解yaml格式文件的编写以及一些常用的doc
  • 【python】如何使python中线程等待其他线程完了再执行;python-threading中的join方法;python的thread库如何判断子线程所绑定的函数全部执行完毕?

    1 主要方法 让所有的子线程都join 就可以了 不用join 的时候是这样的 用了join 之后是这样的 2 案例一 1 没有join import threading time def fun print 线程开始 print 我是线程
  • 国内几个主要的ubuntu 18.04 软件源

    1 阿里源 deb http mirrors aliyun com ubuntu bionic main restricted universe multiverse deb http mirrors aliyun com ubuntu b
  • R如何正确动态创建变量名,解决target of assignment expands to non-language object

    在一个群里 看到一位朋友发了一堆代码 错误代码 以及一个报错信息 Error in paste could not find function paste 还有一个target of assignment expands to non la
  • C++ 文档加密与解密运用【Crypto++】库

    一 下载Cryptopp 鼠标放到下面网址 点击下载即可 github地址 8 7 0版本 https github com weidai11 cryptopp releases tag CRYPTOPP 8 7 0 二 下载PEM包 pe
  • [1100]rocketmq详解

    文章目录 rocketmq入门 消息队列 rocketmq示例图 rocketmq应用场景 搭建环境 环境安装 Linux RocketMQ下载及安装 RocketMQ目录结构 RocketMQ启动及测试 管理工具 mqadmin管理工具
  • Navicat系列软件在win10中崩溃/闪退解决办法

    Navicat系列软件在win10中崩溃 在执行query gt run selected 的时候crash 安装了navicat 11的版本 经常在下拉菜单执行的过程中碰到闪退的情况 找过很多版本的安装包 都是如此 操作系统 win10
  • 程序员的关键思维

    在IT行业工作多年 越往后走 越是感觉到需要强调思考的能力 思考是我们底层非常关键的能力 尤其是在脑力密集 知识密集的行业里面显得更加重要 而这些思考的能力到底指的是什么 有没有什么方法论可以作为指导 让我们在日常的工作中不断精进 我最近试
  • [转]如何删除grub恢复windows操作系统的启动

    注 本文特别适合于在windows下已释放Linux所占空间 而启动时仍进入grub引导而不知如何解决的朋友 此文是我自己遇到这个问题时在网上搜到的 在此转载供大家参考 我自己采用的是方法四 确实比较简便 由于windows 2000 wi
  • 移植2- 移植uboot的spl代码

    根据http blog csdn net xiaojiaohuazi article details 8269890来修改 2014 3 2 做到第九步 这步还未做 疑问 uboot应该在BL2时才初始化内存吧 这里为什么这么早就初始化内存
  • 多线程高并发服务器:3个问题

    1 子线程能否关闭监听文件描述符 2 主线程能否关闭通信文件描述符 3 多个子线程共享cfd 会有什么问题发生 解答1 不能 父子线程共享文件描述符 若子进程关闭监听文件描述符之后 第二个子线程Accept时就会出错 Accept的第一个参
  • V-rep学习笔记:Geometric Constraint Solver(几何约束求解)

    The geometric constraint solver is slower and less precise at solving kinematic problems but might be easier and more in