<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://patrius.cnes.fr/index.php?action=history&amp;feed=atom&amp;title=User_Manual_4.10_Attitude_leg</id>
	<title>User Manual 4.10 Attitude leg - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://patrius.cnes.fr/index.php?action=history&amp;feed=atom&amp;title=User_Manual_4.10_Attitude_leg"/>
	<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=User_Manual_4.10_Attitude_leg&amp;action=history"/>
	<updated>2026-04-05T21:12:43Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://patrius.cnes.fr/index.php?title=User_Manual_4.10_Attitude_leg&amp;diff=3248&amp;oldid=prev</id>
		<title>Admin : Page créée avec « __NOTOC__  == Introduction == === Scope === The purpose of this chapter is to describe the current Patrius attitude legs.  An attitude leg is a time-bounded attitude law.... »</title>
		<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=User_Manual_4.10_Attitude_leg&amp;diff=3248&amp;oldid=prev"/>
		<updated>2022-11-10T09:06:35Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « __NOTOC__  == Introduction == === Scope === The purpose of this chapter is to describe the current Patrius attitude legs.  An attitude leg is a time-bounded attitude law.... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__ &lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Scope ===&lt;br /&gt;
The purpose of this chapter is to describe the current Patrius attitude legs.&lt;br /&gt;
&lt;br /&gt;
An attitude leg is a time-bounded attitude law. Generalities on attitude laws can be found [ATT_ALW_Home here].&lt;br /&gt;
&lt;br /&gt;
=== Javadoc ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Library&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Javadoc&lt;br /&gt;
|-&lt;br /&gt;
|Patrius&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/attitudes/package-summary.html Package fr.cnes.sirius.patrius.attitudes]&lt;br /&gt;
|-&lt;br /&gt;
|Patrius&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/attitudes/package-summary.html Package fr.cnes.sirius.patrius.attitudes]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Orekit attitudes : [https://www.orekit.org/static/architecture/attitudes.html Orekit Attitudes architecture description ]&lt;br /&gt;
&lt;br /&gt;
=== Useful Documents ===&lt;br /&gt;
None as of now.&lt;br /&gt;
&lt;br /&gt;
=== Package Overview ===&lt;br /&gt;
The attitude leg &amp;lt;code&amp;gt;AttitudeLeg&amp;lt;/code&amp;gt; interface inherits the &amp;lt;code&amp;gt;AttitudeProvider&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
Its place in the global Attitude design can be found [ATT_ALW_PkgOverview here].&lt;br /&gt;
It also inherits the general &amp;lt;code&amp;gt;Leg&amp;lt;/code&amp;gt; interface presented below.&lt;br /&gt;
&lt;br /&gt;
== Features Description ==&lt;br /&gt;
&lt;br /&gt;
=== Generalities: the Leg and the LegsSequence interfaces ===&lt;br /&gt;
Attitude legs inherit the interface &amp;lt;code&amp;gt;AttitudeLeg&amp;lt;/code&amp;gt;.&lt;br /&gt;
In addition to &amp;lt;code&amp;gt;AttitudeProvider&amp;lt;/code&amp;gt; services, they inherit the methods of the &amp;lt;code&amp;gt;Leg&amp;lt;/code&amp;gt; interface which means they are time-bounded attitude providers.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Leg&amp;lt;/code&amp;gt; interface is a generic interface for time-bounded timestamped data. It has only one method &amp;lt;code&amp;gt;getTimeInterval()&amp;lt;/code&amp;gt; (as well as method allowing to retrieve start and end of interval). This &amp;lt;code&amp;gt;Leg&amp;lt;/code&amp;gt; interface allows to define an &amp;lt;code&amp;gt;AttitudeLeg&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In order to define an attitude sequence &amp;lt;code&amp;gt;StrictAttitudeLegsSequence&amp;lt;/code&amp;gt;, another generic interface is available: the &amp;lt;code&amp;gt;LegsSequence&amp;lt;/code&amp;gt; interface. This interface defines a sequence of &amp;lt;code&amp;gt;Leg&amp;lt;/code&amp;gt; and provides methods to manipulate a collection of timestamped legs similarly to the &amp;lt;code&amp;gt;Collection&amp;lt;/code&amp;gt; interface (methods &amp;lt;code&amp;gt;first()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;next()&amp;lt;/code&amp;gt;, etc.).&lt;br /&gt;
A implementation of &amp;lt;code&amp;gt;LegsSequence&amp;lt;/code&amp;gt; is available: &amp;lt;code&amp;gt;StrictLegsSequence&amp;lt;/code&amp;gt;. This class handles a sequence of legs which are strictly ordered (not overlapping is allowed), legs are ordered by their starting date.&lt;br /&gt;
The sequence of attitude legs &amp;lt;code&amp;gt;StrictAttitudeLegsSequence&amp;lt;/code&amp;gt; inherits the &amp;lt;code&amp;gt;StrictLegsSequence&amp;lt;/code&amp;gt; by considering legs as &amp;lt;code&amp;gt;AttitudeLegs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; the &amp;lt;code&amp;gt;Leg&amp;lt;/code&amp;gt;and &amp;lt;code&amp;gt;LegsSequence&amp;lt;/code&amp;gt;interfaces are purely generic and therefore can be used for any other time-bounded data.&lt;br /&gt;
&lt;br /&gt;
=== Available attitude leg ===&lt;br /&gt;
==== Attitude legs sequence ====&lt;br /&gt;
An attitude legs sequence is a container for several attitude legs, contiguous for their time intervals, in such a way that the attitude legs sequence can be processed like a single attitude leg by the propagator.&lt;br /&gt;
&lt;br /&gt;
The attitude legs sequence is the equivalent of the [ATT_ALW_Home#HAttitudessequence Attitudes sequence], using attitude legs (&amp;lt;code&amp;gt;AttitudeLeg&amp;lt;/code&amp;gt; instances) rather than attitude laws (&amp;lt;code&amp;gt;AttitudeLaw&amp;lt;/code&amp;gt; instances). &lt;br /&gt;
The switching from one attitude leg to another is based on the time interval of validity of the two legs.&lt;br /&gt;
&lt;br /&gt;
==== TabulatedAttitude ====&lt;br /&gt;
&amp;lt;code&amp;gt;TabulatedAttitude&amp;lt;/code&amp;gt; is an implementation of &amp;lt;code&amp;gt;AttitudeLeg&amp;lt;/code&amp;gt;. It represents a tabulated attitude leg.&lt;br /&gt;
&lt;br /&gt;
In order to interpolate the attitude at a date, the user must specify a list of &amp;#039;&amp;#039;&amp;#039;ordered&amp;#039;&amp;#039;&amp;#039; attitudes, and can specify a number of points used by Hermite interpolation.&lt;br /&gt;
If not specified, the number of points used by Hermite interpolation is set to a default number (currently 2).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
final List&amp;lt;Attitude&amp;gt; attList = new ArrayList&amp;lt;Attitude&amp;gt;();&lt;br /&gt;
attList.add(attitude0);&lt;br /&gt;
attList.add(attitude1);&lt;br /&gt;
final int nbrInterpPoints = 2;&lt;br /&gt;
final TabulatedAttitude attLeg = new TabulatedAttitude(attList, nbrInterpPoints);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible to get the non-interpolated ordered attitudes : &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
final List&amp;lt;Attitude&amp;gt; attitudes = attLeg.getAttitudes();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the tabulated is defined, the computation can be performed on any orbital state using &amp;lt;code&amp;gt;getAttitude()&amp;lt;/code&amp;gt; method:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
Attitude attitude = attLeg.getAttitude(orbit, date, FramesFactory.getEME2000());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RelativeTabulatedAttitudeLeg ====&lt;br /&gt;
&amp;lt;code&amp;gt;RelativeTabulatedAttitudeLeg&amp;lt;/code&amp;gt; is an implementation of &amp;lt;code&amp;gt;AttitudeLeg&amp;lt;/code&amp;gt;. An instance of &amp;lt;code&amp;gt;RelativeTabulatedAttitudeLeg&amp;lt;/code&amp;gt; can be created with a &amp;lt;code&amp;gt;List&amp;lt;Pair&amp;lt;Double, Rotation&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; or with a &amp;lt;code&amp;gt;List&amp;lt;Pair&amp;lt;Double, AngularCoordinates&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;. Each &amp;lt;code&amp;gt;Rotation&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;AngularCoordinates&amp;lt;/code&amp;gt;) is associated with a &amp;lt;code&amp;gt;double&amp;lt;/code&amp;gt; representing its time ellapsed in seconds since the reference date. Here is an example of a creation of an instance of &amp;lt;code&amp;gt;RelativeTabulatedAttitudeLeg&amp;lt;/code&amp;gt; : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
// date and frame&lt;br /&gt;
AbsoluteDate refDate = new AbsoluteDate(2008, 1, 1, TimeScalesFactory.getTAI());&lt;br /&gt;
Frame frame = FramesFactory.getGCRF();&lt;br /&gt;
double timeEllapsedSinceRefDate = 1.0;&lt;br /&gt;
        &lt;br /&gt;
// List of AR&lt;br /&gt;
List&amp;lt;Pair&amp;lt;Double, AngularCoordinates&amp;gt;&amp;gt; listAr = new ArrayList&amp;lt;Pair&amp;lt;Double, AngularCoordinates&amp;gt;&amp;gt;();&lt;br /&gt;
final AngularCoordinates ar = new AngularCoordinates(&lt;br /&gt;
                new Rotation(false, 0.48, 0.64, 0.36, 0.48), Vector3D.PLUS_I, Vector3D.PLUS_J);&lt;br /&gt;
listAr.add(new Pair&amp;lt;Double, AngularCoordinates&amp;gt;(timeEllapsedSinceRefDate, ar));&lt;br /&gt;
&lt;br /&gt;
// create RelativeTabulatedAttitudeLeg&lt;br /&gt;
final RelativeTabulatedAttitudeLeg relativeTabulatedAttitudeLeg = &lt;br /&gt;
                new RelativeTabulatedAttitudeLeg(refDate, frame, listAr);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
=== Building an attitude legs sequence ===&lt;br /&gt;
&lt;br /&gt;
The attitude legs sequence was designed as a simple container, it performs only a few coherence checks on its inner attitude laws. Here&amp;#039;s how an attitude sequence is built.&lt;br /&gt;
&lt;br /&gt;
* An attitude legs sequence is created empty, associated to a single &amp;lt;code&amp;gt;PVCoordinatesProvider&amp;lt;/code&amp;gt; instance.&lt;br /&gt;
&lt;br /&gt;
* The sequence is mutable, attitude laws can be added to it one by one.&lt;br /&gt;
&lt;br /&gt;
* Each attitude law is identified by a code.&lt;br /&gt;
&lt;br /&gt;
* The sequence has a validity time interval, which is the grouping of the validity time intervals of all contained laws.&lt;br /&gt;
&lt;br /&gt;
* The time interval of a newly added law must be contiguous to the grouped time interval of the already added laws. Otherwise an PatriusException is thrown.&lt;br /&gt;
&lt;br /&gt;
* As soon as the sequence contains at least one law, methods of the &amp;lt;code&amp;gt;AttitudeLeg&amp;lt;/code&amp;gt; interface can be called on the attitude sequence. The attitude sequence forwards the request to the appropriate attitude leg (according to the asking date), but replaces the &amp;lt;code&amp;gt;PVCoordinatesProvider&amp;lt;/code&amp;gt; attribute of the call with the inner &amp;lt;code&amp;gt;PVCoordinatesProvider&amp;lt;/code&amp;gt; instance.&lt;br /&gt;
&lt;br /&gt;
=== AttitudeLawLeg and AttitudeLegsSequence : Code sample ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
final BodyCenterPointing earthCenterAttitudeLaw = new BodyCenterPointing(itrf);&lt;br /&gt;
final AttitudeLeg law1 = new AttitudeLawLeg(earthCenterAttitudeLaw, date1, date2);&lt;br /&gt;
final AttitudeLeg law2 = ... ;&lt;br /&gt;
final AttitudeLeg law3 = ... ;&lt;br /&gt;
&lt;br /&gt;
PVCoordinatesProvider pvProvider = new CartesianOrbit(pvCoordinates, gcrf, date1, mu);&lt;br /&gt;
final StrictAttitudeLegsSequence sequence = new StrictAttitudeLegsSequence(pvProvider);&lt;br /&gt;
sequence.add(law1);&lt;br /&gt;
sequence.add(law2);&lt;br /&gt;
sequence.add(law3);&lt;br /&gt;
&lt;br /&gt;
// Call to getAttitude on the sequence&lt;br /&gt;
final Attitude attitude = sequence.getAttitude(pvProvider, date, itrf);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contents ==&lt;br /&gt;
=== Interfaces ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Interface&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Summary&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Javadoc&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Leg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|This interface is a generic interface for any king of time-bounded data.&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/utils/legs/Leg.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;LegsSequence&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|This interface is a generic interface for any sequence of legs.&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/utils/legs/LegsSequence.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;AttitudeLeg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|This interface extends the AttitudeProvider interface and adds the time interval of validity notion to the attitude laws.&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/attitudes/AttitudeLeg.html ...]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Classes ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Class&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Summary&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Javadoc&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;StrictLegsSequence&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|This class is a generic class for handling any sequence of legs.&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/utils/legs/StrictLegsSequence.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;AttitudeLawLeg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Object representing an attitude law for spacecraft attitude field purposes.&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/attitudes/AttitudeLawLeg.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;TabulatedAttitude&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Object representing a tabulated attitude leg : the attitude at a date is interpolated from a list of known ones.&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/attitudes/TabulatedAttitude.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;StrictAttitudeLegsSequence&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Object representing a sequence of attitude legs.&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/attitudes/StrictAttitudeLegsSequence.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;RelativeTabulatedAttitudeLeg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|This class implements a tabulated attitude leg with relative dates.&lt;br /&gt;
|[{{JavaDoc4.10}}/fr/cnes/sirius/patrius/attitudes/RelativeTabulatedAttitudeLeg.html ...]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Manual_4.10_Attitude]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>