uuvsimulator / uuv_simulator

Gazebo/ROS packages for underwater robotics simulation
https://uuvsimulator.github.io/
Other
694 stars 360 forks source link

[Please help me] Error with receive the waypoint and apply to rexrov #198

Closed phamhoanganhbk closed 6 years ago

phamhoanganhbk commented 6 years ago

Hi everyone,

I am trying to run roslaunch uuv_tutorial_dp_controller start_tutorial_dp_controller_demo.launch then roslaunch uuv_control_utils send_waypoints_file.launch uuv_name:=rexrov

So i have some errors as following:

Send a waypoint file, namespace= /rexrov/ Negative start time, setting it to 0.0 Check point #2 Traceback (most recent call last): File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_control_utils/scripts/send_waypoint_file.py", line 64, in String(filename)) File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in call return self.call(*args, *kwds) File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 495, in call service_uri = self._get_service_uri(request) File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 463, in _get_service_uri raise ServiceException("service [%s] unavailable"%self.resolved_name) rospy.service.ServiceException: service [/rexrov/init_waypoints_from_file] unavailable [rexrov/send_waypoint_file-1] process has died [pid 4701, exit code 1, cmd /home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_control_utils/scripts/send_waypoint_file.py name:=send_waypoint_file log:=/home/pha/.ros/log/faebb1f8-0d95-11e8-b26f-5891cf6e920e/rexrov-send_waypoint_file-1.log]. log file: /home/pha/.ros/log/faebb1f8-0d95-11e8-b26f-5891cf6e920e/rexrov-send_waypoint_file-1.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete

I used the "check_point" and I saw that there is error at file send_waypoint_file.py (line 48)

try: rospy.wait_for_service('init_waypoints_from_file', timeout=2) print 'Check point #1' except rospy.ROSException: rospy.ROSException('Service not available! Closing node...') print 'Check point #2'

Could you give me any ideas to fix it, please? Thank you very much,

musamarcusso commented 6 years ago

Hi @phamhoanganhbk,

I had seen this issue on my end once, it seems that the node providing this service wasn't loaded before the call for the send waypoint file command. If you update the simulator to the latest version in the master branch, I increased the timeout

https://github.com/uuvsimulator/uuv_simulator/blob/master/uuv_control/uuv_control_utils/scripts/send_waypoint_file.py#L49

Check if this fixes it for you.

Best, Musa

phamhoanganhbk commented 6 years ago

Hi Musa,

Thank you very much for your answers (it is so fast :D) I have just updated the latest version in the master branch. But it isn't working too. So, I increased the timeout = 60. It is the same errors.

I think maybe i have a problem with ROS.

Have a nice day, Hoang-anh

musamarcusso commented 6 years ago

Hi @phamhoanganhbk, you could try calling the service using the command line with rosservice call to see if it works.

rosservice call /rexrov/init_waypoints_from_file "start_time:
  data:
    secs: 0
    nsecs: 0
start_now: true
filename:
  data: '<path to the waypoint file>'" 
musamarcusso commented 6 years ago

You could also run rosservice list and see if the service is available. Do you have the log file? Maybe it is easier to see there what happened.

phamhoanganhbk commented 6 years ago

Hi @musamarcusso ,

Here is my log file :

