Trouble running keyboard_teleop node

I am having trouble running any of the stretch_ros nodes, but specifically I have been trying to run:
roslaunch stretch_core keyboard_teleop.launch

Any node I run seems to have the same error, that it is missing the file stretch_description/urdf/stretch.urdf

I did make a new user on the Stretch, but I followed those instructions and did not run into any errors. Then, I tried to pull the repos, but they are all up-to-date. I am new to ROS, so any help solving this issue would be much appreciated!

Terminal Output
… logging to /home/laura/.ros/log/1db1f0e6-8366-11eb-994a-94e6f7b7e657/roslaunch-stretch-re1-1042-3846.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/init.py”, line 332, in main
p.start()
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 289, in start
self._start_infrastructure()
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 238, in _start_infrastructure
self._load_config()
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 144, in _load_config
roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/config.py”, line 461, in load_config_default
loader.load(f, config, argv=args, verbose=verbose)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 761, in load
self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 733, in _load_launch
self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 699, in _recurse_load
val = self._include_tag(tag, context, ros_config, default_machine, is_core, verbose)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 96, in call
return f(*args, **kwds)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 634, in _include_tag
default_machine, is_core, verbose)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 679, in _recurse_load
self._param_tag(tag, context, ros_config, verbose=verbose)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 96, in call
return f(*args, **kwds)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 271, in _param_tag
value = self.param_value(verbose, name, ptype, *vals)
File “/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/loader.py”, line 476, in param_value
with open(textfile, ‘r’) as f:
IOError: [Errno 2] No such file or directory: u’/home//catkin_ws/src/stretch_ros/stretch_description/urdf/stretch.urdf’

Hi @lstegner, welcome to the forum! I believe the new user setup instructions are missing a step that generates the URDF file “stretch.urdf”. You can generate it using the following steps:

  1. Ensure that the ~/stretch_user/stretch-re1-****/calibration_ros folder exists in your new user. If it does not, copy it over from the default “hello-robot” account.
  2. Generate the URDF using: rosrun stretch_calibration update_with_most_recent_calibration.sh

Hope this helps and thanks for bringing up this issue; we’ll update the new user docs accordingly.

1 Like

Thank you so much @bshah for the reply! That fix did solve that specific problem. Unfortunately, now there is a new one:
AttributeError: StretchBodyNode instance has no attribute ‘robot’

However, I did try this in the default account (hello-robot) and it runs there with no error.

Full terminal output from roslaunch stretch_core keyboard_teleop.launch:
… logging to /home/laura/.ros/log/ee069942-8599-11eb-bf04-94e6f7b7e657/roslaunch-stretch-re1-1042-4926.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://stretch-re1-1042:43495/

SUMMARY

PARAMETERS

  • /joint_state_publisher/rate: 15.0
  • /joint_state_publisher/source_list: [’/stretch/joint_…
  • /robot_description: <?xml version="1…
  • /robot_state_publisher/publish_frequency: 15.0
  • /rosdistro: melodic
  • /rosversion: 1.14.10
  • /stretch_driver/broadcast_odom_tf: True
  • /stretch_driver/controller_calibration_file: /home/laura/catki…
  • /stretch_driver/fail_out_of_range_goal: False
  • /stretch_driver/rate: 25.0
  • /stretch_driver/timeout: 0.5

NODES
/
joint_state_publisher (joint_state_publisher/joint_state_publisher)
keyboard_teleop (stretch_core/keyboard_teleop)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
stretch_driver (stretch_core/stretch_driver)

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

setting /run_id to ee069942-8599-11eb-bf04-94e6f7b7e657
process[rosout-1]: started with pid [4947]
started core service [/rosout]
process[joint_state_publisher-2]: started with pid [4950]
process[robot_state_publisher-3]: started with pid [4955]
process[stretch_driver-4]: started with pid [4956]
process[keyboard_teleop-5]: started with pid [4957]
[ WARN] [1615818174.142936170]: The root link 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.
[INFO] [1615818175.097287]: /keyboard_teleop started
[INFO] [1615818175.167362]: For use with S T R E T C H ™ RESEARCH EDITION from Hello Robot Inc.
[INFO] [1615818175.169422]: /stretch_driver started
[INFO] [1615818175.172733]: mode = position
Traceback (most recent call last):
File “/home/laura/catkin_ws/src/stretch_ros/stretch_core/nodes/stretch_driver”, line 626, in
node.main()
File “/home/laura/catkin_ws/src/stretch_ros/stretch_core/nodes/stretch_driver”, line 497, in main
self.turn_on_position_mode()
File “/home/laura/catkin_ws/src/stretch_ros/stretch_core/nodes/stretch_driver”, line 404, in turn_on_position_mode
self.change_mode(‘position’, code_to_run)
File “/home/laura/catkin_ws/src/stretch_ros/stretch_core/nodes/stretch_driver”, line 358, in change_mode
code_to_run()
File “/home/laura/catkin_ws/src/stretch_ros/stretch_core/nodes/stretch_driver”, line 403, in code_to_run
self.robot.base.enable_pos_incr_mode()
AttributeError: StretchBodyNode instance has no attribute ‘robot’

Hi @lstegner,

I’ve made an update to stretch_ros that will likely solve this issue. Would you try the following steps:

roscd stretch_core
git pull
roslaunch stretch_core keyboard_teleop.launch
1 Like

That fixed it, thank you so much!

1 Like