Questions tagged [python]
Python is a widely used high-level, general-purpose, interpreted, dynamic programming language.
892
questions
0
votes
0
answers
4
views
TurtleControlNode.call_set_pen_service() missing 4 required positional arguments
I have been trying to learn ROS2 humble and was studying about service.
I have create a Node with pub and sub with a service.
pub - for controlling turtle in turtlesim,
sub - for current position of ...
1
vote
1
answer
84
views
How do you publish on a ROS topic when the message type is not known?
I am trying to publish a ROS message in Python but I do not know the message type. I tried using AnyMsg and it did not work. If this is possible would someone be able to provide a Python code snippet?
0
votes
0
answers
14
views
How to plot array topics on RQT_plot?
I am working on a project where I need to plot data from ROS2 array topics using rqt_plot. The data I'm dealing with involves multiple array topics, which are published per cycle from another node. ...
2
votes
2
answers
56
views
Is there a way to publish a ROS AnyMsg in Python?
I am trying to publish a rospy.msg.AnyMsg by doing the following:
...
0
votes
1
answer
18
views
ROS2 on Windows 10 - `colcon build` uses wrong Python version: "No module named *"
When building my workspace with colcon build, it fails because of missing Python packages:
ModuleNotFoundError: No module named 'em'
'em' is just an example, ...
0
votes
0
answers
20
views
ROS noetic and Python 3.9
I have ROS noetic installed on Ubuntu 20.04 with Python 3.8. I would like to upgrade my Python to 3.9 and make it the default version. Will it have any effect on my ROS installation ?
0
votes
0
answers
23
views
Running ros (built from source) with specific Python version
I am on a Jetson nano, and I need to run ROS humble under a version of Python more recent than the 3.8 version in Ubuntu 20.04's APT repo. As such, I installed python 3.11.6 through pyenv, and built ...
0
votes
0
answers
20
views
can't spawn 2 turtlebot4 in Gazebo ignition
I am using ros2 humble with gazebo fortress on my Ubuntu 22.04, I am trying to spawn 2 turtlebot4 in my own world, I managed to spawn 1 turtlebot4 in my world but when I try to spawn a second one, I ...
0
votes
1
answer
26
views
Why can't I put a rospy.Timer in a while loop?
I am trying to be able to control when do I publish so I tried to put the rospy.Timer in a while loop. I did not use rospy.Rate or rate.sleep because I found out that it somehow interferes with the ...
0
votes
1
answer
40
views
Running / debugging ROS2 Python node with PyCharm on Windows
I am trying to run (and debug) a ROS2 node made in Python with the PyCharm IDE.
The results won't be exactly the same as ros2 run ..., but it seems directly running ...
1
vote
1
answer
58
views
Inverse kinematics for an unusual system
I'd like to use inverse kinematics for an unusual system. Basically it looks like this: I have a bunch of small objects (let's say A,B,C,D... which can be modeled as points) connected with revolute ...
1
vote
1
answer
62
views
depth aligned capture doesn't yield same number of rgb and depth frames -- cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is
Steps for reproducing the problem with an Intel RealSense D435 camera using ROS Noetic inside a docker.
In the first terminal:
...
1
vote
2
answers
54
views
Switching between 2 cameras (using opencv)
I have a manipulator in ROS and 2 cameras attached on it.
I want to switch the frames of cameras every 5 seconds
Both cameras work fine.
I do not want to close the window and reopen it (if it is ...
0
votes
0
answers
14
views
Interface for remote data exchange from Toyota HSR during runtime
I want to pull data, like telemetry, and also push information, like certain commands, onto a Toyota HSR remotely during runtime of the robot.
I could only find this Figure just showing a web-based UI ...
1
vote
2
answers
131
views
Converting a ros2 bag of color raw images to image files or video
This is using ros2 Humble in Ubuntu 22.04 and native Python 3.10
Eventual goal: capturing depth aligned RGB and Depth streams from Intel RealSense D435 camera and converting them to RGB and Depth ...
0
votes
0
answers
12
views
Im using a BNO055 In the IMU operation mode, but i can only get it to display 0's
Ive read the data sheet but cant find much info there, but when I try to get IMU to give me euler data (yaw,pitch,roll).
It gives me not accurate numbers for euler data and i cant use the adafruit ...
0
votes
0
answers
16
views
UR10 in self-destruction mode for certain trajectories
I am using a UR10 robot with official drivers with ROS1 (noetic) and python.
I coded a trajectory generator that creates waypoints.
These are also used by a trajectory server and sent to the robot.
...
0
votes
0
answers
24
views
Subscriber in python to std_msgs.msg.Float32 crashes when the maximum float-32bits is sent
Setup:
a publisher in c++ of std_msgs/msg/Float32 sends the maximum float-32bits (using std::numeric_limits::max())
a subcriber in c++ to the topic above works just fine
a subcriber in python to the ...
0
votes
1
answer
58
views
0
votes
0
answers
20
views
Change the color of the obstacle box via MoveIt Python binding
I'm using the MoveIt Python binding to add obstacles to the scene with
...
1
vote
0
answers
18
views
Painting the spots robot visited: in Gazebo
I have a robot (let's say it is a simple 2-wheeled+caster wheel diff drive robot). It works as a vacuum cleaner of a sort: moves over the "world", leaving behind a band of "clean carpet&...
0
votes
1
answer
49
views
Manually controlling the ROS driver from Python
What is the best approach to launch a ROS file? Do I need to check that roscore is running before running it?
0
votes
1
answer
48
views
Facing issues integrating PCL with ROS
I am trying to use PCL filters in my rosnode ,where I am trying to perform noise removal on the pointcloud,but while building the package. I am getting CMAKE errors
...
0
votes
1
answer
126
views
Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty
I'm trying to see a point cloud in Rviz but when I add the topic to de Displays i get an error (Rviz) and in the terminal where i opened Rviz I get the following message:
Invalid argument passed to ...
0
votes
2
answers
124
views
Can an ROS2 node run in a venv and use a different python than that used by the ROS2 installed version?
Could anyone please share a current link on the successful use of running an ROS2 node (>= Humble) in a venv with a different python version?
The troubles ...
My ROS2 system is on an RPi and Ubuntu ...
0
votes
1
answer
80
views
Is it possible to get x and y coordinates in gazebo world with mouse click?
I want to get the coordinates of a point (x and y coordinates) using the mouse on the gazebo client to navigate my robot to this clicked point. Please help me, I'm newbie!
0
votes
0
answers
16
views
Bag File Produced via launch file has 0 duration
I am writing bag file via rosbag. I have implemented a bagwriter class with singleton pattern for writing in bagfile
...
0
votes
0
answers
14
views
How to construct goals with constraints via MoveIt python binding?
Is it possible to construct a goal with pose constraints via MoveIt python binding?
I have realized this with
...
0
votes
0
answers
52
views
retime_trajectory returns weird velocities and accelerations
OS: Ubuntu Ubuntu 20.04.6 LTS
ROS: Noetic
Robot: Kinova Gen3 6DoF
To conduct reproducible studies I needed a program that executes specific routines always in the same way. Hence, I wrote a program ...
2
votes
1
answer
121
views
Getting the value of LaunchArgument inside python Launch file
I've came across an interesting issue.
Is it possible to get the value of the LaunchArgument inside the python launch file?
Take the following scenario:
...
0
votes
0
answers
41
views
There was a problem with cartographer mapping with ros1
I'm trying to map one track using a cartographer using ROS1, but there was a continuous problem with the track being twisted track.
The lidar used is Hokuyo UST-10LX.
The map we're going to measure is ...
0
votes
1
answer
31
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
27
views
How to install python script dependencies automatically on ROS1 Noetic?
I have a package with 2 python library dependencies: serial, and utm, but I am running into issues with installing these packages automatically. If I do ...
0
votes
1
answer
121
views
Error building ROS2 Humble empty python package - Cython
I'm trying to build a simple empty Python package on ROS Humble. I created the package using:
ros2 pkg create test_py --build-type ament_python
Then, I built it ...
0
votes
0
answers
39
views
ROS2 Pybind11 help needed
https://github.com/chrissunny94/floam
I am on a pressing issue to bring in Python support for FLOAM .
I am currently facing a lot of issues getting
linking libraries
namespaces
object oriented ...
0
votes
1
answer
142
views
How to add parameters to a node via a yaml file using a python launch file in ROS2?
I have tried all the solutions I've seen on forums but none seems to work, I've spent already several days on this and really hope someone can spot my mistake rapidly.
I have the following launch file ...
0
votes
0
answers
21
views
Issues with cube stacking controller for Panda Robot using Behavior Trees and Task Space Control
I have been working on a controller for a Panda (Franka Emika) robot (simulation, RobotDART and py_trees) and i can't figure out why the gripping mechanism doesn't work correctly. Initially the robot ...
0
votes
1
answer
113
views
Error: Packages could not have their rosdep keys resolved
I am getting an error when I give this command rosdep install --from-paths ./ -i -y --rosdistro melodic
...
0
votes
1
answer
31
views
How can I use albumentions (python package) in ros2 node
I tried to import the Albumentations package into my ROS 2 workspace with support from rosdep as follows:
1. Init and install rosdep
Details at: Managing Dependencies with rosdep
2. Add dependencies ...
1
vote
1
answer
93
views
Building example library of ROS 2
I am trying to build the example repository of ROS 2 Humble according to the tutorial. But the command colcon build --symlink-install gives the following error for ...
0
votes
1
answer
142
views
Make sure to source your ROS 2 workspace after your ROS 1 workspace
I am using ROS-noetic and ROS2-foxy in the same machine. I created a package in ros2, and write this obstacle_maneuver.py file,
...
1
vote
1
answer
231
views
how to use the rate.sleep function properly
So I have a task of making turtle sim draw a heart using parametric equations I don't know if all my equations are correct but here's my code
...
0
votes
0
answers
18
views
ros2 domain bridge: how to write yaml config file in python script?
I'm trying to write the yaml config file for the ROS2 domain bridge from a python script. At the end it should like this:
...
0
votes
0
answers
11
views
pb with frame name in lookup_transform
I've done the tutorial for tf2, and everything works fine.
Now I'm trying to reproduce the "follow" behavior with drones, but this time it fails.
I've got a Node for each drone. I do the ...
1
vote
0
answers
93
views
If i use a lambda function when creating a subscription, when it will be evaluated?
I use a lambda function to add a parameter to my callback function, but this new parameter does not have the value expected.
Here a code to reproduce my pb:
...
0
votes
0
answers
44
views
Cannot import mesh to planning scene in rviz using python
I am using Ros Noetic Ninjemys with Ubuntu 20.04. I am trying to import a mesh into the scene using python. I am able to import the STL file of the mesh using the rviz gui, but I am not able to do the ...
0
votes
0
answers
13
views
Pb with ActionServer and/or ActionClient in python
I've got an ActionServer that works when called from the command line, but when I use my own ActionClient, the send_goal command never ends waiting. Can someone tell me what's wrong ?
my ActionClient
<...
0
votes
1
answer
125
views
Performance Comparison Between Python and C++ in ROS2 for Real-Time Applications
Is there a disadvantage in terms of real-time performance when using Python as opposed to C++ in ROS2? If so, how significant is this disadvantage?
Thank you.
0
votes
0
answers
18
views
how to manage a timer in a pytest?
I've got a Node that publish a message in a timer. The code works fine but I want to write a pytest to ensure the message is published.
My test code is this one
...
0
votes
0
answers
36
views
Stepper motor control with Sparkfun Autodriver L6470 in Raspberry Pi 4B
I am struggling and cannot get this to work all (stepper motor doesn't do anything, not convinced even energising as can turn manually with no resistance)
Pins used from a Raspberry Pi 4B to a ...