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

PeterB's profile - activity

2023-08-04 10:59:57 -0500 received badge  Famous Question (source)
2023-08-04 10:59:57 -0500 received badge  Notable Question (source)
2022-01-04 08:09:12 -0500 commented answer List of standardized topics for navigation using custom robot

Thanks, that clears up at least the cmd_vel. I will start by making the robot move. By the time I fully understand that,

2022-01-04 06:52:11 -0500 received badge  Popular Question (source)
2022-01-04 01:35:31 -0500 commented answer List of standardized topics for navigation using custom robot

So to answer my own comment. After some more Google-ing, it looks like my best bet is to set up a simulation with a comm

2022-01-04 01:33:24 -0500 commented answer List of standardized topics for navigation using custom robot

Thanks for the reply, I will try to figure it out that way. Still it's a bit unclear. The twist message has two vectors,

2022-01-04 01:33:11 -0500 commented answer List of standardized topics for navigation using custom robot

Thanks for the reply, I will try to figure it out that way. Still it's a bit unclear. The twist message has two vectors,

2022-01-03 03:22:48 -0500 asked a question List of standardized topics for navigation using custom robot

List of standardized topics for navigation using custom robot I'm building a custom robot that I eventually want to inte

2021-02-16 10:14:53 -0500 received badge  Famous Question (source)
2020-09-15 10:50:48 -0500 received badge  Notable Question (source)
2020-09-15 10:50:48 -0500 received badge  Popular Question (source)
2020-07-31 05:16:52 -0500 received badge  Famous Question (source)
2020-07-17 16:08:44 -0500 received badge  Notable Question (source)
2020-07-17 16:08:44 -0500 received badge  Popular Question (source)
2020-06-10 01:04:10 -0500 marked best answer $PYTHONPATH is not in sync with Python sys.path

I have build ROS Melodic on a Raspberry Pi using the supplied instructions. This seems to work fine and I'm able to build my own workspace.

However, after sourcing setup.bash, the $PYTHONPATH variable is not in line with what Python reports as its path. Thus certain libraries can not be found when executing ROS programs (eg std_msgs needs PyYAML, which is installed, but not available when running the project through roslaunch)

Is this a misconfiguration on my end? What can I verify and change to make this work?

pi@raspberrypi:~ $ echo $PYTHONPATH
/home/pi/ros-robot-control/HelloWorld/robot_ws/devel/lib/python2.7/dist-packages:/opt/ros/melodic/lib/python2.7/dist-packages
pi@raspberrypi:~ $ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/home/pi/ros-robot-control/HelloWorld/robot_ws/devel/lib/python2.7/dist-packages', '/opt/ros/melodic/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-arm-linux-gnueabihf', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/pi/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk3']

The error when using roslaunch:

Traceback (most recent call last):
  File "/home/pi/ros-robot-control/HelloWorld/robot_ws/src/ros_robot_control/scripts/cmd_vel_listener.py", line 2, in <module>
    import rospy
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/__init__.py", line 47, in <module>
    from std_msgs.msg import Header
  File "/opt/ros/melodic/lib/python2.7/dist-packages/std_msgs/msg/__init__.py", line 1, in <module>
    from ._Bool import *
  File "/opt/ros/melodic/lib/python2.7/dist-packages/std_msgs/msg/_Bool.py", line 5, in <module>
    import genpy
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/__init__.py", line 34, in <module>
    from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/message.py", line 47, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

pyyaml is installed, but not in any of the folders in $PYTHONPATH:

pi@raspberrypi:~/ros-robot-control/HelloWorld/robot_ws/src/robot_interface $ pip install pyyaml
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pyyaml in /usr/lib/python2.7/dist-packages (3.13)
2020-06-09 15:16:30 -0500 answered a question $PYTHONPATH is not in sync with Python sys.path

In the mean time, I figured it out. The $PYTHONPATH was a red herring and not related to the problem. The code was inde

2020-06-07 07:39:27 -0500 asked a question $PYTHONPATH is not in sync with Python sys.path

$PYTHONPATH is not in sync with Python sys.path I have build ROS Melodic on a Raspberry Pi using the supplied instructio

2020-04-05 10:56:51 -0500 commented answer teleop_twist_keyboard in launch file has no output

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

2020-04-05 10:56:32 -0500 received badge  Supporter (source)
2020-04-05 10:56:30 -0500 marked best answer teleop_twist_keyboard in launch file has no output

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.

2020-04-05 10:56:30 -0500 received badge  Scholar (source)
2020-04-05 05:57:00 -0500 asked a question teleop_twist_keyboard in launch file has no output

teleop_twist_keyboard in launch file has no output I'm trying to start the teleop_twist_keyboard node from within a laun