Questions tagged [rospy]

rospy is a pure Python client library for the Robot Operating System (ROS)

The rospy client API enables Python programmers to quickly interface with ROS Topics, Services, and Parameters. The design of rospy favors implementation speed (i.e. developer time) over runtime performance so that algorithms can be quickly prototyped and tested within ROS. It is also ideal for non-critical-path code, such as configuration and initialization code. Many of the ROS tools are written in rospy to take advantage of the type introspection capabilities. Many of the ROS tools, such as rostopic and rosservice, are built on top of rospy. (http://wiki.ros.org/rospy)

123 questions
7
votes
3 answers

ImportError: No module named 'rospy'

I installed the ROS package for Crazyflie, I wanted to run a simple script but when I type sudo python3 execute_trajectory.py , it gives me an error of no module named rospy. This is the package: https://github.com/whoenig/crazyflie_ros and the…
flavia13
  • 85
  • 1
  • 1
  • 4
6
votes
1 answer

How to feed the data obtained from rospy.Subscriber data into a variable?

I have written a sample Subscriber. I want to feed the data that I have obtained from the rospy.Subscriber into another variable, so that I can use it later in the program for processing. At the moment I could see that the Subscriber is functioning…
Sai Raghava
  • 147
  • 1
  • 4
  • 13
6
votes
1 answer

ROS logger disables Python logger

I am having issues with the Python logger and the rospy logger. In the begining, the Python logger stopped logging as soon as a ROS node was initialized. I tried to solve the problem by adding a stream handler to the logger. Now it only logs if a…
Sharky Bamboozle
  • 1,066
  • 16
  • 28
6
votes
2 answers

ROS python Error "The manifest (with format version 2) must not contain the following tags: run_depend"

I have been following the book "Programming Robots with ROS: A Practical Introduction to the Robot Operating System" In the "Defining a New Message" part of the book we create a new message definition Example 3-3. Complex.msg float32 real float32…
サルバドル
  • 379
  • 1
  • 6
  • 12
6
votes
3 answers

How to publish/subscribe a python “list of list” as topic in ROS

I am new to ROS and rospy, and I am not familiar with non-simple data type as topic. I want to build a ROS node as both a subscriber and publisher: it receives a topic (a list of two float64), and uses a function (say my_function) which returns a…
SGM
  • 151
  • 1
  • 10
4
votes
2 answers

ModuleNotFoundError: No module named 'rospkg'

I am new to ROS, I have a problem when I import rospy into my script file example.py and run it: It says: Traceback (most recent call last): File "/home/nagarjunv/hk_ws/src/rvo/src/example.py", line 4, in import rospy File…
Nagarjun Vinukonda
  • 103
  • 2
  • 2
  • 8
4
votes
1 answer

message_filters doesn't call the callback function

I'm trying to use the message_filters in order to subscribe to two topics. Here's my code class sync_listener: def __init__(self): self.image_sub = message_filters.Subscriber('camera/rgb/image_color', Image) self.info_sub =…
paul-shuvo
  • 1,874
  • 4
  • 33
  • 37
3
votes
1 answer

ROS / Python: How to access data from a rostopic in python?

I'm trying to write a python code, that controls a drone. I receive the position from a Rigid-body trough a rostopic, and I want to use that data in my code. How can i access it in my python code? #!/usr/bin/env python import numpy as np from…
flrnhbr1
  • 33
  • 1
  • 4
3
votes
1 answer

Alternative to PCL on Python for Processing and Visualization

I am using rospy to receive pointclouds. For processing these pointclouds, there is a package called python-pcl, I was unable to get it running, since it was extremely buggy and non-functional, tons of issues on Github, etc. I wish to know if there…
Schütze
  • 1,044
  • 5
  • 28
  • 48
3
votes
2 answers

Use data from multiple topics in ROS - Python

I'm able to display data from two topics but I can't do use and compute data in real time from these two topics in ROS (written in Python code). Have you got any idea to stock this data and compute in real time ? Thanks ;) #!/usr/bin/env…
Antoine
  • 33
  • 1
  • 1
  • 4
3
votes
1 answer

Using ROS message classes outside of ROS

I have a ROS node written in Python that captures messages and writes them to disk (e.g. using pickle). I want to use these files later, in another Python script, outside of ROS, but I need to import the message classes. Is that possible? Thanks!
Michael Bar-Sinai
  • 2,729
  • 20
  • 27
3
votes
3 answers

Unable to publish a subscribed topic in rospy

I am using ROS and python and I have written this code. This code is supposed to subscribe to a ROS topic called "map" (coming from hector_slam using LIDAR) and save it into a variable called 'mapdata' which will be used later. I just want to make…
Reza
  • 31
  • 1
  • 3
3
votes
2 answers

Python real time plotting ROS data

I am trying to plot real time data coming to the computer using python. Data comes in a ROS topic and I use 'rospy' to subscribe to the topic in order to get data. This is the code I wrote import rospy from sensor_msgs.msg import…
3
votes
1 answer

Creating an Action Server & Client in ROS

I'm trying to setup a ROS Action server & client to handle sending images (encoded as 64-bit strings) between Python and ROS (with the goal of making the image something other scripts can pull from ROS). Being very new to all of this (Python,…
godfreap
  • 333
  • 1
  • 5
  • 13
2
votes
1 answer

How to define optional arguments in ROS service request

I want to define optional arguments in my ROS service request, the .srv file looks like this: abb_rapid_msgs/RobTarget pickpoint abb_rapid_msgs/RobTarget placepoint bool leftarm # Optional Parameters abb_rapid_msgs/RobTarget…
Bilal
  • 3,191
  • 4
  • 21
  • 49
1
2 3
8 9