Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ jobs:
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV
fi
echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV
echo "LD_LIBRARY_PATH=$SoftRobots_ROOT/lib:$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV
echo "SOFA_PLUGIN_PATH=$SoftRobots_ROOT/lib:$WORKSPACE_ARTIFACT_PATH/lib" | tee -a $GITHUB_ENV

# Add execution right on the tests
chmod +x $WORKSPACE_BUILD_PATH/bin/*_test${{ steps.sofa.outputs.exe }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace softrobotsinverse::constraint
{
using sofa::defaulttype::Vec3Types;
using sofa::defaulttype::Rigid3Types;
using sofa::core::RegisterObject ;

template<>
void BarycentricCenterEffector<Rigid3Types>::draw(const VisualParams* vparams)
Expand All @@ -62,12 +61,13 @@ void BarycentricCenterEffector<Rigid3Types>::setBarycenter(const Coord& _barycen


//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
int BarycentricCenterEffectorClass = RegisterObject("This component is used to describe one or several desired trajectories "
"for the barycenter of a model, that will be reached by acting on chosen actuator(s).")
.add< BarycentricCenterEffector<Vec3Types> >(true)
.add< BarycentricCenterEffector<Rigid3Types> >()

;
void registerBarycentricCenterEffector(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("This component is used to describe one or several desired trajectories "
"for the barycenter of a model, that will be reached by acting on chosen actuator(s).")
.add< BarycentricCenterEffector<Vec3Types> >(true)
.add< BarycentricCenterEffector<Rigid3Types> >());
}

template class SOFA_SOFTROBOTS_INVERSE_API BarycentricCenterEffector<Vec3Types>;
template class SOFA_SOFTROBOTS_INVERSE_API BarycentricCenterEffector<Rigid3Types>;
Expand Down
8 changes: 5 additions & 3 deletions src/SoftRobots.Inverse/component/constraint/CableActuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

int CableActuatorClass = RegisterObject("Simulate cable actuation to solve effector constraint.")
.add< CableActuator<Vec3Types> >(true)
;
void registerCableActuator(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("Simulate cable actuation to solve effector constraint.")
.add< CableActuator<Vec3Types> >(true));
}

template class SOFA_SOFTROBOTS_INVERSE_API CableActuator<Vec3Types>;

Expand Down
8 changes: 5 additions & 3 deletions src/SoftRobots.Inverse/component/constraint/CableEffector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ using namespace sofa::core;
namespace softrobotsinverse::constraint
{

int CableEffectorClass = RegisterObject("Simulate cable sensor to measure lengths.")
.add< CableEffector<Vec3Types> >(true)
;
void registerCableEffector(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("Simulate cable sensor to measure lengths.")
.add< CableEffector<Vec3Types> >(true));
}

template class CableEffector<Vec3Types>;

Expand Down
9 changes: 6 additions & 3 deletions src/SoftRobots.Inverse/component/constraint/CableEquality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

int CableEqualityClass = RegisterObject("Simulate cable actuation to solve effector constraint.")
.add< CableEquality<Vec3Types> >(true)
;

void registerCableEquality(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("Simulate cable actuation to solve effector constraint.")
.add< CableEquality<Vec3Types> >(true));
}

template class SOFA_SOFTROBOTS_INVERSE_API CableEquality<Vec3Types>;

Expand Down
9 changes: 5 additions & 4 deletions src/SoftRobots.Inverse/component/constraint/CableSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

int CableSensorClass = RegisterObject("This component simulates a cable sensor that measures its length.")
.add< CableSensor<Vec3Types> >(true)

;
void registerCableSensor(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component simulates a cable sensor that measures its length.")
.add< CableSensor<Vec3Types> >(true));
}

template class CableSensor<Vec3Types>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

int ForcePointActuatorClass = RegisterObject("This component is used to solve an inverse problem by applying a force on a given point of a model.")
.add< ForcePointActuator<Vec3Types> >(true)
.add< ForcePointActuator<Rigid3Types> >()

;
void registerForcePointActuator(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component is used to solve an inverse problem by applying a force on a given point of a model.")
.add< ForcePointActuator<Vec3Types> >(true)
.add< ForcePointActuator<Rigid3Types> >());
}

template class SOFA_SOFTROBOTS_INVERSE_API ForcePointActuator<Vec3Types>;
template class SOFA_SOFTROBOTS_INVERSE_API ForcePointActuator<Rigid3Types>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

void registerForceSurfaceActuator(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component is used to solve an inverse problem by applying a force on a given surface of a model.")
.add< ForceSurfaceActuator<Vec3Types> >(true));
}

int ForceSurfaceActuatorClass = RegisterObject("This component is used to solve an inverse problem by applying a force on a given surface of a model.")
.add< ForceSurfaceActuator<Vec3Types> >(true)

;
template class SOFA_SOFTROBOTS_INVERSE_API ForceSurfaceActuator<Vec3Types>;


Expand Down
8 changes: 5 additions & 3 deletions src/SoftRobots.Inverse/component/constraint/JointActuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

int JointActuatorClass = RegisterObject("This component is used to solve an inverse problem by applying force on a joint (Vec1)")
.add< JointActuator<Vec1Types> >(true)
void registerJointActuator(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component is used to solve an inverse problem by applying force on a joint (Vec1)")
.add< JointActuator<Vec1Types> >(true));
}

;
template class SOFA_SOFTROBOTS_INVERSE_API JointActuator<Vec1Types>;


Expand Down
30 changes: 10 additions & 20 deletions src/SoftRobots.Inverse/component/constraint/PositionEffector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,19 @@ namespace softrobotsinverse::constraint
using namespace sofa::defaulttype;
using sofa::core::ConstraintParams;


//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
using namespace sofa::helper;
using namespace sofa::core;

// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template

int PositionEffectorClass = sofa::core::RegisterObject("This component is used to describe one or several desired positions "
"of points of a model, that will be reached by acting on chosen actuator(s).")
.add< PositionEffector<Vec1Types> >()
.add< PositionEffector<Vec2Types> >()
.add< PositionEffector<Vec3Types> >(true)
.add< PositionEffector<Rigid3Types> >()

;
////////////////////////////////////////////////////////////////////////////////////////////////////////
void registerPositionEffector(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component is used to describe one or several desired positions "
"of points of a model, that will be reached by acting on chosen actuator(s).")
.add< PositionEffector<Vec1Types> >()
.add< PositionEffector<Vec2Types> >()
.add< PositionEffector<Vec3Types> >(true)
.add< PositionEffector<Rigid3Types> >());
}

// Force template specialization for the most common sofa floating point related type.
// This goes with the extern template declaration in the .h. Declaring extern template
// avoid the code generation of the template for each compilation unit.
// see: http://www.stroustrup.com/C++11FAQ.html#extern-templates
template class SOFA_SOFTROBOTS_INVERSE_API PositionEffector<sofa::defaulttype::Vec1Types>;
template class SOFA_SOFTROBOTS_INVERSE_API PositionEffector<sofa::defaulttype::Vec2Types>;
template class SOFA_SOFTROBOTS_INVERSE_API PositionEffector<sofa::defaulttype::Vec3Types>;
Expand Down
12 changes: 7 additions & 5 deletions src/SoftRobots.Inverse/component/constraint/PositionEquality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ using namespace sofa::core;
namespace softrobotsinverse::constraint
{

int PositionEqualityClass = RegisterObject("In an inverse problem, constrains the given positions on chosen directions.")
.add< PositionEquality<Vec3Types> >(true)
.add< PositionEquality<Vec2Types> >()
.add< PositionEquality<Rigid3Types> >()
;
void registerPositionEquality(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("In an inverse problem, constrains the given positions on chosen directions.")
.add< PositionEquality<Vec2Types> >()
.add< PositionEquality<Vec3Types> >(true)
.add< PositionEquality<Rigid3Types> >());
}

template class SOFA_SOFTROBOTS_INVERSE_API PositionEquality<Vec3Types>;
template class SOFA_SOFTROBOTS_INVERSE_API PositionEquality<Vec2Types>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ class PositionEquality : public Equality<DataTypes>, public PositionModel<DataTy
};

#ifndef SOFTROBOTSINVERSE_CONSTRAINT_POSITIONEQUALITY_CPP
extern template class SOFA_SOFTROBOTS_INVERSE_API PositionEquality<sofa::defaulttype::Vec2Types>;
extern template class SOFA_SOFTROBOTS_INVERSE_API PositionEquality<sofa::defaulttype::Vec3Types>;
extern template class SOFA_SOFTROBOTS_INVERSE_API PositionEquality<sofa::defaulttype::Rigid3Types>;
#endif // SOFTROBOTSINVERSE_CONSTRAINT_POSITIONEQUALITY_CPP

} // namespace
Expand Down
16 changes: 8 additions & 8 deletions src/SoftRobots.Inverse/component/constraint/SlidingActuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ void SlidingActuator<Rigid3Types>::initData()
d_force.setValue(d_initForce.getValue());
}


int SlidingActuatorClass = RegisterObject("This component simulates a force exerted along a given direction to solve an inverse problem. \n"
"In case of Rigid template, it additionally simulates a force in rotation: the size of 'direction' is equal to 6,\n"
"the three first component give the direction in translation and the three last the axe of rotation.")
.add< SlidingActuator<Vec3Types> >(true)
.add< SlidingActuator<Rigid3Types> >()

;
void registerSlidingActuator(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component simulates a force exerted along a given direction to solve an inverse problem. \n"
"In case of Rigid template, it additionally simulates a force in rotation: the size of 'direction' is equal to 6,\n"
"the three first component give the direction in translation and the three last the axe of rotation.")
.add< SlidingActuator<Vec3Types> >(true)
.add< SlidingActuator<Rigid3Types> >());
}

template class SOFA_SOFTROBOTS_INVERSE_API SlidingActuator<Vec3Types>;
template class SOFA_SOFTROBOTS_INVERSE_API SlidingActuator<Rigid3Types>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

int SurfacePressureActuatorClass = RegisterObject("This component is used to solve effector constraint "
"by applying pressure on surfaces (for exemple cavities)")
.add< SurfacePressureActuator<Vec3Types> >(true)
void registerSurfacePressureActuator(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component is used to solve effector constraint "
"by applying pressure on surfaces (for exemple cavities)")
.add< SurfacePressureActuator<Vec3Types> >(true));
}

;
template class SOFA_SOFTROBOTS_INVERSE_API SurfacePressureActuator<Vec3Types>;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ namespace softrobotsinverse::constraint
using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;
int SurfacePressureEqualityClass = RegisterObject("This component is used to solve inverse problem "
"by applying an imposed pressure on surfaces (for exemple cavities)")
.add< SurfacePressureEquality<Vec3Types> >(true)

;
void registerSurfacePressureEquality(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component is used to solve inverse problem "
"by applying an imposed pressure on surfaces (for exemple cavities)")
.add< SurfacePressureEquality<Vec3Types> >(true));
}

template class SOFA_SOFTROBOTS_INVERSE_API SurfacePressureEquality<Vec3Types>;

} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;


int SurfacePressureSensorClass = RegisterObject("This component simulates a surface pressure sensor that measures its volume growth.")
.add< SurfacePressureSensor<Vec3Types> >(true)

;
void registerSurfacePressureSensor(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component simulates a surface pressure sensor that measures its volume growth.")
.add< SurfacePressureSensor<Vec3Types> >(true));
}

template class SurfacePressureSensor<Vec3Types>;

Expand Down
10 changes: 5 additions & 5 deletions src/SoftRobots.Inverse/component/constraint/VolumeEffector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ using namespace sofa::core;
namespace softrobotsinverse::constraint
{

SOFA_DECL_CLASS(VolumeEffector)

int VolumeEffectorClass = RegisterObject("Simulate behavior of a volume effector to solve an inverse problem.")
.add< VolumeEffector<Vec3Types> >(true)
void registerVolumeEffector(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("Simulate behavior of a volume effector to solve an inverse problem.")
.add< VolumeEffector<Vec3Types> >(true));
}

;
template class VolumeEffector<Vec3Types>;

} // namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,29 @@
* Contact information: https://project.inria.fr/softrobot/contact/ *
******************************************************************************/
#define SOFTROBOTS_INVERSE_YOUNGMODULUSACTUATOR_CPP
#include "YoungModulusActuator.inl"
#include <SoftRobots.Inverse/component/constraint/YoungModulusActuator.inl>
#include <sofa/core/ObjectFactory.h>


namespace sofa::component::constraintset
namespace softrobotsinverse::constraint
{

using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template

int YoungModulusActuatorClass = core::RegisterObject("This component is used to solve effector constraint "
"by changing young moduli")
.add< YoungModulusActuator<Vec3Types> >(true)

;
///////////////////////////////////////////////////////////////////////////////////////////////////////
void registerYoungModulusActuator(ObjectFactory* factory)
{
factory->registerObjects(ObjectRegistrationData("This component is used to solve effector constraint "
"by changing young moduli")
.add< YoungModulusActuator<Vec3Types> >(true));
}

// Force template specialization for the most common sofa floating point related type.
// This goes with the extern template declaration in the .h. Declaring extern template
// avoid the code generation of the template for each compilation unit.
// see: http://www.stroustrup.com/C++11FAQ.html#extern-templates
template class SOFA_SOFTROBOTS_INVERSE_API YoungModulusActuator<Vec3Types>;


} // namespace sofa::component::constraintset
} // namespace



Expand Down
Loading
Loading