[SOLVED] From NRP on PC I cannot lunch the experiments


#1

I have got these errors:

rospy.ServiceException
Error starting the simulation. (host: localhost)

What can I do? Thanks! Daniele


#2

Could you provide more information about the errors?

A more detailed error log would be very helpful in diagnosing the problem.

Ugo


#3

OK…I have installed on my PC the NRP following the steps here https://bitbucket.org/hbpneurorobotics/neurorobotics-platform … after typing
cle-nginx
cle-start
cle-frontend

following the instructions, I put nrpuser/password as user and password…until here everything seems OK. Then appears a list of experiments. I have selected an experiment and I have pressed the button “Launch”.

After few seconds appears a window where there is written
rospy.ServiceException
Error starting the simulation. (host: localhost)

and where there is a button where there is written “Show scary details”…clicking on this button appears this:

ERROR TYPE
rospy.ServiceException

ERROR CODE
-1

MESSAGE
Error starting the simulation. (host: localhost)

DATA
service [/ros_cle_simulation/create_new_simulation] responded with an error: error processing request: No module named defusedxml.xmlrpc

STACK TRACE
ClbError@http://localhost:9000/bower_components/angular-hbp-collaboratory/angular-hbp-collaboratory.js:2697:17
error@http://localhost:9000/bower_components/angular-hbp-collaboratory/angular-hbp-collaboratory.js:2738:14
controller@http://localhost:9000/bower_components/angular-hbp-collaboratory/angular-hbp-collaboratory.js:4434:20
invoke@http://localhost:9000/bower_components/angular/angular.js:4570:14
$ControllerProvider/this.$get</</instantiate<@http://localhost:9000/bower_components/angular/angular.js:9445:24
resolveSuccess@http://localhost:9000/bower_components/angular-bootstrap/ui-bootstrap-tpls.js:4154:34
processQueue@http://localhost:9000/bower_components/angular/angular.js:15122:28
scheduleProcessQueue/<@http://localhost:9000/bower_components/angular/angular.js:15138:27
$eval@http://localhost:9000/bower_components/angular/angular.js:16384:16
$digest@http://localhost:9000/bower_components/angular/angular.js:16200:15
$apply@http://localhost:9000/bower_components/angular/angular.js:16492:13
done@http://localhost:9000/bower_components/angular/angular.js:10872:36
completeRequest@http://localhost:9000/bower_components/angular/angular.js:11070:7
requestLoaded@http://localhost:9000/bower_components/angular/angular.js:11011:9

This is all.
Daniele


#4

Could you try to do a

make devinstall

in $NRP/ExDBackend

Alternatively, go to $NRP/user-scripts and execute ./update_nrp update all

Regards,
Manos


#5

I tried both solutions but still the same problem. Below the output of the console where I launched cle-start

