Closed MaximilienNaveau closed 3 years ago
Adding some debug logs, it seems the call from the client to the server happens. However, the server gets stuck in this method:
void RosPythonInterpreterServer::run_python_file(const std::string ifilename,
std::string& standard_error)
{
interpreter_.runPythonFile(ifilename, standard_error);
}
/controllers$ ros2 run dynamic_graph_manager remote_python_client pd_controller.py
[INFO] [RosPythonInterpreterClient]: Waiting for service /dynamic_graph_manager/run_python_command ...
[INFO] [RosPythonInterpreterClient]: Successfully connected to /dynamic_graph_manager/run_python_command
[INFO] [RosPythonInterpreterClient]: Waiting for service /dynamic_graph_manager/run_python_file ...
[INFO] [RosPythonInterpreterClient]: Successfully connected to /dynamic_graph_manager/run_python_file
RosPythonInterpreterClient::run_python_script
RosPythonInterpreterClient::run_python_script. Got file
RosPythonInterpreterClient::run_python_script. Making async request.
RosPythonInterpreterClient::run_python_script. After making async request.
dg_blmc_robots# ./dg_main_solo12
[...]
RosPythonInterpreterServer::runPythonFileCallback. req->input=/home/jviereck/dev/blmc_testing/workspace/src/dg_demos/src/dg_demos/solo12/controllers/pd_controller.py
instead of calling the C++ run_scripts we could call the C++ run_python_command with a python command that parse the script?
Loading the script first into content
and then executing it gives the following result:
>>> exec(content)
[ERROR] [rclcpp]: Error while parsing command, retrying...
[ERROR] [rclcpp]: Error while parsing command, retrying...
[ERROR] [rclcpp]: Error while parsing command, retrying...
[ERROR] [rclcpp]: Error while parsing command, retrying...
where there is a new [ERROR] [rclcpp]: Error while parsing command, retrying...
printed every second.
The problem came from the import from scipy. The huge import might get the real-time process in a racing condition.
After removing the import we can run the demos nicely.
Running on Solo12 we have this issue. The following command hang.
With this output: