All Questions
62 questions
0
votes
1
answer
73
views
where is the beginner_tutorials.srv file in the add_two_ints tutorial?
I am learning ros noetic on the page (https://wiki.ros.org/rospy_tutorials/Tutorials/WritingServiceClient)In the scripts/add_two_ints_server.py file within the beginner_tutorials package, there is a ...
0
votes
1
answer
829
views
rospy.init_node() stuck in loop
I had a problem with initializing a ROS node in python in a larger project. The following minimum reproducible example has the same issue:
...
1
vote
0
answers
162
views
Using .pyc files instead .py with roslaunch [closed]
I am working on a docker and using ROS 1 noetic as of now.
For certain reasons I do not want to distribute .py files as end user do not need to understand what is inside there. So I am using .pyc ...
0
votes
1
answer
163
views
Custom ROS Service Cannot be Imported
I have created a simple custom ROS service for ROS Noetic. My import line is:
from fishbot_ros.srv import chess_service, chess_serviceResponse
The file structure ...
0
votes
1
answer
9
views
unable to publish Path waypoints for pure pursuit
These are the initial line of my rospy code:
...
0
votes
1
answer
11
views
how does one index array in rospy?
I need the size of a custom array msg type. (The type is geometry_msgs/PoseStamped[] PoseStampedArray.)
I need to iterate on the msg if it is not empty and I would very much like to get the last ...
0
votes
1
answer
10
views
Importing a service in python defined by others
I am stuck in something that should be pretty easy... I have a service called "set_odometry", which I can use doing rosservice from the bash. This service is installed from apt-get so I don'...
0
votes
1
answer
12
views
Smach get value from subscriber topic
I'm pretty new to ROS, and I'm working with SMACH. I have an Arduino UNO with 4 LEDs (green ,yellow, red and blue) and one button.
What I'm trying to achieve is a sort of traffic light simulator. My ...
0
votes
1
answer
1
view
parse $(find ...) from python?
Hi everyone,
how can I make use of the ROS API to parse roslaunch macros like $(find <package>)?
Thanks
Originally posted by Hendrik Wiese on ROS Answers ...
0
votes
1
answer
5
views
Wrong argument type when writing quaternion orientation to pose message
Edit:
I tried to just simply copy the quaternion values and hardcode them as an orientation coordinates. Results are the same, so maybe problem comes from another part of my grasp msg?
I dumped the ...
0
votes
1
answer
6
views
Error on action_client as topic callback
I'm trying to implement a node that subscribes to a topic to get a list of geometry_msgs/Points and then send it to ...
0
votes
1
answer
3
views
PYTHON + ROS + V-REP
Hi
I have got a problem with publish data. I want to publish msg.linear.x and msg.linear.y to V-REP via ROS.
When I write in terminal
...
0
votes
1
answer
27
views
JointTrajectory Python interface
Hi, I am trying to make my own environment that will be used for reinforcement learning training, with the help of gym-gazebo. I want to train a floating gripper to pick up an object from ground. The ...
0
votes
1
answer
12
views
ROSSerializationException while publishing TFMessage
Hi everyone,
When I'm trying to publish tf2_msgs/TFMessage message, I got the following error:
...
0
votes
1
answer
147
views
How can I check if a service exists from Python?
This question has an answer for roscpp; what is the equivalent solution for Python?
EDIT: I do not want to wait for the service. I want to take one action if the service exists and a different action ...
0
votes
1
answer
8
views
Rospy isn't catching KeyboardInterrupt on the second iteration of the loop
I've written a publisher in Python to publish joint angles to a simple robot. The program only catches KeyboardInterrupt on the very first loop before I've ever published anything. However, as soon as ...
0
votes
1
answer
13
views
Can I use the Python Ros bag API without making a workspace?
I'm using roscpp, but I'd like to make a transferrable python script for working with bag files. However, the docs only tell me how to do it through a catkin workspace. Is there a way to import the ...
0
votes
1
answer
132
views
Python OpenCV namedWindow and imshow freeze
Hi there,
I try to view a subscribed image via cv2.imshow() like the following:
...
0
votes
1
answer
14
views
rostest fails when run using "catkin_make run_tests"
Hi all,
I have a node and some_test.test file like this:
...
0
votes
1
answer
56
views
DC MOTOR + ENCODER + PYTHON
Hello, everyone.
I have the next equipment:
https://www.pololu.com/product/2598 ,
https://www.pololu.com/product/2208
and raspberry pi.
I want to control the dc motors via ROS and Python. Is it ...
0
votes
1
answer
4
views
Can't import rospy
Hello,
I have a ROS aplication in Python and Qt, and when I run it from the terminal all is ok, but I try to run with double click (the script with the permissions and Nautilus configuration ...
0
votes
3
answers
277
views
point_cloud2.read_points and then?
I have a topic publishing a point cloud of type sensors_msgs.PointCloud2. I can subscribe to it and read it using ...
0
votes
1
answer
165
views
How to exit a ROS node on keyboard interrupt?
How do you write a Python ROS node so that it exits in response to a KeyboardInterrupt exception?
I have a trivial node like:
...
0
votes
1
answer
54
views
How to write to a text file in python in a ROS node?
I need to record a topic message called "message" only when a "message sent" button is pressed. I have made a separate node for GUI that has "message sent" button. I ...
0
votes
1
answer
5
views
rospy.wait_for_message is unable to subscribe to a message continuosly
Hi everyone. I have a question about rospy.wait_for_message. In my program, I use rospy.wait_for_message(topic, data type) to wait for a message published by other node. The first program will wait ...
0
votes
1
answer
47
views
Rviz markers with rospy
I am trying to visually represent a "robot" as a sphere marker from the visualization_msgs, but I am unable to publish my self.robotMarker. When I rosrun this script I am able to see the ...
1
vote
2
answers
63
views
Passing arguments to callback in Python
Hi!
I have a problem passing arguments to a callback function when Subscribing a ROStopic. The code below is what I do have now. But I only received error messages when I tried to pass arguments to ...
0
votes
1
answer
7
views
Python import: rosrun works well but roslaunch reports error
Hi, I'm writing some rospy nodes recently and some import errors ocur when I utilize roslaunch to start my node.
...
0
votes
1
answer
11
views
Printing and searching python namespaces from rospy.get_param()
I am catkin-izing, updating, and making revisions to the nxt ROS packages. I have hit an issue that seems basic but I could use some help to get through it. Searches for accessing Python dictionaries ...
0
votes
1
answer
7
views
Crash when calling init_node while holding GIL
I'm getting a crash when trying to invoke rospy from within an embedded Python interpreter.
Ubuntu 14.04LTS
Python 2.7.6
rosdistro: jade
rosversion: 1.11.16
The following C/C++ file duplicates the ...
0
votes
1
answer
24
views
Use C++ camera_info_manager yamls with camera_info_manager_py, and vice versa?
I'd like to run camera_info_manager_py saveCalibrationFile in a python file and then load the same yaml in in C++, but it appears the yaml dump is saving like this:
...
0
votes
1
answer
3
views
One big subscriber vs. multiple small subscribers?
I'm using rospy.
I have several nodes that need camera image and point cloud.
each of them needs to get the rgb image and point cloud in real time.
I'm thinking about 2 structures
1.
Create one node ...
1
vote
1
answer
270
views
Transform a pose to another frame with tf2 in Python
I have a pose stamped given in camera frame. Now I want to transform the pose to get its coordinates in the base_link frame.
Originally posted by fivef on ROS Answers with karma: 2756 on 2015-12-10
...
0
votes
2
answers
8
views
Get information about topic message at runtime
I am trying to build an interface that universally bridges ROS topics to another system.
I am importing the message type at runtime:
...
0
votes
1
answer
90
views
Python shutdown node
How i can shutdown a node in python?
In c++ is ros::shutdown() but in python i didn't find it.
Thanks
Originally posted by Porti77 on ROS Answers with karma: 183 on 2015-09-25
Post score: 2
0
votes
1
answer
4
views
Adding __package__ to ROS Python scripts breaks import
I wanted to do a relative import from my Python ROS node.
So I added a __package__ = 'my_package' specification to the beginning of the file (right under the ...
0
votes
1
answer
21
views
Python rospy Script doesn't end running
Hey there,
i already talked to some guys in #python irc channel. My aim was to close a while loop with ctrl-c so i used a try - exception statement. The problem is that the while loop doesnt really ...
0
votes
1
answer
8
views
Error tf2_ros StaticTransformBroadcaster API in Python
Update:
In an attempt to get around losing the ability to pub latch transforms in the API in python I have tried doing the following which does not seem to work. Anyone have a way to do this? And in ...
0
votes
1
answer
36
views
Playback of rosbag file at the same rate that messages are stored in rospy
Hi,
I am trying to playback data that I have stored using rosbag in rospy. Is it possible to playback the rosbag file in rospy at the same rate that it is recorded? I know that I can do this from the ...
0
votes
2
answers
12
views
CMakeLists.txt: Install Python
What is the best way to install python libraries with a package?
This tutorial says how to do Python scripts, and I know you also need a setup.py, but I'm having trouble running ...
0
votes
1
answer
7
views
How to use variable's value (subscriber function) in another function
Hello all !
I want to pass the variable which is set to its value when called the callback function. and then want to use the value of the variable in another function.
...
0
votes
1
answer
33
views
Is it possible to launch multiple nodes from one python script?
I see that rospy.init_node() can only be called once per process in the official documentation on nodes.
I'm trying to write a script that allows for two-way ...
0
votes
1
answer
113
views
Multiply two tf transforms converted to 4x4 matrices in python?
I want to do something along the lines of:
...
0
votes
1
answer
26
views
How to read a topic last value from a Python script?
Hello.
I'm working on a teleop program in Python. I want to change a joint position and add an offset read from the keyboard.
So I need to read a topic value to add the offset and send the command ...
0
votes
1
answer
5
views
import rospy when calling a python script from a c++ executable
I have a Robai Cyton gamma arm that I'm attempting to connect to with ROS by trying to call a Python script from a C++ program.
What I want to do is use C++ and OpenCV to get a video from an Xbox ...
0
votes
1
answer
8
views
Unable to install or run rospy
I've just installed the latest drcsim. From what I've read, a way to use python scripts is included in the ros package it comes with, rospy.
However, when I try to use rospy, the terminal does not ...
0
votes
1
answer
41
views
Using pypy with ROS for better performance?
How can I use pypy instead of the default python interpreter for a ROS node written in python ? I tried:
cd /path/to/node
pypy script/pioneer.py
But I'm getting an ...
0
votes
1
answer
39
views
ROSSerializationException while publishing PointCloud2 Message
Hello everyone,
when my node is publishing a PointCloud2 message I get the following error:
...
0
votes
1
answer
14
views
ROS hokuyo_node LaserScan Subscriber msg data class python
Hi I am trying to subscribe to a laser scan of the hokuyo_node. I am a bit new to ROS, here is my code so far. I have read the python subscriber tutorials but they don't tell how to subscribe to ...
0
votes
2
answers
3
views
Creating custom message and service for groovy, using them with Python
Hello,
I am discovering ROS groovy and I try to create a custom service. I followed the tutorial on creating a service with Python and did a Python node. But when I run my Python node, I get
'from ...