Questions tagged [python]
Python is a widely used high-level, general-purpose, interpreted, dynamic programming language.
935
questions
0
votes
0
answers
10
views
Porting an exsiting Python Project to ROS2
I have a conceptual question about using ROS2 with other projects that I haven't been able to find a satisfactory answer for.
I work with a few complete systems written in Python that are self-...
0
votes
3
answers
151
views
How to show topics using python in ROS2
Hi, everyone.
Like the title, I want to show topics using python in ROS2.
First I thought use a ros2 topic list command through a ...
0
votes
1
answer
54
views
Already higher than takeoff altitude(not descending)
I have the following Python code that arms and take off the UAV using pymavlink. I am using the px4 flight stake
...
0
votes
2
answers
213
views
How to get robot position in map?
I'm having problems overlaying a trajectory onto an occupancy grid plotted using Matplotlib with the correct alignment.
My question is how do I get the robot ...
0
votes
0
answers
7
views
ROS2 Wrapper for a Python-based Sensor
I have a force sensor that I want to use with ROS2, however, I don't know how to create a ROS2 wrapper for it. All I found was this tutorial that creates a ROS1 wrapper. Below is a snippet of the ...
0
votes
2
answers
92
views
ROS2 custom message python import error
Hi
Deatails:
ROS Env
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_LOCALHOST_ONLY=0
ROS_DISTRO=foxy
I created a custom message as follows in Custom.msg file
...
0
votes
2
answers
22
views
QOS python code for create_subscriber
Hi I have tried various code snippets but have not been able to create correct code for sensor QOS definition for a service
I am writing in python
...
0
votes
2
answers
26
views
Install Python module for cross-compile target?
I'm cross compiling ROS Comm Hydro for an i.MX53 Cortex A8 ARM board. I've configured yujin_tools (thanks Daniel) to correctly cross-compile the ROS sources and build-time dependencies and prep them ...
0
votes
2
answers
37
views
Easiest way to implement HTTP server that can send ROS messages
I have a web interface that sends http requests to a server. When this server receives a request it needs to send messages through a ROS topic. Since this server will be very simple I thought that the ...
0
votes
2
answers
178
views
Extracting the (x,y,z) coordinates from pointcloud2 data in Python
Hello,
I'm in the process of using a stereo camera that generates a pointcloud2 sensor message. I can open it up in rviz, and view the pointcloud. now I want to try and use the uint8[] data for a ...
1
vote
2
answers
143
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 ...
1
vote
1
answer
15
views
No Python executables after colcon build (ament_cmake_python)
So I'm trying to create a ROS Humble Python pkg, but after running colcon build --symlink-install and source install/setup.bash ...
0
votes
1
answer
199
views
Running a ros2 package in virtual anaconda environment in ROS2 Humble
I have created a virtual anaconda environment in ROS2 (HUMBLE). In that I have installed tensorflow , torch. I have a ros2 package in which there are nodes that i want to run using ros2 run. When I do ...
0
votes
2
answers
12
views
ROS2 colcon ament: includes non-existent path /usr/local/lib/python3.10/dist-packages/numpy/core/include . How to set the folder to python3/?
I build an ament package A on a docker container on the cloud.
Then, I build locally package B that has A (which I pulled via conan) as dependency. And I see this error
...
1
vote
2
answers
706
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
2
answers
329
views
Sending Universal Robots UR5e to specific place Using Camera
I have a UR5e installed with a simple camera on its end effector. The robot is at a known position (Cartesian pose/angles and joint angles)
Using the camera I took a picture of a QR code and got the ...
0
votes
1
answer
51
views
ROS2 demo_nodes_py listener "No executable found"?
I have tried to install ROS2 humble in conda using robostack on Linux Mint 21.3. When I do so and activate the conda environment I am able to run cpp nodes but not the python ones. I.e when I try to ...
0
votes
0
answers
6
views
0
votes
2
answers
370
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
0
answers
15
views
Подключение дополнительных камер к образу который использует ROS
Всем привет. В ROS не разбираюсь. Столкнулся с проблемой подключения дополнительных камер на raspberry pi 4 с использованием образа clover_v0.23.img. Моя зада состоит в том, чтобы подключить камеру ...
0
votes
0
answers
6
views
i wanna blink a led with pwm and a potentiometer attached to a ADS1115 modulle using ros2 pubsub package
i had a while ago with some help from this forum sending potentiometer values from a publisher node to a subscriber node to blink a led in pwm but the led doesnt seem to receive values the talker node ...
0
votes
1
answer
14
views
ROS Subscriber receives a number of messages larger than the number of messages published by the publisher
I'm using ROS noetic and Python, my node publishes a message if some conditions are met, the queue_size is set to 1.
When I subscribe to the published topic I can see that the subscriber is receiving ...
0
votes
1
answer
72
views
Issue to import python modules in Ros2
I use pointpillars for object detection on pointcloud data (https://github.com/shangjie-li/pointpillars/tree/master). I have successfully trained and tested the deep network.
I would like to run the ...
1
vote
1
answer
233
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
1
answer
31
views
Robot not loading on gazebo
My Robot is not loading on Gazebo although loading fine on rviz2. Below is my code. On gazebo, only leg_link is loading not any other links. Although on the side ...
0
votes
1
answer
29
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
24
views
I wanna publish a integer from potentiometer using a ADS1115 module value to control a led with a ros2 python publishersubscriber node
i need to publish a integer from a ros2 talker node with a ads1115 to control a led in a listener node in python like this :
...
0
votes
3
answers
77
views
Call a service from a launch.py file in ROS2
Question
Is there any possibility to call a service from a launch.py file in ROS2?
Details
I have written a python node with a service which is launched by a launch.py file. Within the same launch ...
-1
votes
0
answers
13
views
i wanna publish a Adc potentiometer from a ADS1115 modue value with a ros2 python pubsub Node
i need to publish a integer from a ros2 talker node with a ads1115 to control a led in a listener node in python like this :
import time
import rclpy
from rclpy.node import Node
from time import ...
1
vote
0
answers
33
views
Inverse Kinematics for a 2DOF planar robot
I have a simple 2DOF planar robot with this configuration:
L1 and L2 are the lengths of my 2 arms. L1 is 245.5mm and L2 is 160mm.
Alpha is the first angle (the one of the base) and beta is the second ...
3
votes
1
answer
3k
views
MSP (Multiwii Serial Protocol) receiving data with pyMultiWii issue
I want to get telemetry data from my flight controller (Matek F405-CTR) and send control commands to it via MSP protocol.
I've already configured UART3 port on Matek in Inav configurator (look at pic)...
0
votes
1
answer
40
views
How to get a Docker container to see ROS traffic from the local host?
I am trying to get ROS traffic from the local host to a Docker container on that same host but I get an error when I run my Docker container.
The Dockerfile is:
...
0
votes
0
answers
8
views
Publish a .bag file in ROS using OpenDR
I'm trying to publish a .bag file for 3D object detection using OpenDR toolkit. I'm new at ROS and I see that they use .txt and .bin files in this PointCloud script to detect the objects in the point ...
0
votes
0
answers
20
views
How to install an external python package in ROS2?
I use pointpillars for object detection on pointcloud data (https://github.com/shangjie-li/pointpillars/tree/master). I have successfully trained and tested the deep network (Conda environment, Python ...
0
votes
1
answer
198
views
How to get the world coordinates with position and orientation in ROS 2 Humble
I am using ROS 2 Humble.
A person is supposed to take a photo of an AR marker with a camera.
Inside the system, we can obtain the relative coordinates, position (x, y, z), and rotation, orientation (x,...
1
vote
1
answer
16
views
Cannot import modules when running unit tests with catkin_make run_tests in ROS noetic with python3
I am trying to write unit tests for my ROS node in python and cannot import files from my src/ directory even though I believe I have configured everything correctly. I will walk through my problem to ...
0
votes
2
answers
329
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
Understanding nested node behavior with subscribers
When I run action info, the action subscriber shown is a different node than the node I passed to the AclientClient constructor. Why is this? It's not what I ...
0
votes
1
answer
28
views
Flickering OccupancyGrid data in RViz2
I'm implementing my own custom message of type nav_msgs/msg/OccupancyGrid to visualize grid-based quantities in a local map (namely virtual pheromones).
Back in ROS Noetic, my implementation worked ...
0
votes
1
answer
334
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
13
views
Unable to simulate a differential wheeled robot with kinematics mode (World file and controller code attached)
According to the webots documentation, a robot with differential wheels is automatically detected and can be automatically simulated in kinematics model if the physics node is disabled
The Robot ...
0
votes
2
answers
52
views
ROS 2 launch: Python vs XML
Hi,
As a ROS teacher, I am in the process of adapting my lectures / labs to ROS 2 for the next intake in September.
My target audience (master students / professionals) has two features:
does not ...
0
votes
0
answers
40
views
ROS2 serial driver with ROS message subscription
I need to set up a ROS2 python serial device driver that also subscribes to a ROS message. For serial drivers the only publish messages I set up the serial input in a select call like this. Here, the ...
0
votes
1
answer
315
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
0
answers
67
views
Ros2 can not import python modules located in subfolders
I am new to use ROS. I use Ros2 Humble on Ubuntu 22.04. I need to import some python codes/modules from different nested folders (or nested nested folders) to a Ros2 python node. The Ros2 node (...
0
votes
1
answer
206
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:
...
0
votes
2
answers
394
views
ROS 2 Package Executable Not Found by ros2 run
Environment:
Operating System: Ubuntu 22.04
ROS Version: ROS 2 Humble Hawksbill
Issue:
I have created a ROS 2 package named robot, and I am able to build it ...
1
vote
0
answers
32
views
Kalman filter for heading estimation provides oscillating output
I am designing a Kalman filter for heading estimation in 2D using magnetic compass, gyroscope and wheel encoder. The system state is
$ X = [h, w] $ and the measurements are $Z = [h_{mag}, g_z,d_h]$, ...
0
votes
1
answer
420
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,
...
0
votes
1
answer
31
views
Mocking call to third-party module from Publisher
I have just started working with ROS2 in python on an existing project and have to write unit tests to begin with. The production code will run on a raspberry pi, but testing is being done in an ...