[rospy.client][INFO] 2018-02-09 15:32:25,704: init_node, name[/rexrov/send_waypoint_file], pid[11693] [xmlrpc][INFO] 2018-02-09 15:32:25,704: XML-RPC server binding to 0.0.0.0:0 [xmlrpc][INFO] 2018-02-09 15:32:25,704: Started XML-RPC server [http://phacosmer:35344/] [rospy.init][INFO] 2018-02-09 15:32:25,704: ROS Slave URI: [http://phacosmer:35344/] [rospy.impl.masterslave][INFO] 2018-02-09 15:32:25,705: _ready: http://phacosmer:35344/ [xmlrpc][INFO] 2018-02-09 15:32:25,705: xml rpc node: starting XML-RPC server [rospy.registration][INFO] 2018-02-09 15:32:25,705: Registering with master node http://localhost:11311 [rospy.init][INFO] 2018-02-09 15:32:25,805: registered with master [rospy.rosout][INFO] 2018-02-09 15:32:25,805: initializing /rosout core topic [rospy.rosout][INFO] 2018-02-09 15:32:25,807: connected to core topic /rosout [rospy.simtime][INFO] 2018-02-09 15:32:25,808: initializing /clock core topic [rospy.simtime][INFO] 2018-02-09 15:32:25,810: connected to core topic /clock [rospy.internal][INFO] 2018-02-09 15:32:25,820: topic[/clock] adding connection to [http://phacosmer:42466/], count 0 [rospy.internal][INFO] 2018-02-09 15:32:26,045: topic[/rosout] adding connection to [/rosout], count 0 [rospy.service][ERROR] 2018-02-09 15:33:26,092: [/rexrov/init_waypoints_from_file]: lookup service failed with message [no provider] [rospy.core][INFO] 2018-02-09 15:33:26,092: signal_shutdown [atexit] [rospy.internal][INFO] 2018-02-09 15:33:26,094: topic[/rosout] removing connection to /rosout [rospy.internal][INFO] 2018-02-09 15:33:26,094: topic[/clock] removing connection to http://phacosmer:42466/ [rospy.impl.masterslave][INFO] 2018-02-09 15:33:26,094: atexit

When i tried to run rosservice call /rexrov/init_waypoints_from_file

ERROR: Service [/rexrov/init_waypoints_from_file] is not available.

Thank for your helps,

phamhoanganhbk commented 6 years ago

Hi @musamarcusso ,

I saw it seems the service init_waypoints_from_file is not running. i found it is declared in file dp_controller_local_planner.py. To active this service, do i need to do anything else?

Thanks for your helps, Hoang-anh

musamarcusso commented 6 years ago

No, it should start without any extra command needed. Could you copy here the output you get when you run

 roslaunch uuv_tutorial_dp_controller start_tutorial_dp_controller_demo.launch

(without trying to call the service for the waypoints)

phamhoanganhbk commented 6 years ago

Here is the output

pha@phacosmer:~/catkin_ws$ roslaunch uuv_tutorial_dp_controller start_tutorial_dp_controller_demo.launch ... logging to /home/pha/.ros/log/87db58a2-0db4-11e8-b5ba-5891cf6e920e/roslaunch-phacosmer-22772.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://phacosmer:37727/

SUMMARY

PARAMETERS

NODES /rexrov/ ground_truth_to_tf_rexrov (message_to_tf/message_to_tf) robot_state_publisher (robot_state_publisher/robot_state_publisher) thruster_allocator (uuv_thruster_manager/thruster_allocator.py) trajectory_marker_publisher (uuv_control_utils/trajectory_marker_publisher.py) tutorial_dp_controller (uuv_tutorial_dp_controller/tutorial_dp_controller.py) urdf_spawner (uuv_descriptions/spawn_model.py) / gazebo (gazebo_ros/gzserver) gazebo_gui (gazebo_ros/gzclient) publish_world_models (uuv_assistants/publish_world_models.py) rviz (rviz/rviz) world_ned_frame_publisher (tf2_ros/static_transform_publisher)

auto-starting new master process[master]: started with pid [22787] ROS_MASTER_URI=http://localhost:11311

setting /run_id to 87db58a2-0db4-11e8-b5ba-5891cf6e920e process[rosout-1]: started with pid [22800] started core service [/rosout] process[gazebo-2]: started with pid [22824] process[gazebo_gui-3]: started with pid [22828] process[world_ned_frame_publisher-4]: started with pid [22832] process[publish_world_models-5]: started with pid [22833] process[rexrov/urdf_spawner-6]: started with pid [22843] process[rexrov/robot_state_publisher-7]: started with pid [22849] process[rexrov/ground_truth_to_tf_rexrov-8]: started with pid [22853] process[rexrov/thruster_allocator-9]: started with pid [22855] process[rexrov/trajectory_marker_publisher-10]: started with pid [22905] process[rexrov/tutorial_dp_controller-11]: started with pid [22906] [ WARN] [1518192967.066887256]: The root link rexrov/base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. process[rviz-12]: started with pid [22935] Gazebo multi-robot simulator, version 7.9.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org

[ INFO] [1518192967.199173640]: rviz version 1.11.18 [ INFO] [1518192967.199234896]: compiled against Qt version 4.8.6 [ INFO] [1518192967.199250781]: compiled against OGRE version 1.8.1 (Byatis) [ INFO] [1518192967.361135867]: Finished loading Gazebo ROS API Plugin. [Msg] Waiting for master. [ INFO] [1518192967.364183862]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 10.21.92.48 Traceback (most recent call last): File "/home/pha/catkin_ws/src/uuv_simulator/uuv_tutorials/uuv_tutorial_dp_controller/scripts/tutorial_dp_controller.py", line 24, in from uuv_control_interfaces import DPControllerBase File "/home/pha/catkin_ws/devel/lib/python2.7/dist-packages/uuv_control_interfaces/init.py", line 35, in exec(fh.read()) File "", line 17, in File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_control_interfaces/dp_controller_base.py", line 33, in from .dp_controller_local_planner import DPControllerLocalPlanner as LocalPlanner File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_control_interfaces/dp_controller_local_planner.py", line 24, in import uuv_trajectory_generator File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/init.py", line 16, in from .wp_trajectory_generator import WPTrajectoryGenerator File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/wp_trajectory_generator.py", line 22, in from path_generator import PathGenerator File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/path_generator/init.py", line 19, in from .cs_interpolator import CSInterpolator File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/path_generator/cs_interpolator.py", line 16, in from scipy.interpolate import splrep, splev ImportError: No module named scipy.interpolate spawn_model script started Start publishing vehicle footprints to RViz Traceback (most recent call last): File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_control_utils/scripts/trajectory_marker_publisher.py", line 26, in import uuv_trajectory_generator File "/home/pha/catkin_ws/devel/lib/python2.7/dist-packages/uuv_trajectory_generator/init.py", line 35, in exec(fh.read()) File "", line 16, in File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/wp_trajectory_generator.py", line 22, in from path_generator import PathGenerator File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/path_generator/init.py", line 19, in from .cs_interpolator import CSInterpolator File "/home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/path_generator/cs_interpolator.py", line 16, in from scipy.interpolate import splrep, splev ImportError: No module named scipy.interpolate [INFO] [WallTime: 1518192967.883363] [0.000000] Loading model xml from ros parameter [INFO] [WallTime: 1518192967.888222] [0.000000] Waiting for service /gazebo/spawn_urdf_model [ INFO] [1518192967.945851433]: Stereo is NOT SUPPORTED [ INFO] [1518192967.945946208]: OpenGl version: 3 (GLSL 1.3). [rexrov/trajectory_marker_publisher-10] process has died [pid 22905, exit code 1, cmd /home/pha/catkin_ws/src/uuv_simulator/uuv_control/uuv_control_utils/scripts/trajectory_marker_publisher.py trajectory:=dp_controller/trajectory waypoints:=dp_controller/waypoints name:=trajectory_marker_publisher log:=/home/pha/.ros/log/87db58a2-0db4-11e8-b5ba-5891cf6e920e/rexrov-trajectory_marker_publisher-10.log]. log file: /home/pha/.ros/log/87db58a2-0db4-11e8-b5ba-5891cf6e920e/rexrov-trajectory_marker_publisher-10.log [rexrov/tutorial_dp_controller-11] process has died [pid 22906, exit code 1, cmd /home/pha/catkin_ws/src/uuv_simulator/uuv_tutorials/uuv_tutorial_dp_controller/scripts/tutorial_dp_controller.py odom:=pose_gt trajectory:=dp_controller/trajectory input_trajectory:=dp_controller/input_trajectory waypoints:=dp_controller/waypoints error:=dp_controller/error reference:=dp_controller/reference thruster_output:=thruster_manager/input_stamped name:=tutorial_dp_controller log:=/home/pha/.ros/log/87db58a2-0db4-11e8-b5ba-5891cf6e920e/rexrov-tutorial_dp_controller-11.log]. log file: /home/pha/.ros/log/87db58a2-0db4-11e8-b5ba-5891cf6e920e/rexrov-tutorial_dp_controller-11.log Warning [parser.cc:527] Can not find the XML attribute 'version' in sdf XML tag for model: NED frame. Please specify the SDF protocol supported in the model configuration file. The first sdf tag in the config file will be used [INFO] [WallTime: 1518192968.492054] [0.000000] Calling service /gazebo/spawn_urdf_model New model being published: north Position: [1000, 0, -50] Orientation: [0, 0, 0, 1] Scale: [1, 1, 1] New model being published: west Position: [0, -1000, -50] Orientation: [0, 0, 0, 1] Scale: [1, 1, 1] [Msg] Loading underwater world... [Msg] Current velocity [m/s] Gauss-Markov process model: [Msg] Mean = 0 Min. Limit = 0 Max. Limit = 5 Mu = 0 Noise Amp. = 0 [Msg] Current velocity horizontal angle [rad] Gauss-Markov process model: [Msg] Mean = 0 Min. Limit = -3.14159 Max. Limit = 3.14159 Mu = 0 Noise Amp. = 0 [Msg] Current velocity horizontal angle [rad] Gauss-Markov process model: [Msg] Mean = 0 Min. Limit = -3.14159 Max. Limit = 3.14159 Mu = 0 Noise Amp. = 0 [Msg] Current velocity topic name: hydrodynamics/current_velocity [Msg] Underwater current plugin loaded! WARNING: Current velocity calculated in the ENU frame [Msg] UnderwaterCurrentROSPlugin::namespace=hydrodynamics [Msg] Spherical coordinates reference=

musamarcusso commented 6 years ago

Hi @phamhoanganhbk,

I think I found the problem (at least one of them). The controller node throws an exception at startup, an error can be read in this part:

from scipy.interpolate import splrep, splev
ImportError: No module named scipy.interpolate

Try installing scipy and numpy either with apt as follows

sudo apt-get install python-scipy python-numpy

or if you have pip (if you don't, you can install it using sudo apt-get install python-pip):

pip install scipy numpy

See if this solves the issue.

phamhoanganhbk commented 6 years ago

Hi @musamarcusso Oh, here is the result :D. Merci beaucoup,

screenshot from 2018-02-09 17 28 25

musamarcusso commented 6 years ago

Great that it worked out! I'm trying to check the issue with the visualization of the meshes also (the texture is not being loaded apparently on newer versions of Gazebo). I'll close this issue now. If you have any other questions or bug reports, feel free to open a new issue here.