2017-10-26 16:24:05,993 [uWSGIWorker1] [hbp_nrp_back] [INFO] Requesting simulation resources
2017-10-26 16:24:05,993 [uWSGIWorker1] [hbp_nrp_back] [INFO] simulation timeout initialized
2017-10-26 16:24:05,995 [Thread-17 ] [hbp_nrp_cles] [INFO] Create new simulation request
2017-10-26 16:24:05,995 [Thread-17 ] [hbp_nrp_cles] [INFO] No simulation running, starting a new simulation.
2017-10-26 16:24:05,996 [Thread-17 ] [hbp_nrp_cles] [INFO] Preparing new simulation with environment file: /home/danielecaligiore/Documents/NRP/Models/p3dxbenchmark_world/p3dxbenchmark_world.sdf and ExD config file: /home/danielecaligiore/Documents/NRP/Experiments/benchmark_p3dx/BenchmarkPioneer.exc.
2017-10-26 16:24:05,996 [Thread-17 ] [hbp_nrp_cles] [INFO] Starting the experiment closed loop engine.
2017-10-26 16:24:05,996 [Thread-17 ] [hbp_nrp_cles] [INFO] Read XML Files
2017-10-26 16:24:05,999 [Thread-17 ] [hbp_nrp_cles] [INFO] Bibi: template_pioneer.bibi
2017-10-26 16:24:06,000 [Thread-17 ] [hbp_nrp_cles] [INFO] BibiAbs:/home/danielecaligiore/Documents/NRP/Experiments/benchmark_p3dx/template_pioneer.bibi
2017-10-26 16:24:06,003 [Thread-17 ] [hbp_nrp_cles] [INFO] Creating local CLELauncher object
2017-10-26 16:24:06,003 [Thread-17 ] [hbp_nrp_cles] [ERROR] Initialization failed
Traceback (most recent call last):
File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/ROSCLESimulationFactory.py”, line 177, in create_new_simulation
from hbp_nrp_cleserver.server.CLELauncher import CLELauncher
File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/CLELauncher.py”, line 57, in
from hbp_nrp_cleserver.server.ROSLaunch import ROSLaunch
File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/ROSLaunch.py”, line 33, in
import roslaunch
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/init.py”, line 50, in
from . import core as roslaunch_core
ImportError: cannot import name core
(<type ‘exceptions.ImportError’>, ImportError(‘cannot import name core’,), <traceback object at 0x7fcc50071878>)
[ERROR] [1509027846.003746]: Error processing request: cannot import name core
[‘Traceback (most recent call last):\n’, ’ File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py”, line 625, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n’, ’ File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/ROSCLESimulationFactory.py”, line 177, in create_new_simulation\n from hbp_nrp_cleserver.server.CLELauncher import CLELauncher\n’, ’ File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/CLELauncher.py”, line 57, in \n from hbp_nrp_cleserver.server.ROSLaunch import ROSLaunch\n’, ’ File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/ROSLaunch.py”, line 33, in \n import roslaunch\n’, ’ File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/init.py”, line 50, in \n from . import core as roslaunch_core\n’, ‘ImportError: cannot import name core\n’]
2017-10-26 16:24:06,003 [Thread-17 ] [rosout ] [ERROR] Error processing request: cannot import name core
[‘Traceback (most recent call last):\n’, ’ File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py”, line 625, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n’, ’ File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/ROSCLESimulationFactory.py”, line 177, in create_new_simulation\n from hbp_nrp_cleserver.server.CLELauncher import CLELauncher\n’, ’ File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/CLELauncher.py”, line 57, in \n from hbp_nrp_cleserver.server.ROSLaunch import ROSLaunch\n’, ’ File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/ROSLaunch.py”, line 33, in \n import roslaunch\n’, ’ File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/init.py”, line 50, in \n from . import core as roslaunch_core\n’, ‘ImportError: cannot import name core\n’]
2017-10-26 16:24:06,004 [uWSGIWorker1] [hbp_nrp_back] [INFO] State machine outcomes:
2017-10-26 16:24:07,011 [uWSGIWorker1] [hbp_nrp_back] [ERROR] ‘Error starting the simulation.’ (rospy.ServiceException)
Traceback (most recent call last):
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/flask/app.py”, line 1612, in full_dispatch_request
rv = self.dispatch_request()
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/flask/app.py”, line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/flask_restful/init.py”, line 480, in wrapper
resp = resource(*args, **kwargs)
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/flask/views.py”, line 84, in view
return self.dispatch_request(*args, **kwargs)
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/flask_restful/init.py”, line 595, in dispatch_request
resp = meth(*args, **kwargs)
File “./hbp_nrp_backend/rest_server/__SimulationService.py”, line 177, in post
sim.state = “initialized”
File “./hbp_nrp_backend/simulation_control/__Simulation.py”, line 228, in state
self.__lifecycle.accept_command(new_state)
File “/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_commons/hbp_nrp_commons/simulation_lifecycle.py”, line 182, in accept_command
self.__machine.events[command].trigger()
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/transitions/extensions/locking.py”, line 22, in trigger
super(LockedEvent, self).trigger(*args, **kwargs)
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/transitions/core.py”, line 222, in trigger
return self.machine.process(f)
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/transitions/extensions/locking.py”, line 15, in call
return self.func(*args, **kwargs)
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/transitions/core.py”, line 526, in process
return trigger()
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/transitions/core.py”, line 247, in _trigger
if t.execute(event):
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/transitions/core.py”, line 145, in execute
machine.callback(func, event_data)
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/transitions/extensions/locking.py”, line 15, in call
return self.func(*args, **kwargs)
File “/home/danielecaligiore/.opt/platform_venv/lib/python2.7/site-packages/transitions/core.py”, line 516, in callback
func(event_data)
File “./hbp_nrp_backend/simulation_control/__BackendSimulationLifecycle.py”, line 179, in initialize
data=e.message)
NRPServicesGeneralException: ‘Error starting the simulation.’ (rospy.ServiceException)


#6

Hi Daniele, it looks like something is wrong with ROS, it is either not properly installed or the ros packages are not in your $PYTHONPATH. We can take a look together if you want either today (until 17:30) or tomorrow.

Regards,
Manos


#7

OK for me today. Let me know what can I do…this is my PYTHONPATH…Could be a problem the fact that I’m using a python virtual environment?

(venv) danielecaligiore@danielecaligiore-Alienware-Aurora-R6:~$ echo $PYTHONPATH
/home/danielecaligiore/Documents/NRP/retina/build/lib:/home/danielecaligiore/Documents/NRP/GazeboRosPackages/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/danielecaligiore/.local/lib/python2.7/site-packages:/home/danielecaligiore/Documents/NRP/GazeboRosPackages/devel/lib/python2.7/dist-packages:/home/danielecaligiore/Documents/NRP/CLE/hbp_nrp_cle:/home/danielecaligiore/Documents/NRP/ExperimentControl/hbp_nrp_excontrol:/home/danielecaligiore/Documents/NRP/ExperimentControl/hbp_nrp_scxml:/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_backend:/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_cleserver:/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_commons:/home/danielecaligiore/Documents/NRP/ExDBackend/hbp_nrp_watchdog:/home/danielecaligiore/Documents/NRP/ExDBackend/hbp-flask-restful-swagger-master:/home/danielecaligiore/Documents/NRP/VirtualCoach/hbp_nrp_virtual_coach:/home/danielecaligiore/Documents/NRP/BrainSimulation/hbp_nrp_music_xml:/home/danielecaligiore/Documents/NRP/BrainSimulation/hbp_nrp_music_interface


