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-talos
Commits
90db097e
Commit
90db097e
authored
Mar 18, 2018
by
Olivier Stasse
Browse files
Add ROS_INFO and ROS_ERROR informations when using runPython.
parent
effe7be3
Pipeline
#1276
failed with stage
in 14 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/sot-pyrene-controller.cpp
View file @
90db097e
...
...
@@ -30,6 +30,7 @@ void SoTPyreneController::startupPython()
{
SoTTalosController
::
startupPython
();
std
::
ofstream
aof
(
LOG_PYTHON_PYRENE
.
c_str
());
runPython
(
aof
,
"from dynamic_graph.sot.pyrene.prologue import robot"
,
...
...
src/sot-talos-controller.cpp
View file @
90db097e
...
...
@@ -20,6 +20,9 @@
#include
<boost/thread/thread.hpp>
#include
<boost/thread/condition.hpp>
#include
<ros/console.h>
const
std
::
string
SoTTalosController
::
LOG_PYTHON
=
"/tmp/TalosController_python.out"
;
using
namespace
std
;
...
...
@@ -133,8 +136,9 @@ runPython(std::ostream& file,
dynamicgraph
::
Interpreter
&
interpreter
)
{
file
<<
">>> "
<<
command
<<
std
::
endl
;
std
::
string
l
err
(
""
),
lout
(
""
),
l
res
(
""
);
std
::
string
l
res
(
""
),
lout
(
""
),
l
err
(
""
);
interpreter
.
runCommand
(
command
,
lres
,
lout
,
lerr
);
if
(
lres
!=
"None"
)
{
if
(
lres
==
"<NULL>"
)
...
...
@@ -142,9 +146,14 @@ runPython(std::ostream& file,
file
<<
lout
<<
std
::
endl
;
file
<<
"------"
<<
std
::
endl
;
file
<<
lerr
<<
std
::
endl
;
ROS_INFO
(
lout
.
c_str
());
ROS_ERROR
(
lerr
.
c_str
());
}
else
file
<<
lres
<<
std
::
endl
;
{
file
<<
lres
<<
std
::
endl
;
ROS_INFO
(
lres
.
c_str
());
}
}
}
...
...
src/sot-talos-controller.hh
View file @
90db097e
...
...
@@ -52,7 +52,8 @@ class SoTTalosController: public
// Update output port with the control computed from the
// dynamic graph.
void
updateRobotState
(
std
::
vector
<
double
>
&
anglesIn
);
/// Run a python command
void
runPython
(
std
::
ostream
&
file
,
const
std
::
string
&
command
,
dynamicgraph
::
Interpreter
&
interpreter
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment