Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all 197 articles
Browse latest View live

Running executables without using rosrun or roslaunch ??

$
0
0
**MY QUESTION :** Do ROS topics still properly communicate (subscribe/publish) in the following situation, even though I DID NOT run executables by rosrun/roslaunch? If not, is there way to run ROS executables without using rosrun/roslaunch? **SITUATION :** By running ```catkin biuld ```, executables are created as (~/catkin_ws/devel/lib/PROJECT_NAME/sample_node) If I try to run the execuatble as follows, it prints seemingly okay results on screen. ``` ./catkin_ws/devel/lib//sample_node ``` (```roscore``` runs somewhere anyway.) **NECESSITY :** I want to add ROS publish function in my pre-developed code, which cannot be run by rosrun/roslaunch because it contains other pthreads.

Running executables without using rosrun or roslaunch ??

$
0
0
**MY QUESTION :** Do ROS topics still properly communicate (subscribe/publish) in the following situation, even though I DID NOT run executables by rosrun/roslaunch? If not, is there way to run ROS executables without using rosrun/roslaunch? **SITUATION :** By running ```catkin biuld ```, executables are created as (~/catkin_ws/devel/lib/PROJECT_NAME/sample_node) If I try to run the execuatble as follows, it prints seemingly okay results on screen. ``` ./catkin_ws/devel/lib//sample_node ``` (```roscore``` runs somewhere anyway.) **NECESSITY :** I want to add ROS publish function in my normal executable file, which cannot be runned by rosrun/roslaunch because it contains other pre-developed threads.

.msg Module not being found

$
0
0
I am running ROS Indigo on Ubuntu 14.04. Here is my package and cmake file: CMAKELIST: cmake_minimum_required(VERSION 2.8.3) project(semantic_label_publisher) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages find_package(catkin REQUIRED COMPONENTS rospy std_msgs message_generation ) ## Generate messages in the 'msg' folder add_message_files( FILES SemLabel.msg # Message2.msg ) ## Generate services in the 'srv' folder # add_service_files( # FILES # Service1.srv # Service2.srv # ) ## Generate actions in the 'action' folder # add_action_files( # FILES # Action1.action # Action2.action # ) ## Generate added messages and services with any dependencies listed here generate_messages( DEPENDENCIES std_msgs # Or other packages containing msgs ) ################################### ## catkin specific configuration ## ################################### ## The catkin_package macro generates cmake config files for your package ## Declare things to be passed to dependent projects ## INCLUDE_DIRS: uncomment this if you package contains header files ## LIBRARIES: libraries you create in this project that dependent projects also need ## CATKIN_DEPENDS: catkin_packages dependent projects also need ## DEPENDS: system dependencies of this project that dependent projects also need catkin_package( # INCLUDE_DIRS include # LIBRARIES semantic_label_publisher CATKIN_DEPENDS rospy std_msgs # DEPENDS system_lib ) ########### ## Build ## ########### ## Specify additional locations of header files ## Your package locations should be listed before other locations # include_directories(include) include_directories( ${catkin_INCLUDE_DIRS} ) package.xml File: semantic_label_publisher0.0.0The semantic_label_publisher packagexxxTODOcatkinrospystd_msgsmessage_generationmessage_runtimerospystd_msgs I built my package, did everything, but when I run rosrun semantic_label_publisher semantic_label_publisher_node.py I get the following error: ImportError: No module named semantic_label_publish.msg Is there something I am doing wrong? If you need anymore info let me know. Thanks

OpenCV difference between roslaunch and rosrun

$
0
0
OS: Ubuntu 16.04.2 LTS Xenial ROS: Kinetic. OPenCV: 3.2.0-dev Python 2.7.12 ROS_ROOT=/opt/ros/kinetic/share/ros ROS_PACKAGE_PATH=/home/odroid/ros_ws/src:/opt/ros/kinetic/share ROS_MASTER_URI=http://localhost:11311 ROSLISP_PACKAGE_DIRECTORIES=/home/odroid/ros_ws/devel/share/common-lisp ROS_DISTRO=kinetic ROS_ETC_DIR=/opt/ros/kinetic/etc/ros If I run a python script through a launch file, OpenCV cannot open a camera, but running it manually openCV works fine. Here’s the bare bones Code Snippet where it works/fails. print cv2.__version__ camera=cv2.VideoCapture("/dev/video8") print camera if not camera.isOpened(): camera=None print "No camera" return camera Here’s the line from the launch file: Here’s the output of the screen dump from that launch: …. process[whisker_sensor-10]: started with pid [32257] 3.2.0-dev No camera…. Notice it sets up a camera Object, but it fails to open. However if I kill the specific node and then re-run it manually from a rosrun command: like this: odroid@fish01:~$ rosnode kill /whisker_sensor ; rosrun ros_whisker_sensor whisker_sensor.py killing /whisker_sensor killed 3.2.0-dev 136 0.723058982284 136 0.723058982284 134 0.731470868094 It passes the isOpened() check and starts dumping the data I’m looking for from a processed image. Does anyone have any thoughts as to why `camera.isOpened()` fails under a roslaunch but works under a rosrun? Is there any way I can get more informative information out of the camera function? I have a feeling its a path or library issue, but I can't figure out what's different between the launch file and run approaches.

ROSRUN can't find EXECUTABLE

$
0
0
Hello, I am using kinetic and I am trying to run a simple publisher and subscriber. the cmakelists.xml has the following code. cmake_minimum_required(VERSION 2.8.3) project(mastering_ros_demo_pkg) cmake_policy(SET CMP0046 OLD) find_package(catkin REQUIRED COMPONENTS actionlib actionlib_msgs roscpp std_msgs ) include_directories( include ${catkin_INCLUDE_DIRS} ) add_executable(demo_topic_publisher src/demo_topic_publisher.cpp) add_executable(demo_topic_subscriber src/demo_topic_subscriber.cpp) add_dependencies(demo_topic_publisher ${mastering_ros_demo_pkg}_gencfg) add_dependencies(demo_topic_subscriber ${mastering_ros_demo_pkg}_gencfg) target_link_libraries(demo_topic_publisher ${catkin_LIBRARIES}) target_link_libraries(demo_topic_subscriber ${catkin_LIBRARIES}) after running rosrun i get the following error : [rosrun] Couldn't find executable named demo_topic_publisher below /home/xavier/catkin_ws/src/mastering_ros_demo_pkg I did source the `setup.bash` after catkin_make but still the issue was not sovled. Please help me out here.

rosrun & node_name

$
0
0
With the advice from Lorenz I was able to resolve the errors I had when running rosmake. However I tried to launch rosrun but found that I am not using the correct node_name. Actually, I (incorrectly) assumed that after rosmake run completed one of the outputs would the creation of the node_name. Can anyone tell me how is the node_name created and where do I look for it? Thanks, Gene

Start a node from python code - rospy equivalence rosrun - rosgui qt

$
0
0
Hallo, I'm writing a plugin for my rosgui in python. At the moment I'm trying to write an "pressed-button" action which starts a rosnode. I's there a python-command equivalent to "`rosrun pkg node`" or the launch-command "? Unfortunately I couldn't find something in the documentations yet. Thanks for Help.

How to run sudo rosrun

$
0
0
How can I launch rosrun and roslaunch commands with sudo? Why It is not possible by default? Please help.

Running a node with rosrun requires extra input?

$
0
0
I'm trying to make OpenCV work with ROS and I finally found something that compiles, therefore I just downloaded and `catkin_make` [this.](https://github.com/Chinmoy07/Using-OpenCV-with-ROS) It did build, however, when I run `rosrun buoy buoycv`, I'm asked to choose one of the next ones additionally: `build/`, `devel/`, `install/` or `src/` and I do not understand why, nor I could find an explanation or have encountered this before. Could somebody kindly provide me with information about this? As of now, I cannot launch the node because of this. Thank you in advance

No output after starting my_publisher from the image_transport_tutorial pkg.

$
0
0
I'm following a tutorial `image_transportTutorialsExaminingImagePublisherSubscriber` and after command rosrun image_transport_tutorial my_publisher path/to/some/image.jpg nothing happens, no error or anything (of course I put correct path to my image)

rosrun gazebo spawn_model -file 'pwd'/object.urdf -urdf -z 1 -model my_object

$
0
0
I launched gazebo successfully with this command: "roslaunch gazebo_ros empty_world.launch" In a second terminal window I launch this" ""rosrun gazebo spawn_model -file 'pwd'/object.urdf -urdf -z 1 -model my_object" If I run the above in my catkin_ws/src directory (which has object.urdf in it) I'll get this error: "[rospack] Error: package 'gazebo' not found" Bear in mind that gazebo simulator is running behind my terminal windows, all ok. I just want to put a sample object.urdf (a simple box) in the simulation. This instruction is from "Creating and Spawning Custom URDF Objects in Simulation" I am running kinetic on ubuntu 16.04 quad processor box. Issuing the command "echo $ROS_PACKAGE_PATH" gives this: /home/ju78iklo9/catkin_ws/src:/opt/ros/kinetic/share Any help is greatly appreciated.

Rosnode runs with root access but not as a normal user

$
0
0
Hi, I am using ROS Kinetic with a Nvidia TX2 board. I have a rosnode performing detection using faster rcnn framework on a camera feed. When I run it as a normal user using the command: rosrun os_node os_cv_core 0 0 0 0 0 0 0 1 10 0 it throws the following error: frcnn() running ... F0509 07:02:15.048138 3700 syncedmem.hpp:22] Check failed: error == cudaSuccess (30 vs. 0) unknown error *** Check failure stack trace: *** @ 0x7fa8789718 google::LogMessage::Fail() @ 0x7fa878b614 google::LogMessage::SendToLog() @ 0x7fa8789290 google::LogMessage::Flush() @ 0x7fa878beb4 google::LogMessageFatal::~LogMessageFatal() @ 0x7fb1aff5fc caffe::SyncedMemory::mutable_cpu_data() @ 0x7fb19886a4 caffe::Blob<>::Reshape() @ 0x7fb1988ce4 caffe::Blob<>::Reshape() @ 0x7fb1a6eaf4 caffe::InputLayer<>::LayerSetUp() @ 0x7fb1b65d28 caffe::Net<>::Init() @ 0x7fb1b67f24 caffe::Net<>::Net() @ 0x7fb1b6b6dc FRCNN_API::Detector::Set_Model() @ 0x4b7614 FRCNN_API::Detector::Detector() @ 0x4b4318 main @ 0x7fb0dd28a0 __libc_start_main Aborted (core dumped) However, the node runs fine if I run it after entering root mode. How do I run this command as a regular user (using `sudo` does not work, I get the error saying `sudo: rosrun: command not found`)? Thanks.

rospack segmentation fault

$
0
0
Hi guys, I am using ros::package::getPath to resolve the path to a config file I am loading within my program. When I am starting the node using rosrun node_pkg node everything works just fine, but when I directly launch the generated executable in the devel directory, I immediately get a segmentation fault #0 0x00007ffff33056ad in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x00007ffff18511f3 in rospack::Stackage::~Stackage() () from /opt/ros/jade/lib/librospack.so #2 0x00007ffff1847ecf in rospack::Rosstackage::addStackage(std::string const&) () from /opt/ros/jade/lib/librospack.so #3 0x00007ffff184bfad in rospack::Rosstackage::crawlDetail(std::string const&, bool, int, bool, std::vector>&, boost::unordered::unordered_set, std::equal_to, std::allocator>&) () from /opt/ros/jade/lib/librospack.so #4 0x00007ffff184bef3 in rospack::Rosstackage::crawlDetail(std::string const&, bool, int, bool, std::vector>&, boost::unordered::unordered_set, std::equal_to, std::allocator>&) () from /opt/ros/jade/lib/librospack.so #5 0x00007ffff184cbe5 in rospack::Rosstackage::crawl(std::vector>, bool) () from /opt/ros/jade/lib/librospack.so #6 0x00007ffff185b2d1 in rospack::rospack_run(int, char**, rospack::Rosstackage&, std::string&) () from /opt/ros/jade/lib/librospack.so #7 0x00007ffff1857e3c in rospack::ROSPack::run(int, char**) () from /opt/ros/jade/lib/librospack.so #8 0x00007ffff1858169 in rospack::ROSPack::run(std::string const&) () from /opt/ros/jade/lib/librospack.so #9 0x00007ffff597bf01 in ros::package::command(std::string const&) () from /opt/ros/jade/lib/libroslib.so #10 0x00007ffff597c0cd in ros::package::getPath(std::string const&) () from /opt/ros/jade/lib/libroslib.so can anybody explain this behavior? #include std::string path = ros::package::getPath("x_common"); Thank you for your time!

I am facing problem in catkin_make when trying to compile a package with camera plugin in it I may have made any mistake in CMakeLists please help

$
0
0
[ 98%] Built target uuv_gazebo_ros_cpc_plugin [100%] Built target uuv_gazebo_ros_imu_plugin /usr/bin/ld: cannot find -lDepthCameraPlugin /usr/bin/ld: cannot find -lGpuRayPlugin /usr/bin/ld: cannot find -lContactPlugin /usr/bin/ld: cannot find -lCameraPlugin /usr/bin/ld: cannot find -lRayPlugin collect2: error: ld returned 1 exit status gazebo_car_camera_sensor_plugin/CMakeFiles/gazebo_car_camera_sensor_plugin.dir/build.make:278: recipe for target '/home/nehra/catkin_ws/devel/lib/libgazebo_car_camera_sensor_plugin.so' failed make[2]: *** [/home/nehra/catkin_ws/devel/lib/libgazebo_car_camera_sensor_plugin.so] Error 1 CMakeFiles/Makefile2:17350: recipe for target 'gazebo_car_camera_sensor_plugin/CMakeFiles/gazebo_car_camera_sensor_plugin.dir/all' failed make[1]: *** [gazebo_car_camera_sensor_plugin/CMakeFiles/gazebo_car_camera_sensor_plugin.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed>>> ~/catkin_ws ^C>>> ~/catkin_ws cmake_minimum_required(VERSION 2.8.3) project(gazebo_car_camera_sensor_plugin) find_package(catkin REQUIRED COMPONENTS gazebo_plugins gazebo_ros roscpp ) find_package (gazebo REQUIRED) catkin_package( INCLUDE_DIRS include LIBRARIES gazebo_car_camera_sensor_plugin CATKIN_DEPENDS gazebo_plugins gazebo_ros roscpp DEPENDS system_lib ) set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") include_directories(include) include_directories( ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ${GAZEBO_INCLUDE_DIRS} ) include_directories(${ADDITIONAL_INCLUDE_DIRS} ${OGRE_INCLUDE_DIRS}/Paging) add_library(${PROJECT_NAME} src/gazebo_ros_camera.cpp ) link_directories( ${GAZEBO_LIBRARY_DIRS} ) target_link_libraries( ${PROJECT_NAME} ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES} )

Extracting depth images using rosrun command using realsense camera

$
0
0
I entered this command to extract depth images from intel realsense R200 camera: rosrun image_view extract_images _sec_per_frame:=0.01 image:=/camera/depth/image_raw I wasn't able to get the images, instead showed this error: [ERROR] [1529053683.952956798]: Unable to convert 16UC1 image to bgr8 [ WARN] [1529053683.953020485]: Couldn't save image, no data! When i entered this command for color images, it worked: rosrun image_view extract_images _sec_per_frame:=0.01 image:=/camera/color/image_raw How can this issue be resolved?

Change behavior of killing nodes with same name

$
0
0
Any node which is already running with some name `my_node_name` will be killed if I run any node with the same name via `rosrun` and `roslaunch`. Example: # First terminal rosrun rviz rviz __name:=rviz # Second terminal rosrun rviz rviz __name:=rviz # First terminal again [ WARN] [1529837879.313228883]: Shutdown request received. [ WARN] [1529837879.313324710]: Reason given for shutdown: [new node registered with same name] The only exceptions are nodes which are defined in the `roscore.xml` as explained [here](http://wiki.ros.org/roscore). My question is, can I change the behavior of `rosrun/launch` such that old nodes keep running and new nodes will be killed?

Kill rosrun gracefully

$
0
0
Hi All, I am running a rosrun command to generate and publish messages continuously from a node X. But I am not able to gracefully kill the session. I am currently closing the terminal in order to stop the task. Kindly let me know if the below 2 approaches are correct and how to implement it. 1. Open a new terminal and kill the node X 2. Ctrl+C to stop the the publishing of messages and return to the terminal (This is what I am actually looking for) Thank you.

Could not find Qt binding (looked for: 'pyqt', 'pyside') when rosrun

$
0
0
I install ros kinetic on Ubuntu 16.04, with python 2.7. `rqt_graph` shows properly, however, when I run `rosrun rqt_gui rqt_gui` and `rosrun rqt_reconfigure rqt_reconfigure`. It shows the following message, my $PYTHONPATH is `/usr/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages`. `ros-kinetic-python-qt-binding` is already installed. Traceback (most recent call last):File "/opt/ros/kinetic/lib/rqt_gui/rqt_gui", line 13, in sys.exit(main.main()) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/main.py", line 59, in main return super(Main, self).main(argv, standalone=standalone, plugin_argument_provider=plugin_argument_provider, plugin_manager_settings_prefix=str(hash(os.environ['ROS_PACKAGE_PATH']))) File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/main.py", line 336, in main from python_qt_binding import QT_BINDING File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/__init__.py", line 55, in from .binding_helper import loadUi, QT_BINDING, QT_BINDING_MODULES, QT_BINDING_VERSION # @UnusedImport File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 252, in getattr(sys, 'SELECT_QT_BINDING_ORDER', None), File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 98, in _select_qt_binding raise ImportError("Could not find Qt binding (looked for: %s):\n%s" % (', '.join(["'%s'" % b for b in binding_order]), '\n'.join(error_msgs))) ImportError: Could not find Qt binding (looked for: 'pyqt', 'pyside'): ImportError for 'pyqt': No module named QtCore Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 89, in _select_qt_binding QT_BINDING_VERSION = binding_loader(required_modules, optional_modules) File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 131, in _load_pyqt _named_import('PyQt5.%s' % module_name) File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 111, in _named_import module = builtins.__import__(name) ImportError: No module named QtCore ImportError for 'pyside': No module named QtCore Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 89, in _select_qt_binding QT_BINDING_VERSION = binding_loader(required_modules, optional_modules) File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 163, in _load_pyside _named_import('PySide2.%s' % module_name) File "/opt/ros/kinetic/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 111, in _named_import module = builtins.__import__(name) ImportError: No module named QtCore

Serial Connection to Hokuyo from Master

$
0
0
Hi, I am currently getting the error: [ERROR] [1531729856.715593296]: Error connecting to Hokuyo: Could not open serial Hokuyo: /dev/ttyACM0 @ 115200 could not open serial device. Initially, after encountering this problem, I was able to resolve it by adding myself to the dialout list as suggested: https://answers.ros.org/question/286646/error-connecting-to-hokuyo-could-not-open-serial-hokuyo/ I was able to view the data from the Hokuyo after doing this. I am now trying to access the Hokuyo from a different machine. On the drone (where the Hokuyo is connected), I changed ROS_MASTER_URI and ROS_IP to match the PC. On the PC, I then ran: *$ roscore* , $ ssh drone-user@drone-IP I am able to run '$ rostopic list' correctly. However, after typing '$ rosrun urg_node urg_node', I receive the error mentioned above. Any help is greatly appreciated. Thanks, Justin

rosrun autocomplete show all src files.

$
0
0
when i try autocomplete at rosrun with tab key, uesr@pc:~$ rosrun name-of-pkg [tab] CMakeLists.txt [executable_name] main.cpp package.xml what i expect is to see only the executable_name on autocomplete, but what i see is whole files in package folder in src another happening : i created 2 catkin workspace with a pkg 1. create ws1/src/ws1_pkg, do $ catkin_make 2. then create ws2/src/ws2_pkg, do $ catkin_make 3. $ source ws1/devel/setup.bash -> can't autocomplete ws2_pkg 4. new terminal $ source ws2/devel/setup.bash -> rosrun ws1_pkg shows up. ws1_pkg shows up even if i sourced ws2 setup.bash What's happening to me? ubuntu 16.04, kinetic, reinstalled today
Viewing all 197 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>