📄 motion-api.sgml
字号:
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN" "docbook/dtd/4.1/docbook.dtd" [<!ENTITY orocos "<acronym>Orocos</acronym>">]><article><articleinfo> <title> Motion API </title> <author> <firstname>Herman</firstname> <surname>Bruyninckx</surname> <affiliation> <address> Herman.Bruyninckx(at)mech.kuleuven.ac.be </address> </affiliation> </author> <author> <firstname>Johan</firstname> <surname>Rutgeerts</surname> <affiliation> <address> Johan.Rutgeerts(at)mech.kuleuven.ac.be </address> </affiliation> </author> <author> <firstname>Wim</firstname> <surname>Meeussen</surname> <affiliation> <address> Wim.Meeussen(at)mech.kuleuven.ac.be </address> </affiliation> </author> <copyright> <year>2003–2004</year> <holder>Herman Bruyninckx —Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU General Public License(<ulink url="http://www.fsf.org/copyleft/gpl.html">http://www.fsf.org/copyleft/gpl.html</ulink>), where the <emphasis>source code</emphasis> of the document is the <ulink url="motion-api.xml">XML file</ulink>. </holder> </copyright> <abstract> <para> <emphasis role="strong">Abstract</emphasis> </para> <para>This document describes the<ulink url="deep-shallow-api.html">application programming interface</ulink>(“API”) for the<emphasis role="strong">motion specification</emphasis> ofone single rigid body, and of “motion devices” driven by<ulink url="kindyn-doc.html">kinematic chains</ulink>,<emphasis>i.e.</emphasis> robots and machine tools.The motion API contains the instructions that program amotion controller to move the rigid body or the device's tool from point“<emphasis>A</emphasis>” to point“<emphasis>B</emphasis>”.In addition, the API includes specifications for motions that aregenerated on-line via sensor inputs; for example, force- ordistance-controlled “compliant motion”, visual servoing,potential-field based motion, etc. </para> <para><ulink url="interpolation-api.html">Another document</ulink> discussesthe basic algorithms and the corresponding API for motion<emphasis>interpolation</emphasis>.(A forthcoming document will discuss how the specified motions can be<emphasis>controlled</emphasis>.) </para> </abstract> <revhistory> <revision> <revnumber>0.01</revnumber> <date>May 24, 2003</date> <authorinitials>HB, JR, WM</authorinitials> </revision> <revision> <revnumber>0.02</revnumber> <date>July 22, 2003</date> <authorinitials>HB</authorinitials> <revremark> </revremark> </revision> <revision> <revnumber>0.03</revnumber> <date>August 10, 2003</date> <authorinitials>HB</authorinitials> <revremark>Heavily reworked. Put more structure and content in the motionplanning and motion interpolation sections. </revremark> </revision> <revision> <revnumber>0.04</revnumber> <date>August 21, 2003</date> <authorinitials>HB</authorinitials> <revremark>Added more details for trapezoidal acceleration interpolator, and forthe interpolator API. </revremark> </revision> <revision> <revnumber>0.05</revnumber> <date>August 26, 2003</date> <authorinitials>HB</authorinitials> <revremark>Started to incorporate figures and code for some interpolators. </revremark> </revision> <revision> <revnumber>0.06</revnumber> <date>April 19, 2004</date> <authorinitials>HB</authorinitials> <revremark>Exported the material in interpolation to a<ulink url="interpolation-api.html">separate document</ulink>.Added <link linkend="synchronized-path"><parameter>SynchronizedPath</parameter></link>,<link linkend="motion-task"><parameter>MotionTask</parameter></link>.Extended the data, execution and configuration flow discussion. </revremark> </revision> </revhistory></articleinfo><section id="overview"><title>What is “motion”?</title><para>Robots and machine tools are basically <emphasis>motiondevices</emphasis>: they haveseveral motors with which their wheels, sliders and/or joints can bemoved, and the goal of these motor motions is to position one or moreof the device's “<emphasis role="strong">tools</emphasis>”(or “<emphasis role="strong">end effectors</emphasis>”) in a prescribed way in the environment. This text is about aprogramming interface to instruct the device toperform a desired motion, or a set of subsequent motions, for one ormore of its tools. These tools can beattached in various places on the device's body, and need notnecessarily <emphasis>act</emphasis> on the environment: they can alsobe sensors, or interface apparatus (speaker, screen, animated face,…) to interact with people.</para><para>In the simplest case, the specification of a desired motion need not takeinto account on which machine the motion will be executed. But, ingeneral, the following aspects of the device do <emphasis role="strong">influence the execution</emphasis> of themotion specification:<itemizedlist><listitem><para>the <ulink url="kindyn-doc.html">kinematics</ulink> of the device. Forexample, the programmer wants to avoid to come close to the kinematicsingularities; or he wants to optimize the energy consumption or another <emphasis role="strong">optimization criterion</emphasis>.</para></listitem><listitem><para>the <ulink url="orocos-control-kernel.html">controller</ulink> of thedevice. For example, for a device that runs under<emphasis>impedance control</emphasis>, theexecuted motion depends not only on the desired motiongeometry, but also on the the virtual impedance that the robotcontroller tries to mimic.</para></listitem><listitem><para>the <emphasis role="strong">sensors</emphasis> with which the devicecan inspect its environment allow the device to adapt its actions towhat it “sees”, i.e., it calculates its next motionsetpoint taking into account the acquired sensor information.</para></listitem></itemizedlist>This text talks about the “simple”<emphasis role="strong">motion specification interface</emphasis>,<emphasis>i.e.</emphasis> without taking into account thedevice-specific aspects that influence the<emphasis>execution</emphasis> of the specified motion.</para><para>The following Sections explain the two major complementary categoriesof motion specification: the motion is specified in<link linkend="joint-cartesian">joint space or in Cartesianspace</link>, or the motion setpoints come <link linkend="planning-interpolation">from a planner or from aninterpolator</link>.</para><section id="joint-cartesian"><title>Joint space vs. Cartesian space</title><para>Motion specification must take into account the following twocomplementary sets of physical properties:<itemizedlist><listitem><para><emphasis role="strong">Joint space properties.</emphasis>These are the properties of the relationships between end-effectormotion or force on the one hand, and the corresponding joint motionand force on the other hand. That is, the <emphasisrole="strong">internal</emphasis> motion properties of the kinematicchain, irrespective of what task the device must perform. </para></listitem><listitem><para><emphasis role="strong">Cartesian space properties.</emphasis>These are the properties of the“<emphasis role="strong">external</emphasis>” motion taskthat the device is asked to perform, <emphasis>i.e.</emphasis> theproperties of the motion of (one of) the tools or end-effectors from“<emphasis>point A</emphasis>” to “<emphasis>point B</emphasis>”, without reference to thekinematic structure of the device that will perform the motion.</para></listitem></itemizedlist>The execution of a given specified motion is, in general, influencedby the following two important factors:<itemizedlist><listitem><para><emphasis role="strong">Constraints.</emphasis>The specified motion for a tool on the machine could be<emphasis role="strong">impossible</emphasis> togenerate by the device, because of: mechanicaljoint limits; limits on the forces that can be generated by themotors; singularities of the chain; collisions between links of thekinematic chain and itself or other objects in the environment; etc.</para></listitem><listitem><para><emphasis role="strong">Redundancy.</emphasis>The specified motion could be generated by the kinematic chain in<emphasis role="strong">multiple ways</emphasis>.</para></listitem></itemizedlist>Constraints and redundancy occur in both joint space and Cartesianspace, and are often mathematically tackled by optimizing<emphasis>cost functions</emphasis>; for example, move with minimalkinetic energy; minimize deviation from nominal position by attachingvirtual springs between the links and their nominal positions; etc.Of course, these cost functions look differently in both spaces. And,in addition multiple cost functions could be applied at the same time.</para><para>The joint space motion properties are discussed in more detail in<ulink url="kindyn-doc.html">another document</ulink>, whilethis text discusses Cartesian motion specification.</para></section><section id="planning-interpolation"><title>Planning vs. Interpolation</title><para>Motion specification (in both joint space and Cartesian space) has twocomplementary faces:<itemizedlist><listitem><para><emphasis role="strong">Planning</emphasis>(“path planning”, “trajectory generation”,…) determines a sequence of desired Cartesian<emphasis role="strong">via-points</emphasis> (or <emphasis role="strong">key frames</emphasis>) forthe tool whose motion is planned. A via-point is a combination ofposition, velocity and/or acceleration of a<emphasis>reference frame</emphasis> attached to the tool.</para><para>Planning is typically performed<emphasis role="strong">off-line</emphasis> and in<emphasis role="strong">non-realtime</emphasis>(<emphasis>i.e.</emphasis> it is not strictlysynchronized with the servo controllers on the device's motors), and via-points are “far apart”. How far is“far” depends on the application. In <emphasis role="strong">sensor-driven</emphasis> motions, thegeneration of the next via-point is done on-line, based on theinformation coming from the sensors.</para></listitem><listitem><para><emphasis role="strong">Interpolation</emphasis> takes the“coarse-grained” via-pointscoming from the planning, and generates a sequence of “fine-grained” intermediate motion setpoints, that aregiven to the motor controllers in a <emphasis>synchronous</emphasis>way, <emphasis>i.e.</emphasis> one new setpoint at each controlinstant. So, interpolation is an<emphasis role="strong">on-line</emphasis> and <emphasis role="strong">realtime</emphasis> process.</para></listitem></itemizedlist>By definition, planning takes place in Cartesian space, butinterpolation is often performed in joint space: the 3D or 6Dvia-points coming from the planning are transformed in desired jointpositions (and, possibly, also velocities and accelerations), via thekinematic chain's<ulink url="kindyn-doc.html">inverse kinematics</ulink>, and then theinterpolation takes place in each of the 1D spaces corresponding tothe joints separately.Users can be interested in synchronizing the timing of all individualjoints' 1D interpolations; <emphasis>e.g.</emphasis> all joints muststart, stop, accelerate or decelerate at the same instant in time.</para><para>This document does not discuss <emphasis>planning algorithms</emphasis> (it assumes that the via-points or keyframes are generated “somewhere”, and are available to beused in the method calls described in this document), or<ulink url="interpolation-api.html">interpolation</ulink>. Thedocument <emphasis>does</emphasis> specify the contents of the<link linkend="motion-classes"><parameter>ViaPoint</parameter></link>software class used to contain the motion data and process it. </para></section></section> <!-- motion --><section id="motion-classes"><title>Motion classes</title><para>The simplest motion specification allows the programmer to specifymotions for which the target positions(“<link linkend="via-point">via-points</link>;“key frames”) are known at the time of programming. A“<link linkend="path">path</link>” is a sequence ofvia-points that the tool has to move through.</para><para>Path and via-point programming is sufficient for most Cartesian motionapplications, including those where the motion target is definedon-line, <emphasis>e.g.</emphasis> on the basis of sensors, or ofinteractive human input by means of some form of a“joystick”.</para><para>This section also presents specification primitives for sequences ofpaths, as well as synchronized paths for more than one end-effector.</para><section id="via-point"><title><parameter>ViaPoint</parameter></title><para>A via-point contains all or part of the following information:<itemizedlist><listitem><para><emphasis role="strong">Geometry</emphasis>: the position andorientation of the via-point. This information is mathematicallyrepresented by a point or a reference frame.</para></listitem><listitem><para><emphasis role="strong">Constraints</emphasis>: thevelocity and/or acceleration information the moving tool should havewhen reaching the via-point. Or, alternatively, the time instant atwhich the via-point must be reached. Or, in more advancedapplications, indications about the desired “distance” toan objects seen by the sensors. “Distance” can also mean“force”, in case the motion is physically constrained bycontact with the environment.</para><para>In some tasks, the timing is less important than the geometry, suchthat the velocity and acceleration at the via-point can be consideredto be “timeless”, <emphasis>i.e.</emphasis> they determinethe “tangential” information at the via-point (the desiredtangent direction and the desired curvature, respectively).</para></listitem><listitem><para><emphasis role="strong">Events</emphasis>: the application programmercan be interested in being able to fire events when a given via-pointis reached, in order to enable other tasks<emphasis role="strong">to synchronize</emphasis> with the ongoingmotion. Some examples are: opening or closing of a gripper when acertain via-point is reached; taking a measurement; starting themotion of another machine; signaling to the motion<emphasis>controller</emphasis> that the ongoing motion towardsthe via-point has reached its final destination, such that it can, forexample, adapt its control action.</para></listitem></itemizedlist>The information in a via-point is allowed to be<emphasis role="strong">partial</emphasis>, in the sense that it doesnot specify all the available degrees of freedom for the“end-effector” that executes the motion. This“redundancy” creates opportunities to optimize the specifiedmotion in ways that are not foreseen or not relevant at the time ofspecification. This optimization is the job of the<ulink url="interpolation-api.html">interpolator</ulink>.</para></section><section id="path"><title><parameter>Path</parameter></title>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -