Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
sot-core
Commits
bf4c116d
Commit
bf4c116d
authored
14 years ago
by
Nicolas Mansard
Browse files
Options
Downloads
Patches
Plain Diff
Corrected op-point-modifier to fit the new command rules.
parent
afec7330
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/sot-core/op-point-modifier.h
+6
-5
6 additions, 5 deletions
include/sot-core/op-point-modifier.h
src/math/op-point-modifier.cpp
+45
-17
45 additions, 17 deletions
src/math/op-point-modifier.cpp
with
51 additions
and
22 deletions
include/sot-core/op-point-modifier.h
+
6
−
5
View file @
bf4c116d
...
...
@@ -64,8 +64,6 @@ class SOTOPPOINTMODIFIER_EXPORT OpPointModifier
static
const
std
::
string
CLASS_NAME
;
virtual
const
std
::
string
&
getClassName
(
void
)
const
{
return
CLASS_NAME
;
}
MatrixHomogeneous
transformation
;
public
:
dg
::
SignalPtr
<
ml
::
Matrix
,
int
>
jacobianSIN
;
...
...
@@ -76,17 +74,20 @@ class SOTOPPOINTMODIFIER_EXPORT OpPointModifier
public
:
OpPointModifier
(
const
std
::
string
&
name
);
virtual
~
OpPointModifier
(
void
){}
ml
::
Matrix
&
computeJacobia
n
(
ml
::
Matrix
&
res
,
const
int
&
time
);
MatrixHomogeneous
&
computePosi
tion
(
MatrixHomogeneous
&
res
,
const
int
&
time
);
ml
::
Matrix
&
jacobianSOUT_functio
n
(
ml
::
Matrix
&
res
,
const
int
&
time
);
MatrixHomogeneous
&
positionSOUT_func
tion
(
MatrixHomogeneous
&
res
,
const
int
&
time
);
void
setTransformation
(
const
MatrixHomogeneous
&
tr
);
void
setTransformationBySignalName
(
std
::
istringstream
&
cmdArgs
);
virtual
void
commandLine
(
const
std
::
string
&
cmdLine
,
std
::
istringstream
&
cmdArgs
,
std
::
ostream
&
os
);
private
:
MatrixHomogeneous
transformation
;
const
MatrixHomogeneous
&
getTransformation
(
void
);
};
}
// namespace sot
...
...
This diff is collapsed.
Click to expand it.
src/math/op-point-modifier.cpp
+
45
−
17
View file @
bf4c116d
...
...
@@ -18,13 +18,13 @@
* with sot-core. If not, see <http://www.gnu.org/licenses/>.
*/
#include
<dynamic-graph/factory.h>
#include
<dynamic-graph/all-signals.h>
#include
<dynamic-graph/all-commands.h>
#include
<sot-core/op-point-modifier.h>
#include
<sot-core/matrix-twist.h>
#include
<dynamic-graph/pool.h>
#include
<sot-core/factory.h>
using
namespace
std
;
using
namespace
sot
;
...
...
@@ -41,37 +41,49 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(OpPointModifier,"OpPointModifier");
OpPointModifier
::
OpPointModifier
(
const
std
::
string
&
name
)
:
Entity
(
name
)
,
transformation
()
,
jacobianSIN
(
NULL
,
"OpPointModifior("
+
name
+
")::input(matrix)::jacobianIN"
)
,
positionSIN
(
NULL
,
"OpPointModifior("
+
name
+
")::input(matrixhomo)::positionIN"
)
,
jacobianSOUT
(
boost
::
bind
(
&
OpPointModifier
::
computeJacobia
n
,
this
,
_1
,
_2
),
,
jacobianSOUT
(
boost
::
bind
(
&
OpPointModifier
::
jacobianSOUT_functio
n
,
this
,
_1
,
_2
),
jacobianSIN
,
"OpPointModifior("
+
name
+
")::output(matrix)::jacobian"
)
,
positionSOUT
(
boost
::
bind
(
&
OpPointModifier
::
computePosi
tion
,
this
,
_1
,
_2
),
,
positionSOUT
(
boost
::
bind
(
&
OpPointModifier
::
positionSOUT_func
tion
,
this
,
_1
,
_2
),
positionSIN
,
"OpPointModifior("
+
name
+
")::output(matrixhomo)::position"
)
,
transformation
()
{
sotDEBUGIN
(
15
);
signalRegistration
(
jacobianSIN
<<
positionSIN
<<
jacobianSOUT
<<
positionSOUT
);
sotDEBUGINOUT
(
15
);
{
using
namespace
dynamicgraph
::
command
;
addCommand
(
"getTransformation"
,
makeDirectGetter
(
*
this
,
&
(
ml
::
Matrix
&
)
transformation
,
docDirectGetter
(
"transformation"
,
"matrix 4x4 homo"
)));
addCommand
(
"setTransformation"
,
makeDirectSetter
(
*
this
,
&
(
ml
::
Matrix
&
)
transformation
,
docDirectSetter
(
"dimension"
,
"matrix 4x4 homo"
)));
}
sotDEBUGOUT
(
15
);
}
ml
::
Matrix
&
OpPointModifier
::
computeJacobia
n
(
ml
::
Matrix
&
res
,
const
int
&
time
)
OpPointModifier
::
jacobianSOUT_functio
n
(
ml
::
Matrix
&
res
,
const
int
&
iter
)
{
const
ml
::
Matrix
&
jacobian
=
jacobianSIN
(
time
);
const
ml
::
Matrix
&
jacobian
=
jacobianSIN
(
iter
);
MatrixTwist
V
(
transformation
);
res
=
V
*
jacobian
;
return
res
;
}
MatrixHomogeneous
&
OpPointModifier
::
computePosi
tion
(
MatrixHomogeneous
&
res
,
const
int
&
time
)
OpPointModifier
::
positionSOUT_func
tion
(
MatrixHomogeneous
&
res
,
const
int
&
iter
)
{
sotDEBUGIN
(
15
);
sotDEBUGIN
(
15
)
<<
time
<<
" "
<<
positionSIN
.
getTime
()
<<
positionSOUT
.
getTime
()
<<
endl
;
const
MatrixHomogeneous
&
position
=
positionSIN
(
time
);
sotDEBUGIN
(
15
)
<<
iter
<<
" "
<<
positionSIN
.
getTime
()
<<
positionSOUT
.
getTime
()
<<
endl
;
const
MatrixHomogeneous
&
position
=
positionSIN
(
iter
);
position
.
multiply
(
transformation
,
res
);
sotDEBUGOUT
(
15
);
return
res
;
...
...
@@ -80,8 +92,27 @@ OpPointModifier::computePosition( MatrixHomogeneous& res,const int& time )
void
OpPointModifier
::
setTransformation
(
const
MatrixHomogeneous
&
tr
)
{
transformation
=
tr
;
}
const
MatrixHomogeneous
&
OpPointModifier
::
getTransformation
(
void
)
{
return
transformation
;
}
/* The following function needs an access to a specific signal via
* the pool, using the signal path <entity.signal>. this functionnality
* is deprecated, and the following function will have to be removed
* in a near future. A similar functionality is available using
* the <setTransformation> mthod, bound in python.
*/
#include
<dynamic-graph/pool.h>
void
OpPointModifier
::
setTransformationBySignalName
(
std
::
istringstream
&
cmdArgs
)
{
Signal
<
MatrixHomogeneous
,
int
>
&
sig
=
dynamic_cast
<
Signal
<
MatrixHomogeneous
,
int
>&
>
(
g_pool
.
getSignal
(
cmdArgs
));
setTransformation
(
sig
.
accessCopy
());
}
void
OpPointModifier
::
commandLine
(
const
std
::
string
&
cmdLine
,
std
::
istringstream
&
cmdArgs
,
...
...
@@ -95,10 +126,7 @@ commandLine( const std::string& cmdLine,
}
else
if
(
cmdLine
==
"transfoSignal"
)
{
Signal
<
MatrixHomogeneous
,
int
>
&
sig
=
dynamic_cast
<
Signal
<
MatrixHomogeneous
,
int
>&
>
(
g_pool
.
getSignal
(
cmdArgs
));
setTransformation
(
sig
.
accessCopy
());
setTransformationBySignalName
(
cmdArgs
);
}
else
if
(
cmdLine
==
"getTransfo"
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment