Skip to content

Commit 09af8ad

Browse files
Merge pull request #4 from open-space-collective/dev@lucas
Dev@lucas
2 parents 3340558 + 779fb4c commit 09af8ad

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
*.ipynb linguist-vendored
2+
13
*.bsp filter=lfs diff=lfs merge=lfs -text
24
*.dat filter=lfs diff=lfs merge=lfs -text
35
*.tf filter=lfs diff=lfs merge=lfs -text

bindings/python/src/LibraryAstrodynamicsPy/Flight/Profile/State.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
99

10+
#include <LibraryAstrodynamicsPy/Utilities/IterableConverter.hpp>
11+
1012
#include <Library/Astrodynamics/Flight/Profile/State.hpp>
1113

1214
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -42,12 +44,21 @@ inline void LibraryAstrodynamicsPy_Flight_Profile_State ( )
4244
.def("getAttitude", &State::getAttitude)
4345
.def("getAngularVelocity", &State::getAngularVelocity)
4446
.def("getFrame", &State::getFrame)
45-
// .def("inFrame", &State::inFrame)
47+
.def("inFrame", &State::inFrame)
4648

4749
.def("Undefined", &State::Undefined).staticmethod("Undefined")
4850

4951
;
5052

53+
using library::core::ctnr::Array ;
54+
55+
IterableConverter()
56+
57+
.from_python<Array<State>>()
58+
.to_python<Array<State>>()
59+
60+
;
61+
5162
}
5263

5364
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

src/Library/Astrodynamics/Flight/Profile/State.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -192,31 +192,31 @@ Shared<const Frame> State::getFrame ( )
192192

193193
}
194194

195-
// State State::inFrame ( const Shared<const Frame>& aFrameSPtr ) const
196-
// {
195+
State State::inFrame ( const Shared<const Frame>& aFrameSPtr ) const
196+
{
197197

198-
// using library::physics::coord::Transform ;
198+
using library::physics::coord::Transform ;
199199

200-
// if ((aFrameSPtr == nullptr) || (!aFrameSPtr->isDefined()))
201-
// {
202-
// throw library::core::error::runtime::Undefined("Frame") ;
203-
// }
200+
if ((aFrameSPtr == nullptr) || (!aFrameSPtr->isDefined()))
201+
{
202+
throw library::core::error::runtime::Undefined("Frame") ;
203+
}
204204

205-
// if (!this->isDefined())
206-
// {
207-
// throw library::core::error::runtime::Undefined("State") ;
208-
// }
205+
if (!this->isDefined())
206+
{
207+
throw library::core::error::runtime::Undefined("State") ;
208+
}
209209

210-
// const Transform transform_NEW_OLD = frameSPtr_->getTransformTo(aFrameSPtr, instant_) ;
210+
const Transform transform_NEW_OLD = frameSPtr_->getTransformTo(aFrameSPtr, instant_) ;
211211

212-
// const Vector3d position = transform_NEW_OLD.applyToPosition(position_) ;
213-
// const Vector3d velocity = transform_NEW_OLD.applyToVelocity(position_, velocity_) ;
214-
// const Quaternion attitude = attitude * transform_NEW_OLD.getOrientation().toConjugate() ;
215-
// const Vector3d angularVelocity = transform_NEW_OLD.getAngularVelocity() [TBI] ;
212+
const Vector3d position = transform_NEW_OLD.applyToPosition(position_) ;
213+
const Vector3d velocity = transform_NEW_OLD.applyToVelocity(position_, velocity_) ;
214+
const Quaternion attitude = attitude_ * transform_NEW_OLD.getOrientation().toConjugate() ;
215+
const Vector3d angularVelocity = { 0.0, 0.0, 0.0 } ; // transform_NEW_OLD.getAngularVelocity() [TBI] ;
216216

217-
// return { instant_, position, velocity, attitude, angularVelocity, aFrameSPtr } ;
217+
return { instant_, position, velocity, attitude, angularVelocity, aFrameSPtr } ;
218218

219-
// }
219+
}
220220

221221
State State::Undefined ( )
222222
{

0 commit comments

Comments
 (0)