Skip to content
Snippets Groups Projects
Commit 8d7eaaa0 authored by Rohan Budhiraja's avatar Rohan Budhiraja Committed by Matthieu Herrb
Browse files

[wip/sot-core3] Patch for inputing Eigen::Transform as Matrix4d

parent 4a48fe47
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
PKGNAME= sot-core-${VERSION}
DISTNAME= sot-core-${VERSION}
VERSION= 3.0.0
PKGREVISION= 1
MASTER_SITES= ${MASTER_SITE_OPENROBOTS:=sot-core/}
MASTER_REPOSITORY= ${MASTER_REPOSITORY_GITHUB}/proyan/sot-core
......@@ -29,6 +30,7 @@ CMAKE_ARGS+= -DCMAKE_INSTALL_LIBDIR=lib
CONFIGURE_DIRS= _build
CMAKE_ARG_PATH= ..
PATCH_STRIP?= -p1
include ../../devel/boost-headers/depend.mk
include ../../devel/boost-libs/depend.mk
include ../../math/eigen3/depend.mk
......
SHA1 (sot-core-3.0.0.tar.gz) = e4968c00d55526c69bbcef9a472bcca9b35ae518
RMD160 (sot-core-3.0.0.tar.gz) = 9b7dc959a0550ab765b9f1ae5e8088c85653c0e3
Size (sot-core-3.0.0.tar.gz) = 365510 bytes
SHA1 (patch-aa) = c897834d6bc5aa43d27ca0b2dc720136637b48b3
diff --git a/include/sot/core/op-point-modifier.hh b/include/sot/core/op-point-modifier.hh
index 5d83a0c..b72b1e0 100644
--- a/include/sot/core/op-point-modifier.hh
+++ b/include/sot/core/op-point-modifier.hh
@@ -78,9 +78,9 @@ public:
dg::Matrix& jacobianSOUT_function( dg::Matrix& res,const int& time );
MatrixHomogeneous& positionSOUT_function( MatrixHomogeneous& res,const int& time );
- void setTransformation( const MatrixHomogeneous& tr );
+ void setTransformation( const Eigen::Matrix4d& tr );
void setTransformationBySignalName( std::istringstream& cmdArgs );
- const MatrixHomogeneous& getTransformation( void );
+ const Eigen::Matrix4d& getTransformation( void );
virtual void commandLine( const std::string& cmdLine,
std::istringstream& cmdArgs,
diff --git a/src/math/op-point-modifier.cpp b/src/math/op-point-modifier.cpp
index 88655a4..8c006d3 100644
--- a/src/math/op-point-modifier.cpp
+++ b/src/math/op-point-modifier.cpp
@@ -55,14 +55,14 @@ OpPointModifier( const std::string& name )
sotDEBUGIN(15);
signalRegistration( jacobianSIN<<positionSIN<<jacobianSOUT<<positionSOUT );
-
{
+
using namespace dynamicgraph::command;
addCommand("getTransformation",
- makeDirectGetter(*this,&(dynamicgraph::Matrix&)transformation,
+ makeDirectGetter(*this,&transformation.matrix(),
docDirectGetter("transformation","matrix 4x4 homo")));
addCommand("setTransformation",
- makeDirectSetter(*this, &(dynamicgraph::Matrix&)transformation,
+ makeDirectSetter(*this, &transformation.matrix(),
docDirectSetter("dimension","matrix 4x4 homo")));
addCommand("getEndEffector",
makeDirectGetter(*this,&isEndEffector,
@@ -135,11 +135,11 @@ OpPointModifier::positionSOUT_function( MatrixHomogeneous& res,const int& iter )
}
void
-OpPointModifier::setTransformation( const MatrixHomogeneous& tr )
-{ transformation = tr; }
-const MatrixHomogeneous&
+OpPointModifier::setTransformation( const Eigen::Matrix4d& tr )
+{ transformation.matrix() = tr; }
+const Eigen::Matrix4d&
OpPointModifier::getTransformation( void )
-{ return transformation; }
+{ return transformation.matrix(); }
/* The following function needs an access to a specific signal via
@@ -152,8 +152,8 @@ OpPointModifier::getTransformation( void )
void
OpPointModifier::setTransformationBySignalName( std::istringstream& cmdArgs )
{
- Signal< MatrixHomogeneous,int > &sig
- = dynamic_cast< Signal< MatrixHomogeneous,int >& >
+ Signal< Eigen::Matrix4d,int > &sig
+ = dynamic_cast< Signal< Eigen::Matrix4d,int >& >
(PoolStorage::getInstance()->getSignal( cmdArgs ));
setTransformation(sig.accessCopy());
}
@@ -166,7 +166,7 @@ commandLine( const std::string& cmdLine,
{
if( cmdLine == "transfo" )
{
- MatrixHomogeneous tr;
+ Eigen::Matrix4d tr;
cmdArgs >> tr;
setTransformation(tr);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment