ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

setting argument for teleop twist keyboard in launch file

asked 2016-04-07 01:20:30 -0600

Thang Nguyen gravatar image

Hi, I am learning gmapping, rviz and map_server. I created launch file which will launch stage_ros, teleop_twist_keyboard, gmapping with purpose creating a map as below:

    <node pkg="stage_ros" type="stageros" name="stage" args="$(find stage_ros)/world/"/>
    <node pkg="gmapping" type="slam_gmapping" name="gmapping">
        <param name="scan" value="base_scan"/>
    <node pkg="teleop_twist_keyboard" type="" name="teleop"/>
    <node pkg="rviz" type="rviz" name="rviz" args="$find stage_ros)/rviz/stage.rviz"/>

But when I ran this launch file, I got this error

setting /run_id to c042b11c-fc87-11e5-b686-00044b581868
process[rosout-1]: started with pid [4026]
started core service [/rosout]
process[stage-2]: started with pid [4029]
process[gmapping-3]: started with pid [4035]
process[teleop-4]: started with pid [4042]
process[rviz-5]: started with pid [4048]
[rviz-5] process has died [pid 4048, exit code -7, cmd /opt/ros/indigo/lib/rviz/rviz $find stage_ros)/rviz/stage.rviz __name:=rviz __log:=/home/ubuntu/.ros/log/c042b11c-fc87-11e5-b686-00044b581868/rviz-5.log].
log file: /home/ubuntu/.ros/log/c042b11c-fc87-11e5-b686-00044b581868/rviz-5*.log
/opt/ros/indigo/lib/teleop_twist_keyboard/ SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see for more information.
  pub = rospy.Publisher('cmd_vel', Twist)

I am not sure how to fix this. Please help me.

Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-07 02:12:28 -0600

DavidN gravatar image

It is rviz that causes the problem, not the teleop. What you saw on the rosout is just a warning for teleop node. I suggest you to:

  1. Disable the launch of rviz (maybe launch it manually via another launch file) to reduce confusion while you are reading rosout.
  2. Enable output to screen for teleop to see the instruction of how to use it:

<node pkg="teleop_twist_keyboard" type="" name="teleop" output="screen"/>

edit flag offensive delete link more


For reference, this warning in teleop_twist_keyboard is fixed in the upcoming 0.6.0 release, and should reach the public repository in a few weeks.

ahendrix gravatar image ahendrix  ( 2016-04-07 04:20:43 -0600 )edit

Thank you for both of your answer: @David: when I remove rviz, it works. There is still the warning for teleop but as Austin says, the warning will be fixed. @Austin: To make rviz run, I need to run unset GTK_IM_MODULE since I run this on ARM. I don't know how to add this to launch file.

Thang Nguyen gravatar image Thang Nguyen  ( 2016-04-07 21:00:44 -0600 )edit

Add unset GTK_IM_MODULE to your shell's startup script; normally ~/.bashrc.

ahendrix gravatar image ahendrix  ( 2016-04-07 21:14:57 -0600 )edit

Question Tools

1 follower


Asked: 2016-04-07 01:20:30 -0600

Seen: 4,272 times

Last updated: Apr 07 '16