#8

send me your skype name please, I will delete this post


#9

I have tried to do this…

rebuild gazebo

cd $HBP/gazebo
rm -rf build
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DENABLE_TESTS_COMPILATION:BOOL=False …
make -j8 # adapt 8 to the number of cores of your computer
make install

then, close the current terminal, reopen it and:

cd $HBP/GazeboRosPackages
rm -rf build devel
catkin_make

but I got an error:
Base path: /home/danielecaligiore/Documents/NRP/GazeboRosPackages
Source space: /home/danielecaligiore/Documents/NRP/GazeboRosPackages/src
Build space: /home/danielecaligiore/Documents/NRP/GazeboRosPackages/build
Devel space: /home/danielecaligiore/Documents/NRP/GazeboRosPackages/devel
Install space: /home/danielecaligiore/Documents/NRP/GazeboRosPackages/install

Running command: “cmake /home/danielecaligiore/Documents/NRP/GazeboRosPackages/src -DCATKIN_DEVEL_PREFIX=/home/danielecaligiore/Documents/NRP/GazeboRosPackages/devel -DCMAKE_INSTALL_PREFIX=/home/danielecaligiore/Documents/NRP/GazeboRosPackages/install -G Unix Makefiles” in “/home/danielecaligiore/Documents/NRP/GazeboRosPackages/build”

– Using CATKIN_DEVEL_PREFIX: /home/danielecaligiore/Documents/NRP/GazeboRosPackages/devel
– Using CMAKE_PREFIX_PATH: /home/danielecaligiore/.local/lib/x86_64-linux-gnu/cmake/sdformat;/home/danielecaligiore/.local/lib/x86_64-linux-gnu/cmake/gazebo/;/opt/ros/kinetic
– This workspace overlays: /opt/ros/kinetic
– Using PYTHON_EXECUTABLE: /home/danielecaligiore/venv/bin/python
– Using Debian Python package layout
– Using empy: /usr/bin/empy
– Using CATKIN_ENABLE_TESTING: ON
– Call enable_testing()
– Using CATKIN_TEST_RESULTS_DIR: /home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/test_results
– Found gtest sources under ‘/usr/src/gtest’: gtests will be built
– Using Python nosetests: /usr/bin/nosetests-2.7
ImportError: “from catkin_pkg.package import parse_package” failed: No module named catkin_pkg.package
Make sure that you have installed “catkin_pkg”, it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/home/danielecaligiore/venv/bin/python
“/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py”
“/opt/ros/kinetic/share/catkin/cmake/…/package.xml”
“/home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/catkin/catkin_generated/version/package.cmake”)
returned error code 1
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:63 (safe_execute_process)
/opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
/opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:52 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeOutput.log”.
See also “/home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeError.log”.
Invoking “cmake” failed

this is the log
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" “cmTC_77cf1/fast”
/usr/bin/make -f CMakeFiles/cmTC_77cf1.dir/build.make CMakeFiles/cmTC_77cf1.dir/build
make[1]: Entering directory ‘/home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeTmp’
Building C object CMakeFiles/cmTC_77cf1.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_77cf1.dir/CheckSymbolExists.c.o -c /home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_77cf1
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_77cf1.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_77cf1.dir/CheckSymbolExists.c.o -o cmTC_77cf1 -rdynamic
CMakeFiles/cmTC_77cf1.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x16): undefined reference topthread_create’
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_77cf1.dir/build.make:97: recipe for target ‘cmTC_77cf1’ failed
make[1]: *** [cmTC_77cf1] Error 1
make[1]: Leaving directory ‘/home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeTmp’
Makefile:126: recipe for target ‘cmTC_77cf1/fast’ failed
make: *** [cmTC_77cf1/fast] Error 2

File /home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" “cmTC_5b897/fast”
/usr/bin/make -f CMakeFiles/cmTC_5b897.dir/build.make CMakeFiles/cmTC_5b897.dir/build
make[1]: Entering directory ‘/home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeTmp’
Building C object CMakeFiles/cmTC_5b897.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_5b897.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_5b897
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5b897.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_5b897.dir/CheckFunctionExists.c.o -o cmTC_5b897 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_5b897.dir/build.make:97: recipe for target ‘cmTC_5b897’ failed
make[1]: *** [cmTC_5b897] Error 1
make[1]: Leaving directory ‘/home/danielecaligiore/Documents/NRP/GazeboRosPackages/build/CMakeFiles/CMakeTmp’
Makefile:126: recipe for target ‘cmTC_5b897/fast’ failed
make: *** [cmTC_5b897/fast] Error 2


#10

I have re-installed from scratch. Now it works. Thanks!