Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
sot-dynamic-pinocchio
Commits
703347b2
Commit
703347b2
authored
Jan 22, 2016
by
Rohan Budhiraja
Browse files
[cmake] update sot-tools version
parent
10a09197
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
703347b2
...
...
@@ -23,8 +23,8 @@ INCLUDE(cmake/cpack.cmake)
SET
(
PROJECT_NAME sot-dynamic
)
SET
(
PROJECT_DESCRIPTION
"
jrl-dynamics
bindings for dynamic-graph."
)
SET
(
PROJECT_URL
"http://github.com/
stack-of-tasks/sot-dynamic
"
)
SET
(
PROJECT_DESCRIPTION
"
pinocchio
bindings for dynamic-graph."
)
SET
(
PROJECT_URL
"http
s
://github.com/
proyan/sot-dynamic/tree/topic/sot-pinocchio
"
)
SET
(
CUSTOM_HEADER_DIR
"
${
PROJECT_NAME
}
"
)
...
...
@@ -38,13 +38,11 @@ SET(PKG_CONFIG_ADDITIONAL_VARIABLES
)
SETUP_PROJECT
()
# Search for dependencies.
ADD_REQUIRED_DEPENDENCY
(
"jrl-dynamics >= 1.19.0"
)
ADD_REQUIRED_DEPENDENCY
(
"pinocchio"
)
ADD_REQUIRED_DEPENDENCY
(
"dynamic-graph >= 3.0.0"
)
ADD_REQUIRED_DEPENDENCY
(
"sot-core >= 3.0.0"
)
ADD_REQUIRED_DEPENDENCY
(
"sot-tools"
)
ADD_REQUIRED_DEPENDENCY
(
"sot-tools
>= 2.0.0
"
)
# List plug-ins that will be compiled.
SET
(
plugins
...
...
@@ -70,7 +68,7 @@ PKG_CONFIG_APPEND_LIBS(${LIBRARY_NAME})
# Search for dependencies.
# Boost
SET
(
BOOST_COMPONENTS filesystem system
)
SET
(
BOOST_COMPONENTS filesystem system
unit_test_framework
)
SEARCH_FOR_BOOST
()
SEARCH_FOR_EIGEN
()
...
...
include/sot-dynamic/dynamic.h
View file @
703347b2
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
View file @
703347b2
...
...
@@ -29,7 +29,6 @@ ENDIF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
SET
(
integrator-force-rk4_plugins_dependencies integrator-force
)
SET
(
integrator-force-exact_plugins_dependencies integrator-force
)
FOREACH
(
lib
${
plugins
}
)
ADD_LIBRARY
(
${
lib
}
SHARED
${
lib
}
.cpp
)
...
...
@@ -44,7 +43,7 @@ FOREACH(lib ${plugins})
TARGET_LINK_LIBRARIES
(
${
lib
}
${
Boost_LIBRARIES
}
)
PKG_CONFIG_USE_DEPENDENCY
(
${
lib
}
jrl-dynamics
)
PKG_CONFIG_USE_DEPENDENCY
(
${
lib
}
pinocchio
)
PKG_CONFIG_USE_DEPENDENCY
(
${
lib
}
sot-core
)
PKG_CONFIG_USE_DEPENDENCY
(
${
lib
}
dynamic-graph
)
...
...
@@ -61,13 +60,13 @@ ENDFOREACH(lib)
# Main Library
ADD_LIBRARY
(
${
LIBRARY_NAME
}
SHARED sot-dynamic.cpp
)
TARGET_LINK_LIBRARIES
(
${
LIBRARY_NAME
}
jrl-dynamics
)
TARGET_LINK_LIBRARIES
(
${
LIBRARY_NAME
}
pinocchio
)
TARGET_LINK_LIBRARIES
(
${
LIBRARY_NAME
}
sot-core
)
TARGET_LINK_LIBRARIES
(
${
LIBRARY_NAME
}
dynamic-graph
)
PKG_CONFIG_USE_DEPENDENCY
(
${
LIBRARY_NAME
}
jrl-dynamics
)
PKG_CONFIG_USE_DEPENDENCY
(
${
LIBRARY_NAME
}
pinocchio
)
PKG_CONFIG_USE_DEPENDENCY
(
${
LIBRARY_NAME
}
sot-core
)
PKG_CONFIG_USE_DEPENDENCY
(
${
LIBRARY_NAME
}
dynamic-graph
)
TARGET_LINK_LIBRARIES
(
${
LIBRARY_NAME
}
${
Boost_LIBRARIES
}
)
INSTALL
(
TARGETS
${
LIBRARY_NAME
}
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
TARGET_LINK_LIBRARIES
(
dynamic
${
LIBRARY_NAME
}
)
...
...
src/dynamic-command.h
View file @
703347b2
...
...
@@ -33,123 +33,57 @@ namespace dynamicgraph { namespace sot {
using
::
dynamicgraph
::
command
::
Value
;
// Command SetFiles
class
SetFile
s
:
public
Command
class
SetFile
:
public
Command
{
public:
virtual
~
SetFile
s
()
{}
virtual
~
SetFile
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
SetFiles
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)
(
Value
::
STRING
)(
Value
::
STRING
)(
Value
::
STRING
),
docstring
)
SetFile
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
vrmlDirectory
=
values
[
0
].
value
();
std
::
string
vrmlMainFile
=
values
[
1
].
value
();
std
::
string
xmlSpecificityFiles
=
values
[
2
].
value
();
std
::
string
xmlRankFile
=
values
[
3
].
value
();
robot
.
setVrmlDirectory
(
vrmlDirectory
);
robot
.
setVrmlMainFile
(
vrmlMainFile
);
robot
.
setXmlSpecificityFile
(
xmlSpecificityFiles
);
robot
.
setXmlRankFile
(
xmlRankFile
);
// return void
std
::
string
urdfFile
=
values
[
0
].
value
();
robot
.
setUrdfFile
(
urdfFile
);
return
Value
();
}
};
// class SetFiles
// Command Parse
class
Parse
:
public
Command
{
public:
virtual
~
Parse
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
Parse
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
std
::
vector
<
Value
::
Type
>
(),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
if
(
!
robot
.
init
)
robot
.
parseConfigFiles
();
else
std
::
cout
<<
" !! Already parsed."
<<
std
::
endl
;
// return void
return
Value
();
}
};
// class Parse
// Command SetProperty
class
SetProperty
:
public
Command
// Command CreateRobot
class
CreateRobot
:
public
Command
{
public:
virtual
~
SetProperty
()
{}
virtual
~
CreateRobot
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
SetProperty
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boo
st
::
assign
::
list_of
(
Value
::
STRING
)(
Value
::
STRING
),
CreateRobot
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
st
d
::
vector
<
Value
::
Type
>
(
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
property
=
values
[
0
].
value
();
std
::
string
value
=
values
[
1
].
value
();
robot
.
m_HDR
->
setProperty
(
property
,
value
);
robot
.
createRobot
();
return
Value
();
}
};
// class SetProperty
// Command GetProperty
class
GetProperty
:
public
Command
{
public:
virtual
~
GetProperty
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
GetProperty
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
property
=
values
[
0
].
value
();
std
::
string
value
;
if
(
!
robot
.
m_HDR
->
getProperty
(
property
,
value
)
)
{
if
(
property
==
"vrmlDirectory"
)
value
=
robot
.
vrmlDirectory
;
else
if
(
property
==
"xmlSpecificityFile"
)
value
=
robot
.
xmlSpecificityFile
;
else
if
(
property
==
"xmlRankFile"
)
value
=
robot
.
xmlRankFile
;
else
if
(
property
==
"vrmlMainFile"
)
value
=
robot
.
vrmlMainFile
;
}
return
Value
(
value
);
}
};
// class GetProperty
};
// class CreateRobot
// Command
CreateRobot
class
CreateRobot
:
public
Command
// Command
DisplayModel
class
DisplayModel
:
public
Command
{
public:
virtual
~
CreateRobot
()
{}
virtual
~
DisplayModel
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
CreateRobot
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
DisplayModel
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
std
::
vector
<
Value
::
Type
>
(),
docstring
)
{
...
...
@@ -157,10 +91,10 @@ namespace dynamicgraph { namespace sot {
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
robot
.
createRobot
();
robot
.
displayModel
();
return
Value
();
}
};
// class
CreateRobot
};
// class
DisplayModel
// Command CreateJoint
class
CreateJoint
:
public
Command
...
...
@@ -187,38 +121,16 @@ namespace dynamicgraph { namespace sot {
}
};
// class CreateJoint
// Command SetRootJoint
class
SetRootJoint
:
public
Command
{
public:
virtual
~
SetRootJoint
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
SetRootJoint
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
jointName
=
values
[
0
].
value
();
robot
.
setRootJoint
(
jointName
);
return
Value
();
}
};
// class SetRootJoint
// Command AddJoint
class
AddJoint
:
public
Command
// Command AddBody
class
AddBody
:
public
Command
{
public:
virtual
~
Add
Joint
()
{}
virtual
~
Add
Body
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
Add
Joint
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)(
Value
::
STRING
),
Add
Body
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)(
Value
::
STRING
)
(
Value
::
STRING
)
,
docstring
)
{
}
...
...
@@ -227,37 +139,12 @@ namespace dynamicgraph { namespace sot {
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
parentName
=
values
[
0
].
value
();
std
::
string
childName
=
values
[
1
].
value
();
robot
.
addJoint
(
parentName
,
childName
);
std
::
string
jointName
=
values
[
1
].
value
();
std
::
string
childName
=
values
[
2
].
value
();
robot
.
addBody
(
parentName
,
jointName
,
childName
);
return
Value
();
}
};
// class AddJoint
// Command SetDofBounds
class
SetDofBounds
:
public
Command
{
public:
virtual
~
SetDofBounds
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
SetDofBounds
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)(
Value
::
UNSIGNED
)
(
Value
::
DOUBLE
)(
Value
::
DOUBLE
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
jointName
=
values
[
0
].
value
();
unsigned
int
dofId
=
values
[
1
].
value
();
double
minValue
=
values
[
2
].
value
();
double
maxValue
=
values
[
3
].
value
();
robot
.
setDofBounds
(
jointName
,
dofId
,
minValue
,
maxValue
);
return
Value
();
}
};
// class SetDofBounds
};
// class AddBody
// Command SetMass
class
SetMass
:
public
Command
...
...
@@ -331,17 +218,18 @@ namespace dynamicgraph { namespace sot {
}
};
// class SetInertiaMatrix
// Command Set
SpecificJoint
class
Set
SpecificJoint
:
public
Command
// Command Set
InertiaProperties
class
Set
InertiaProperties
:
public
Command
{
public:
virtual
~
Set
SpecificJoint
()
{}
virtual
~
Set
InertiaProperties
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
SetSpecificJoint
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)(
Value
::
STRING
),
docstring
)
SetInertiaProperties
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)
(
Value
::
DOUBLE
)(
Value
::
VECTOR
)(
Value
::
MATRIX
),
docstring
)
{
}
virtual
Value
doExecute
()
...
...
@@ -349,75 +237,49 @@ namespace dynamicgraph { namespace sot {
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
jointName
=
values
[
0
].
value
();
std
::
string
jointType
=
values
[
1
].
value
();
robot
.
setSpecificJoint
(
jointName
,
jointType
);
double
mass
=
values
[
1
].
value
();
dynamicgraph
::
Vector
com
=
values
[
2
].
value
();
dynamicgraph
::
Matrix
inertiaMatrix
=
values
[
3
].
value
();
robot
.
setInertiaProperties
(
jointName
,
mass
,
com
,
inertiaMatrix
);
return
Value
();
}
};
// class Set
SpecificJoint
};
// class Set
InertiaMatrix
// Command SetHandParameters
class
SetHandParameters
:
public
Command
{
public:
virtual
~
SetHandParameters
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
SetHandParameters
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
BOOL
)(
Value
::
VECTOR
)
(
Value
::
VECTOR
)(
Value
::
VECTOR
)(
Value
::
VECTOR
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
bool
right
=
values
[
0
].
value
();
dynamicgraph
::
Vector
center
=
values
[
1
].
value
();
dynamicgraph
::
Vector
thumbAxis
=
values
[
2
].
value
();
dynamicgraph
::
Vector
forefingerAxis
=
values
[
3
].
value
();
dynamicgraph
::
Vector
palmNormalAxis
=
values
[
4
].
value
();
robot
.
setHandParameters
(
right
,
center
,
thumbAxis
,
forefingerAxis
,
palmNormalAxis
);
return
Value
();
}
};
// class SetHandParameters
// Command SetFootParameters
class
SetFootParameters
:
public
Command
// Command SetLowerPositionLimit
class
SetLowerPositionLimit
:
public
Command
{
public:
virtual
~
Set
FootParameters
()
{}
virtual
~
Set
LowerPositionLimit
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
Set
FootParameters
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
BOOL
)(
Value
::
DOUBLE
)
(
Value
::
DOUBLE
)(
Value
::
VECTOR
),
docstring
)
Set
LowerPositionLimit
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)(
Value
::
VECTOR
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
bool
right
=
values
[
0
].
value
();
double
soleLength
=
values
[
1
].
value
();
double
soleWidth
=
values
[
2
].
value
();
dynamicgraph
::
Vector
anklePosition
=
values
[
3
].
value
();
robot
.
setFootParameters
(
right
,
soleLength
,
soleWidth
,
anklePosition
);
std
::
string
jointName
=
values
[
0
].
value
();
dg
::
Vector
in_vector
=
values
[
1
].
value
();
robot
.
setLowerPositionLimit
(
jointName
,
in_vector
);
return
Value
();
}
};
// class Set
footparameters
};
// class Set
LowerPositionLimit
// Command Set
GazeParameters
class
Set
GazeParameters
:
public
Command
// Command Set
UpperPositionLimit
class
Set
UpperPositionLimit
:
public
Command
{
public:
virtual
~
Set
GazeParameters
()
{}
virtual
~
Set
UpperPositionLimit
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
Set
GazeParameters
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
VECTOR
)(
Value
::
VECTOR
),
Set
UpperPositionLimit
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)(
Value
::
VECTOR
),
docstring
)
{
}
...
...
@@ -425,114 +287,64 @@ namespace dynamicgraph { namespace sot {
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
dynamicgraph
::
Vector
gazeOrigin
=
values
[
0
].
value
();
d
ynamicgraph
::
Vector
gazeDirection
=
values
[
1
].
value
();
robot
.
set
GazeParameters
(
gazeOrigin
,
gazeDirection
);
std
::
string
jointName
=
values
[
0
].
value
();
d
g
::
Vector
in_vector
=
values
[
1
].
value
();
robot
.
set
UpperPositionLimit
(
jointName
,
in_vector
);
return
Value
();
}
};
// class Set
GazeParameters
};
// class Set
UpperPositionLimit
// Command
InitializeRobo
t
class
InitializeRobo
t
:
public
Command
// Command
SetMaxVelocityLimi
t
class
SetMaxVelocityLimi
t
:
public
Command
{
public:
virtual
~
InitializeRobo
t
()
{}
virtual
~
SetMaxVelocityLimi
t
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
InitializeRobo
t
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
std
::
vector
<
Value
::
Type
>
(
),
SetMaxVelocityLimi
t
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)(
Value
::
VECTOR
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
robot
.
m_HDR
->
initialize
();
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
jointName
=
values
[
0
].
value
();
dg
::
Vector
in_vector
=
values
[
1
].
value
();
robot
.
setMaxVelocityLimit
(
jointName
,
in_vector
);
return
Value
();
}
};
// class
InitializeRobo
t
};
// class
SetMaxVelocityLimi
t
// Command GetDimension
class
GetDimension
:
public
Command
{
public:
virtual
~
GetDimension
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
GetDimension
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
std
::
vector
<
Value
::
Type
>
(),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
unsigned
int
dimension
=
robot
.
m_HDR
->
numberDof
();
return
Value
(
dimension
);
}
};
// class GetDimension
// Command
Wr
it
e
class
Wr
it
e
:
public
Command
// Command
SetMaxEffortLim
it
class
SetMaxEffortLim
it
:
public
Command
{
public:
virtual
~
Wr
it
e
()
{}
virtual
~
SetMaxEffortLim
it
()
{}
/// Create command and store it in Entity
/// \param entity instance of Entity owning this command
/// \param docstring documentation of the command
Wr
it
e
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
),
docstring
)
SetMaxEffortLim
it
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
STRING
)
(
Value
::
VECTOR
)
,
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
std
::
string
filename
=
values
[
0
].
value
();
std
::
ofstream
file
(
filename
.
c_str
(),
std
::
ios_base
::
out
);
file
<<
*
(
robot
.
m_HDR
);
file
.
close
();
std
::
string
jointName
=
values
[
0
].
value
();
dg
::
Vector
in_vector
=
values
[
1
].
value
();
robot
.
setMaxEffortLimit
(
jointName
,
in_vector
);
return
Value
();
}
};
// class Write
};
// class SetMaxEffortLimit
class
GetHandParameter
:
public
Command
{
public:
virtual
~
GetHandParameter
()
{}
GetHandParameter
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
BOOL
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
bool
right
=
values
[
0
].
value
();
dynamicgraph
::
Matrix
handParameter
(
4
,
4
);
handParameter
.
setIdentity
();
CjrlHand
*
hand
;
if
(
right
)
hand
=
robot
.
m_HDR
->
rightHand
();
else
hand
=
robot
.
m_HDR
->
leftHand
();
jrlMathTools
::
Vector3D
<
double
>
axis
;
hand
->
getThumbAxis
(
axis
);
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
handParameter
(
i
,
0
)
=
axis
(
i
);
hand
->
getForeFingerAxis
(
axis
);
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
handParameter
(
i
,
1
)
=
axis
(
i
);
hand
->
getPalmNormal
(
axis
);
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
handParameter
(
i
,
2
)
=
axis
(
i
);
hand
->
getCenter
(
axis
);
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
handParameter
(
i
,
3
)
=
axis
(
i
);
return
Value
(
handParameter
);
}
};
// class GetHandParameter
}
// namespace command
}
/* namespace sot */
}
/* namespace dynamicgraph */
...
...
src/dynamic_graph/sot/dynamics/__init__.py
View file @
703347b2
from
dynamic
import
Dynamic
from
angle_estimator
import
AngleEstimator
from
zmp_from_forces
import
ZmpFromForces
DynamicOld
=
Dynamic
#class Dynamic (DynamicOld):
# def __init__(self):
# def getPinocchioModel():
src/matrix-inertia.cpp
View file @
703347b2
...
...
@@ -23,8 +23,8 @@
#include
<map>
#include
<sot-dynamic/matrix-inertia.h>
#include
<jrl/dynamics/Joint.h>
#include
<jrl/dynamics/HumanoidDynamicMultiBody.h>
//
#include <jrl/dynamics/Joint.h>
//
#include <jrl/dynamics/HumanoidDynamicMultiBody.h>
#include
<abstract-robot-dynamics/robot-dynamics-object-constructor.hh>
#include
<sot/core/debug.hh>
...
...
src/sot-dynamic.cpp
View file @
703347b2
This diff is collapsed.
Click to expand it.
unitTesting/CMakeLists.txt
View file @
703347b2
...
...
@@ -16,23 +16,29 @@
ADD_DEFINITIONS
(
-DDEBUG=2
)
SET
(
tests
dummy
test_djj
test_dyn
test_results
)
dev_test_all_compute
# dummy
# test_djj