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

teleop_twist_keyboard in launch file has no output

asked 2020-04-05 03:08:23 -0600

PeterB gravatar image

I'm trying to start the teleop_twist_keyboard node from within a launch file. I'm following the explanation at the bottom of this page: https://wiki.ros.org/stdr_simulator/T...

And this is my launch file:

<launch>
  <group ns="turtlesim">
    <node pkg="turtlesim" name="sim" type="turtlesim_node"/>
  </group>
  <node pkg="teleop_twist_keyboard" name="keyboard" type="teleop_twist_keyboard.py">
    <remap from="cmd_vel" to="turtlesim/cmd_vel"/>
  </node>
</launch>

It looks like this is launched correctly, however, I can't see the output of the teleop node and I'm not able to control the turtle.

Is there anything specific I should do to use the component? I'm guessing that roslaunch is not 'forwarding' my keyboard input to the right node, but I have no idea how to solve this.


update: I'm pretty new to ROS, so after investigating the topics and graph, it turns out I wasn't properly remapping the topic. This version of the teleop_twist_keyboard works, but I still don't have any output by the teleop_twist_keyboard node

  <node pkg="teleop_twist_keyboard" name="keyboard" type="teleop_twist_keyboard.py">
    <remap from="/cmd_vel" to="/turtlesim/turtle1/cmd_vel"/>
  </node>

So, still my question is, how can I have the teleop node output its text in the launch window.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-04-05 06:00:19 -0600

gvdhoorn gravatar image

So, still my question is, how can I have the teleop node output its text in the launch window.

If with "launch window" you are referring to the terminal window in which you've started roslaunch, and you're only looking to have teleop_twist_keyboard print its stdout into that terminal window, then I believe it should be sufficient to add the output="screen" attribute to your node element.

See also the roslaunch/XML/node documentation.

edit flag offensive delete link more

Comments

Awesome, that's exactly what I was looking for.

PeterB gravatar image PeterB  ( 2020-04-05 10:56:51 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-04-05 02:53:52 -0600

Seen: 1,313 times

Last updated: Apr 05 '20