Kinovarobotics / kinova-movo

Source code of the Kinova MOVO platform
BSD 3-Clause "New" or "Revised" License
43 stars 37 forks source link

Cannot get message from /sim_initialized #59

Closed patlican23 closed 5 years ago

patlican23 commented 5 years ago

Steps to Reproduce:

  1. roslaunch movo_demos sim_demo_show_basic.launch
  2. rosrun movo_demos demo_show_basic.py

Result:

Traceback (most recent call last):
  File "/home/iumay/movo_ws/src/kinova-movo/movo_demos/scripts/demo_show_basic.py", line 67, in <module>
    movo_base = MoveBaseActionClient(sim=True, frame="map")
  File "/home/iumay/movo_ws/src/kinova-movo/movo_common/movo_ros/src/movo_action_clients/move_base_action_client.py", line 58, in __init__
    self.last_pose = self._helpers.GetCurrentRobotPose(frame)
  File "/home/iumay/movo_ws/src/kinova-movo/movo_common/movo_ros/src/movo_action_clients/helpers.py", line 101, in GetCurrentRobotPose
    self.tfl.waitForTransform(frame, "base_link", rospy.Time().now, rospy.Duration(1.0))
  File "/opt/ros/indigo/lib/python2.7/dist-packages/tf/listener.py", line 74, in waitForTransform
    can_transform, error_msg = self._buffer.can_transform(strip_leading_slash(target_frame), strip_leading_slash(source_frame), time, timeout, return_debug_tuple=True)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/tf2_ros/buffer.py", line 122, in can_transform
    not self.can_transform_core(target_frame, source_frame, time)[0] and
TypeError: time must have a to_sec method, e.g. rospy.Time or rospy.Duration
Exception AttributeError: "'MoveBaseActionClient' object has no attribute 'move_base_client'" in <bound method MoveBaseActionClient.__del__ of <movo_action_clients.move_base_action_client.MoveBaseActionClient object at 0x7f7816966450>> ignored
martine1406 commented 5 years ago

are you trying to launch sim_dmeo_show_basic, then run demo_show_basic? are you on ROS Indigo?

patlican23 commented 5 years ago

are you trying to launch sim_dmeo_show_basic, then run demo_show_basic? are you on ROS Indigo?

I am on ROS Indigo and yes, I am trying to launch sim_demo_show_basic.launch and then running the demo_show_basic.py

alexvannobel commented 5 years ago

Hi @patlican23 ,

The sim_demo_show_basic.launch file already calls the python script you are call in your second step. First, on lines 28-31, it calls the demo_show_basic.launch file: https://github.com/Kinovarobotics/kinova-movo/blob/devel/movo_demos/launch/sim/sim_demo_show_basic.launch#L28-L31

This launch file in turn calls the demo_show_basic.py script : https://github.com/Kinovarobotics/kinova-movo/blob/devel/movo_demos/launch/demo/demo_show_basic.launch#L15-L25

Do you have a problem with the roslaunch movo_demos sim_demo_show_basic.launch command? Why do you need to launch the python script a second time with the rosrun movo_demos demo_show_basic.py command?

Best,

Alex

patlican23 commented 5 years ago

Hi,

Yes, you are right. I have changed the following part in the sim_demo_show_basic.launch as following:

    <node pkg="si_utils" type="timed_roslaunch"
        args="35 movo_demos demo_show_basic.launch sim:=false local:=true"
        name="demo_bringup" output="screen"/>

In any case, I am getting the similar result. If I change back to sim:=true in the sim_demo_show_basic.launch file and just launch the sim_demo_show_basic.launch file without running demo_show_basic.py, I am getting the following;

Result:

Traceback (most recent call last):
  File "/home/iumay/movo_ws/src/kinova-movo/movo_demos/scripts/demo_show_basic.py", line 67, in <module>
    movo_base = MoveBaseActionClient(sim=sim, frame="odom")
  File "/home/iumay/movo_ws/src/kinova-movo/movo_common/movo_ros/src/movo_action_clients/move_base_action_client.py", line 58, in __init__
    self.last_pose = self._helpers.GetCurrentRobotPose(frame)
  File "/home/iumay/movo_ws/src/kinova-movo/movo_common/movo_ros/src/movo_action_clients/helpers.py", line 101, in GetCurrentRobotPose
    self.tfl.waitForTransform(frame, "base_link", rospy.Time().now, rospy.Duration(1.0))
  File "/opt/ros/indigo/lib/python2.7/dist-packages/tf/listener.py", line 74, in waitForTransform
    can_transform, error_msg = self._buffer.can_transform(strip_leading_slash(target_frame), strip_leading_slash(source_frame), time, timeout, return_debug_tuple=True)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/tf2_ros/buffer.py", line 122, in can_transform
    not self.can_transform_core(target_frame, source_frame, time)[0] and
TypeError: time must have a to_sec method, e.g. rospy.Time or rospy.Duration
Exception AttributeError: "'MoveBaseActionClient' object has no attribute 'move_base_client'" in <bound method MoveBaseActionClient.__del__ of <movo_action_clients.move_base_action_client.MoveBaseActionClient object at 0x7ff7ac116e10>> ignored
[demo-3] process has died [pid 4211, exit code 1, cmd /home/iumay/movo_ws/src/kinova-movo/movo_demos/scripts/demo_show_basic.py __name:=demo __log:=/home/iumay/.ros/log/9e148e1c-fe41-11e8-b679-f496347775db/demo-3.log].
log file: /home/iumay/.ros/log/9e148e1c-fe41-11e8-b679-f496347775db/demo-3*.log
alexvannobel commented 5 years ago

Hi,

I could reproduce your error message if I launched the demo_show_basic.py node and the movo_move_base action server was not launched properly. It is started by the sensor_nav.launch file in demo_show_basic.launch: https://github.com/Kinovarobotics/kinova-movo/blob/devel/movo_demos/launch/demo/demo_show_basic.launch#L9-L13

Best,

Alex

patlican23 commented 5 years ago

Hi Alex,

an then run rosrun robot_state_publisher robot_state_publisher

Result:

[ERROR] [1544756487.150394774, 147.081000000]: Lookup would require extrapolation into the future.  Requested time 146.036000000 but the latest data is at time 121.932000000, when looking up transform from frame [front_laser_link] to frame [base_link]

And, then running rosrun move_base move_base

Result : [ WARN] [1544732205.964491932, 416.059000000]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101 timeout was 0.1.

patlican23 commented 5 years ago

Hi Alex,

an then run rosrun robot_state_publisher robot_state_publisher

Result:

[ERROR] [1544756487.150394774, 147.081000000]: Lookup would require extrapolation into the future.  Requested time 146.036000000 but the latest data is at time 121.932000000, when looking up transform from frame [front_laser_link] to frame [base_link]

And, then running rosrun move_base move_base

Result : [ WARN] [1544732205.964491932, 416.059000000]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101 timeout was 0.1.

alexvannobel commented 5 years ago

Hi @patlican23 , sorry for the delay.

I don't think launching all those nodes separately is a good way to troubleshoot the demo, since some nodes require other nodes to be started beforehand (the robot state publisher, for example, is a core node) and you could create new errors that way. I would launch only the sim_demo_show_basic.launch and look at the log to see if some nodes failed initialization of crashed unexpectedly.

Have you made local changes to the launch files you are referring to? Maybe a "sim:=false" was introduced somewhere and the ROS nodes start looking for the real robot instead of the simulated one. You should also make sure no node is already running before you launch the demo (except your ROS master).

With an up-to-date devel branch, I cannot reproduce your error messages. If you are also up-to-date with this branch, the problem may be a configuration problem :

Hope this helps you,

Best,

Alex

alexvannobel commented 5 years ago

Hi @patlican23 ,

Did you resolve your issue?

patlican23 commented 5 years ago

Hi,

Sorry for the late return. Yes, I solved the issue. One of my colleagues suggested to change following lines in the demo_show_basic.py file, then I was able to run it without any problem.

to

Thanks