ros

ROS Publisher is not publishing continuously

ROS Publisher is not publishing continuously Question: My Publisher is not publishing continuously, can you please tell me how can I subscribe/publish and advertise services in the same time? thanks in advance. #! /usr/bin/env python3 # -*- coding: utf-8 -*- import json import rospy from std_msgs.msg import String, Bool from state_controller.srv import ActorChange, ActorChangeResponse class …

Total answers: 1

How to know actual result of `proc_output.waitFor` if `expected_output` is wrong?

How to know actual result of `proc_output.waitFor` if `expected_output` is wrong? Question: I am trying to follow a ROS2 testing tutorial which tests a topic listener to understand how ROS2 testing works. Here is a screenshot of the related code at 21:15 I have a node target_control_node which subscribes the topic turtle1/pose and then move …

Total answers: 1

How to keep ROS publisher publishing while executing a subprocess callback?

How to keep ROS publisher publishing while executing a subprocess callback? Question: How can I keep the ROS Publisher publishing the messages while calling a sub-process: import subprocess import rospy class Pub(): def __init__(self): pass def updateState(self, msg): cmd = [‘python3’, planner_path, "–alias", search_options, "–plan-file", plan_path, domain_path, problem_path] subprocess.run(cmd, shell=False, stdout=subprocess.PIPE) self.plan_pub.publish(msg) def myPub(self): rospy.init_node(‘problem_formulator’, …

Total answers: 1

cannot import name 'ClassName' from 'PythonFile' using ROS Noetic

cannot import name 'ClassName' from 'PythonFile' using ROS Noetic Question: I’m using Python 3.8.10 and Ubuntu 20.04, I’m getting this Error: Traceback (most recent call last): File "/home/belal/git/decision_making_pacbot/devel/lib/ros_planning/ros_plan.py", line 15, in <module> exec(compile(fh.read(), python_script, ‘exec’), context) File "/home/belal/git/decision_making_pacbot/src/ros_planning/src/ros_planning/ros_plan.py", line 8, in <module> from problem_handler import ProblemHandler ImportError: cannot import name ‘ProblemHandler’ from ‘problem_handler’ (/home/belal/git/decision_making_pacbot/devel/.private/ros_planning/lib/ros_planning/problem_handler.py) My …

Total answers: 1

ROS2: Troubleshooting 'colcon build' for python packages?

ROS2: Troubleshooting 'colcon build' for python packages? Question: I’m working in a ROS2 workspace ‘home_ws’ with 5 of my packages: home_core home_devices home_extras home_launch home_ui All packages are python, all built following the same example from the ROS2 doc. After ‘colcon_build’ I only see 3 of the 5 packages. Output of ros2 pkg list: … …

Total answers: 1

Error: "self" is not defined error on VSCode on Ubuntu

Error: "self" is not defined error on VSCode on Ubuntu Question: I’m following a tutorial on understanding writing python publisher in ROS2. This is an example that I’m creating. The code does not seem to have any errors but in vscode, the self word is underlined in red and when I hover the mouse it …

Total answers: 1

Acting on information in a custom message on ROS

Acting on information in a custom message on ROS Question: I have done the tutorials which shows you how to publish and subscribe to messages in ROS. I have now set up a message talker and listener in a file, but this is where I am running into some issues. And this may be more …

Total answers: 1

Generate image from an unorganized typical scan-pattern lidar's point cloud data

Generate image from an unorganized typical scan-pattern lidar's point cloud data Question: I hope you guys doing well I have a LiDAR which is Livox Mid 70. Which have a scan pattern like this. scan_pattern, which is depends on the time and create the whole scene. I used ros to fetch the data from a …

Total answers: 1

ROS Publisher Node

ROS Publisher Node Question: I am writing a code to publish the frames from a video to a rostopic. While declaring the pub object it is giving me an error. import rospy import cv2 from std_msgs.msg import String from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError import sys class Video_Publisher: def __init__(self): self.pub = …

Total answers: 1