Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic-graph-python
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
dynamic-graph-python
Commits
b0332dd2
"...git@gitlab.laas.fr:stack-of-tasks/eigenpy.git" did not exist on "7102d83447795424665fbcd61a97030fedca68b5"
Commit
b0332dd2
authored
1 year ago
by
Florent Lamiraux
Browse files
Options
Downloads
Patches
Plain Diff
Provide support for long int (and unsigned) for functions and signals.
parent
c5337273
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
src/dynamic_graph/convert-dg-to-py.cc
+8
-0
8 additions, 0 deletions
src/dynamic_graph/convert-dg-to-py.cc
src/dynamic_graph/signal-base-py.cc
+31
-11
31 additions, 11 deletions
src/dynamic_graph/signal-base-py.cc
with
39 additions
and
11 deletions
src/dynamic_graph/convert-dg-to-py.cc
+
8
−
0
View file @
b0332dd2
...
...
@@ -29,8 +29,12 @@ command::Value toValue(bp::object o, const command::Value::Type& valueType) {
return
Value
(
bp
::
extract
<
bool
>
(
o
));
case
(
Value
::
UNSIGNED
):
return
Value
(
bp
::
extract
<
unsigned
>
(
o
));
case
(
Value
::
UNSIGNEDLONGINT
):
return
Value
(
bp
::
extract
<
unsigned
long
int
>
(
o
));
case
(
Value
::
INT
):
return
Value
(
bp
::
extract
<
int
>
(
o
));
case
(
Value
::
LONGINT
):
return
Value
(
bp
::
extract
<
long
int
>
(
o
));
case
(
Value
::
FLOAT
):
return
Value
(
bp
::
extract
<
float
>
(
o
));
case
(
Value
::
DOUBLE
):
...
...
@@ -67,8 +71,12 @@ bp::object fromValue(const command::Value& value) {
return
bp
::
object
(
value
.
boolValue
());
case
(
Value
::
UNSIGNED
):
return
bp
::
object
(
value
.
unsignedValue
());
case
(
Value
::
UNSIGNEDLONGINT
):
return
bp
::
object
(
value
.
unsignedlongintValue
());
case
(
Value
::
INT
):
return
bp
::
object
(
value
.
intValue
());
case
(
Value
::
LONGINT
):
return
bp
::
object
(
value
.
longintValue
());
case
(
Value
::
FLOAT
):
return
bp
::
object
(
value
.
floatValue
());
case
(
Value
::
DOUBLE
):
...
...
This diff is collapsed.
Click to expand it.
src/dynamic_graph/signal-base-py.cc
+
31
−
11
View file @
b0332dd2
...
...
@@ -77,9 +77,9 @@ void exposeSignalBase(const char* name) {
})
.
def
(
"displayDependencies"
,
+
[](
const
S_t
&
s
,
sigtime_t
time
)
->
std
::
string
{
+
[](
const
S_t
&
s
,
int
depth
)
->
std
::
string
{
std
::
ostringstream
oss
;
s
.
displayDependencies
(
oss
,
time
);
s
.
displayDependencies
(
oss
,
depth
);
return
oss
.
str
();
},
"Print the signal dependencies in a string"
);
...
...
@@ -108,7 +108,10 @@ void exposeSignals() {
exposeSignalBase
<
sigtime_t
>
(
"SignalBase"
);
exposeSignalsOfType
<
bool
,
sigtime_t
>
(
"Bool"
);
exposeSignalsOfType
<
unsigned
int
,
sigtime_t
>
(
"UInt"
);
exposeSignalsOfType
<
int
,
sigtime_t
>
(
"Int"
);
exposeSignalsOfType
<
uint64_t
,
sigtime_t
>
(
"UInt64"
);
exposeSignalsOfType
<
int64_t
,
sigtime_t
>
(
"Int64"
);
exposeSignalsOfType
<
double
,
sigtime_t
>
(
"Double"
);
exposeSignalsOfType
<
Vector
,
sigtime_t
>
(
"Vector"
);
...
...
@@ -158,15 +161,32 @@ SignalBase<sigtime_t>* createSignalWrapper(const char* name, const char* type,
SignalBase
<
sigtime_t
>*
obj
=
NULL
;
std
::
string
error
;
SIGNAL_WRAPPER_TYPE
(
if
,
BOOL
,
bool
)
// SIGNAL_WRAPPER_TYPE(else if, UNSIGNED ,bool)
SIGNAL_WRAPPER_TYPE
(
else
if
,
INT
,
int
)
SIGNAL_WRAPPER_TYPE
(
else
if
,
FLOAT
,
float
)
SIGNAL_WRAPPER_TYPE
(
else
if
,
DOUBLE
,
double
)
// SIGNAL_WRAPPER_TYPE(else if, STRING ,bool)
SIGNAL_WRAPPER_TYPE
(
else
if
,
VECTOR
,
Vector
)
// SIGNAL_WRAPPER_TYPE(else if, MATRIX ,bool)
// SIGNAL_WRAPPER_TYPE(else if, MATRIX4D ,bool)
if
(
command
::
Value
::
typeName
(
command
::
Value
::
BOOL
).
compare
(
type
)
==
0
)
{
obj
=
createSignalWrapperTpl
<
bool
>
(
name
,
object
,
error
);
}
else
if
(
command
::
Value
::
typeName
(
command
::
Value
::
UNSIGNED
).
compare
(
type
)
==
0
)
{
obj
=
createSignalWrapperTpl
<
unsigned
int
>
(
name
,
object
,
error
);
}
else
if
(
command
::
Value
::
typeName
(
command
::
Value
::
INT
).
compare
(
type
)
==
0
)
{
obj
=
createSignalWrapperTpl
<
int
>
(
name
,
object
,
error
);
}
else
if
(
command
::
Value
::
typeName
(
command
::
Value
::
UNSIGNEDLONGINT
).
compare
(
type
)
==
0
){
obj
=
createSignalWrapperTpl
<
uint64_t
>
(
name
,
object
,
error
);
}
else
if
(
command
::
Value
::
typeName
(
command
::
Value
::
LONGINT
).
compare
(
type
)
==
0
){
obj
=
createSignalWrapperTpl
<
int64_t
>
(
name
,
object
,
error
);
}
else
if
(
command
::
Value
::
typeName
(
command
::
Value
::
FLOAT
).
compare
(
type
)
==
0
){
obj
=
createSignalWrapperTpl
<
float
>
(
name
,
object
,
error
);
}
else
if
(
command
::
Value
::
typeName
(
command
::
Value
::
DOUBLE
).
compare
(
type
)
==
0
){
obj
=
createSignalWrapperTpl
<
double
>
(
name
,
object
,
error
);
}
else
if
(
command
::
Value
::
typeName
(
command
::
Value
::
VECTOR
).
compare
(
type
)
==
0
){
obj
=
createSignalWrapperTpl
<
Vector
>
(
name
,
object
,
error
);
}
else
{
error
=
"Type not understood"
;
}
...
...
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