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

How to set arg in launch file via code/command/rosparam?

$
0
0
Let's assume I have an `arg` in a launch file: My problem: I want to set the value of the arg dymically via code. The following ideas came to my mind: **Idea 1**: Use `command` like it is possible with `param`: Unfortunately, `arg` doesn't support `command`, only `value` is allowed. **Idea 2**: Set it via `eval` running an external command: Unfortunately, `os` isn't imported and I can't find a way to run an external program within `eval`. **Idea 3**: Inherit the value from a `param`: The first line works, but so far I haven't found a way to convert the ros param `date` into the `arg` though. I was assuming that there must be something like `$(eval param("date"))` similar to `$(eval arg("date"))`. This seems like a very basic problem, but I can't figure out a solution. Is it possible to make any of these 3 ideas work, or is there a different solution? Notes: - I make use of the `arg` in various other places in the launch file in expressions like `$(arg date)` or `$(eval arg('date') + '_suffix')`, which is why I had to make `date` an `arg` in the first place. If Idea 3 has a solution, I could make use a `param` in general. - I cannot depend on external launch bash files to pass in the data, because the launch file should be self-contained.

Roslaunch won't work after moving catkin_ws directory

$
0
0
Hi I am trying to run roslaunch command in my terminal and when I type my package name and roslaunch file that I want to run it breaks and gives me this error: [controls4Planner.launch] is neither a launch file in package [controls] nor is [controls] a launch file name I'm not sure whats wrong with this and can't seem to figure it out help would be great. Also these problems seem to only occur when I moved all my files into another directory and then I went and replaced all the paths with the new path when catkin_make was complaining. Using ROS Hydro, Ubuntu 12.04, EDIT: The problem was when moving my directory that all the paths for my work space didn't work because it pointed to something that wasn't there.

roslaunch doesn't register with catkin_make but does with catkin_make install?

$
0
0
Hi, When I make my workspace with catkin_make and then source my workspace with source devel/setup.bash roslaunch can't recognise any of my packages with the tab function but if i type out the full command such as roslaunch xsens_driver xsens_driver.launch however when I run catkin_make install and then source install/setup.bash my packages are there for me. Why is this occurring because it never use to occur and now when I try to follow someone else package it causes problems? Thanks in advance for any help on this issue :) This problem has caused me to develop a hatred for launch files.

get file location in launch file in ROS Kinetic

$
0
0
I want to set a ros paramter with the full dir or full file path of the lunch-file i am running or package name. I search over the net, and I see that in ROS Lunar there is $(dirname). from here: http://wiki.ros.org/roslaunch/XML Can I get similar effect in ROS Kinetic? ???-this lunch file location. Thanks for your help in advance.

Invalid roslaunch XML syntax: not well-formed (invalid token)

$
0
0
hi this is my launch file but i got a message Invalid roslaunch XML syntax: not well-formed (invalid token): line 1, column 0 which part is wrong??

Best way to check if ROS is running

$
0
0
I am writing a script, which relies on ROS currently running. I would like to check if ROS is currently running on the script's machine. What's the best way to do this? A couple ways I am considering are pinging Master URI and checking the processes. However, I'm asking to see if there's a better way. Perhaps an environment variable is set.

[Errno 13] Permission denied -roslaunch

$
0
0
ROS KINETIC PROBLEM DESCRIPTION: Got the following Error when roslaunch my launchfile. File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/loader.py", line 491, in param_value p = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child raise child_exception OSError: [Errno 13] Permission denied After WEEKS of diving into the structure of ROS, and not finding a REAL solution here, I slayed my dragon. I used a launchfile from a tutorial (dont ask me which), the problematic line was: SOLUTION: Is to change "command" to "textfile":

Return a value from a

$
0
0
If we have a launch file like this: Basically I have a bunch of complicated logic that sets up a variable `bar`, then from outside the `` scope I wish to access it again, rather than repeating all the logic. However, this gives the error: arg 'bar' is not defined Arg xml is I understand that `` opens a new scope, but is there a workaround for this? I could use `` to save `bar`, but I cannot see a way to read it back from the parameter server.

Roslaunch can't locate node, but rosrun works fine

$
0
0
I'm working on a simple node written entirely in python. To make it work with roslaunch, I made it into a package. I got the package working fine, and I can run `rosrun my_package controller` just fine. However, when I run it in a roslaunch file, it gives the error ` ERROR: cannot launch node of type [my_package/controller]: can't locate node [controller] in package [my_package]` What is wrong with my environment or package? As a minimal example, I get this with the simple launch file: What I've tried so far: 1. Changing the name of the executable from "controller" to "controller.py" (And adjusting in the launch file) 2. Setting 777 permissions on the executable 3. Relaunching the terminal 4. `source`ing .bashrc again (which has setup.bash in it) 5. Rerunning `catkin_make` a lot

ETH Modular sensor fusion framework fails to launch

$
0
0
I am running ROS Kinetic on Ubuntu Xenial on an x86_64, with kernel 4.15.0-29-generic. I am trying to follow the following tutorial: http://wiki.ros.org/ethzasl_sensor_fusion/Tutorials/Introductory%20Tutorial%20for%20Multi-Sensor%20Fusion%20Framework I followed all the steps to compile the framework as mentioned in the tutorial and could not make it work. So I used the additional packages mentioned and compiled all 4 of them: https://github.com/catkin/catkin_simple https://github.com/ethz-asl/glog_catkin https://github.com/ethz-asl/asctec_mav_framework https://github.com/ethz-asl/ethzasl_msf which seems to be more successful. However, when I try to launch the package mentioned (viconpos_sensor), I keep getting the following error: [viconpos_sensor.launch] is not a launch file name The traceback for the exception was written to the log file Is it a compilation issue? Did I not set everything up correctly? Here is my environment: ROS_ROOT=/opt/ros/kinetic/share/ros ROS_PACKAGE_PATH=/home/yukti/Desktop/MSF_PACKAGE/catkin_simple-master:/home/yukti/catkin_ws/src:/opt/ros/kinetic/share ROS_MASTER_URI=http://localhost:11311 ROS_VERSION=1 ROS_SPACE=/home/yukti/ros/rosbuild ROSLISP_PACKAGE_DIRECTORIES=/home/yukti/Desktop/MSF_PACKAGE/devel/share/common-lisp:/home/yukti/catkin_ws/devel/share/common-lisp ROS_DISTRO=kinetic ROS_ETC_DIR=/opt/ros/kinetic/etc/ros Some more information that would help replicate the bug is as follows: i have a master folder MSF_PACKAGE on my desktop that has the aforementioned packages listed within it. And I have set up my catkin workspace. Here is how I tried to compile the program: catkin_make --source ~/Desktop/MSF_PACKAGE/glog_catkin-master/ source devel/setup.bash rospack profile and repeated this for all the other packages. Any help would be appreciated. Thanks!

run_id on parameter server does not match declared run_id

$
0
0
I have set up several `roslaunch` files to be launched at system startup using `systemd`. However at the startup they show the above error and fail. When I set the `systemd` services to be restarted on failure, launch files are relaunched when failed and work fine. What might I be doing wrong here? **Declared `run_id` for each `roslaunch` seems to be different from each other at the first launch.** The error is in the following format run_id on parameter server does not match declared run_id: 686cb5dc-01cf-11e9-ab7c-b10995016401 vs 68b27f9a-01cf-11e9-ab7c-b10995016401 Here's the format of the systemd services I use [Unit] Description=Unit description Wants=roscore.service BindsTo=roscore.service [Service] User=username ExecStart=/script/that/runs/the/launch/file.sh Restart=on-failure RestartSec=1 [Install] WantedBy=multi-user.target `roscore.service` starts a roscore. I am using `kinetic` on `Ubuntu 16.04`.

Turn off Gazebo recording from launch file

$
0
0
I'm using gazebo2 (2.2.3) and running a lot of simulations and I don't need the recording data so I'd like to turn it off. I'm using a launch file to start the simulator. How can I turn off recording of state files from the launch file?

Errors running LaunchService unsing threading/multiprocessing.

$
0
0
Hi everyone, Im kind of replicating some examples (for instance, [this one](https://github.com/ros2/launch/blob/master/launch_ros/examples/pub_sub_launch.py)) and trying to run the ros2 LaunchService in a new thread or process. My objective is that I keep the launched nodes active while my python script is able to continue its normal execution, which consists in communicating with those nodes. Right now using threading is not viable since I get many errors, possibly related to python3.6 as I have read. So I am using multiprocessing/Process. The LaunchDescrioption has no issues when it's being launched form the command line (e.g.: `ros2 launch whatever_package whatever.launch.py`). Im running this from a really simple utility script (`ld` is the `LaunchDescription` obj). The code is the following: from launch import LaunchService, LaunchDescription from multiprocessing import Process def start_launch_servide_process(ld): ls = LaunchService() ls.include_launch_description(ld) p = Process(target=ls.run) p.start() What I want to achieve is that the `LaunchService` runner works exactly as the `ros2 launch` command. Any advice on how should I approach this? Thanks!

Debugging ROS with eclipse - with arguments

$
0
0
Hi all, my goal is to be able to debug the project VINS-MONO (https://github.com/HKUST-Aerial-Robotics/VINS-Mono) in eclipse. to do so I've preformed the following steps: * install eclipse * follow wiki.ros.org/IDEs instrunction in the eclipse section * create a debug project as instructed in www.ceh-photo.de/blog/?p=899 * at this point everything compiled and seemed to work * separate my ROSlaunch file (which launches three nodes) into two separate files - one with the launch-prefix flag (this is the node I wish to debug) and the other two nodes * running in three different consoles: the rosbag, the two launch files * running the debug project in eclipse all of this seems to work but the eclipse is not stopping at any breakpoints I set (even thous after main()) and it seems that the eclipse is unaware to the rosbag data which starts every subscriber in the code *after that I tried adding the arguments which appear in the launch file to the eclipse under run->debug-configuration->arguments. I just pasted them as they show on the launch file and it doesn't want to run the debug anymore (syntax error in arguments). so my questions are these: * Am I doing something wrong or this is the proper way to debug ROS in eclipse? * How do I set the arguments in the eclipse if at all? * Why is it not working :( ? Thank you for replying!

What do I wait for to avoid RViz error "No robot state or robot model loaded" on launch?

$
0
0
Including [panda_control_moveit_rviz.launch](https://github.com/ros-planning/panda_moveit_config/blob/melodic-devel/launch/panda_control_moveit_rviz.launch) in my own launch file which also launches a process which moves the robot results in [ERROR] - [/rviz_::TrajectoryVisualization::incomingDisplayTrajectory::464]: No robot state or robot model loaded`. This error is completely ignored and the process seems to run fine except for an update issue with the hand of the robot (possibly even unrelated). Upon further investigation, this seems to stem from launch order, in the sense that running the other nodes separately beforehand and launching my own move-the-robot node after the others (rviz included) are initialized, avoids the message entirely. Since roslaunch doesn't guarantee startup order I sought out to find which service/topic/other to wait on for before starting my own node, as I was doing in another case for planning scene service `get_planning_scene`, but: - I wanted to add a breakpoint at the `incomingDisplayTrajectory` call with gdb but I couldn't find some package like ros-kinetic-rviz-dbg as per [this](https://askubuntu.com/questions/487222/how-to-install-debug-symbols-for-installed-packages) to have debug symbols, so that didn't work; - I couldn't find anything from exploring the RViz source code: I worked my way from the top to the likely path that leads to the message, found out it needs `robot_loaded_` true in [robot.h](https://github.com/ros-visualization/rviz/blob/kinetic-devel/src/rviz/robot/robot.h) and from there went to RobotModelDisplay but in the end couldn't solve the issue. In the end I would only like to find out what I should wait for, but it would be nice to know if the only way to set the breakpoint I wanted to would have been to get rviz from source and recompile it myself.

rosrun error FileNotFoundError: [Errno 2] No such file or directory

$
0
0
I'm trying to run **rosrun package python scripts** and get some errors below: (cv-py3) hoang@hoang-Nitro-AN515-51:~/catkin_ws$ rosrun testpy test.py Parsing cfg/tiny-yolo-voc-3c.cfg Traceback (most recent call last): File "/home/hoang/catkin_ws/src/testpy/src/test.py", line 41, in tfnet = TFNet(options) File "/home/hoang/catkin_ws/src/testpy/src/darkflow/net/build.py", line 58, in __init__ darknet = Darknet(FLAGS) File "/home/hoang/catkin_ws/src/testpy/src/darkflow/dark/darknet.py", line 17, in __init__ src_parsed = self.parse_cfg(self.src_cfg, FLAGS) File "/home/hoang/catkin_ws/src/testpy/src/darkflow/dark/darknet.py", line 68, in parse_cfg for i, info in enumerate(cfg_layers): File "/home/hoang/catkin_ws/src/testpy/src/darkflow/utils/process.py", line 66, in cfg_yielder layers, meta = parser(model); yield meta; File "/home/hoang/catkin_ws/src/testpy/src/darkflow/utils/process.py", line 17, in parser with open(model, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: 'cfg/tiny-yolo-voc-3c.cfg' Note: those **errors stop** when I **run rosrun in the script's folder**. But, I wanna **add a node in package launch file** to use roslaunch for python scripts. What I need to do? Thanks in advance! I followed these steps: > $ cd ~> $ mkdir catkin_ws/src -p> $ cd catkin_ws> $ catkin_make> $ cd src> $ catkin_create_pkg testpy rospy this step I copy all scripts to package/src folder > $ cd ~/catkin_ws> $ catkin_make> $ . ~/catkin_ws/devel/setup.bash> $ roscore> $ chmod +x test.py (added #!/usr/bin/env python)> $ rosrun testpy test.py

Roslaunch using different port?

$
0
0
I'm attempting to use roslaunch to start nodes on 2 different machines. Apparently roslaunch will create it's own ssh connection - I have my network configured so that I use public / private keys for authentication, but I've set the ssh to be done over a different port. How would I configure my roslaunch file to do the same? (i.e. port 42 instead of 22) Current file: .... Obviously that's the wrong syntax, but that's what I'm trying to achieve. For reference, I can run `ssh sparky@bbb -p 4242` and connect just fine.

How .launch file uses "onInit" and "subscribe" of class(nodelet) in pcl_ros

$
0
0
Hi, I have gone through the pcl_ros source code and understand all things how it is using PCL. I have cleared understanding regarding the pcl_ros - PCL but not understand how .launch file using its "oninit" and "subscribe" functions in nodelet without calling it (or without any specific main/application file). For example, In the sample_voxel_grid.launch file mentioned that it is using voxel_grid nodelet but not understand, how it is operating the nodelet. Anyone can please describe how .launch uses "onInit" and "Subscribe" of nodelet?

Custom action servers run in a launch file problem

$
0
0
Hi all, I've made two simple action server A and B and one action client C that can communicate with both. I experienced a really strange behaviour: if i put the two server nodes within a launch file along with the client and i use the "roslaunch" to run the launch file, the two servers seem to run, but the client waits for the server. If i use "rosrun" to run the 3 single nodes in three different terminals, everything works well. The sequence of running the nodes doesnt matter as long as if i run as first the client using rosrun it waits the server and when i run later one of the server with rosrun it works perfectly. Anyone have a solution? i absolutely need to run everything within a launch file.As i have highlighted, the problem is not connected with the node' code lines as long as running them through "rosrun" i have the results i need that's why i dont post the code. Anyway the launch file is this one Thanks in advance

ERROR: cannot launch node of type : can't locate node in package

$
0
0
I have installed Ubuntu 18 04 and ROS melodic. I have installed moveit using these instructions: https://ros-planning.github.io/moveit_tutorials/doc/move_group_interface/move_group_interface_tutorial.html#getting-started Te section i have linked instructs the following: Open two shells. In the first shell start RViz and wait for everything to finish loading: roslaunch panda_moveit_config demo.launch In the second shell, run the launch file: roslaunch moveit_tutorials move_group_interface_tutorial.launch The second instruction failed with: ERROR: cannot launch node of type [moveit_tutorials/move_group_interface_tutorial]: can't locate node [move_group_interface_tutorial] in package [moveit_tutorials] If i do : rosrun moveit_tutorials and tab for autocomplete i don't see the 'move_group_interface_tutorial node'. I get: build_locally.sh collision_scene_example.py move_group_python_interface_tutorial.py I ran: locate move_group_interface_tutorial here is the output: /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/CXX.includecache /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/DependInfo.cmake /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/build.make /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/cmake_clean.cmake /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/depend.internal /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/depend.make /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/flags.make /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/link.txt /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/progress.make /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/src /home/anthony/ws_moveit/build/moveit_tutorials/doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/src/move_group_interface_tutorial.cpp.o /home/anthony/ws_moveit/devel/.private/moveit_tutorials/lib/moveit_tutorials/move_group_interface_tutorial /home/anthony/ws_moveit/devel/lib/moveit_tutorials/move_group_interface_tutorial /home/anthony/ws_moveit/src/moveit_tutorials/doc/move_group_interface/move_group_interface_tutorial.rst /home/anthony/ws_moveit/src/moveit_tutorials/doc/move_group_interface/move_group_interface_tutorial_robot_with_box.png /home/anthony/ws_moveit/src/moveit_tutorials/doc/move_group_interface/move_group_interface_tutorial_start_screen.png /home/anthony/ws_moveit/src/moveit_tutorials/doc/move_group_interface/launch/move_group_interface_tutorial.launch /home/anthony/ws_moveit/src/moveit_tutorials/doc/move_group_interface/src/move_group_interface_tutorial.cpp I have 2 workspaces. I created this workspace specifically for moveit!. here is the text i ahve added to my .bashrc # added by A Wilson to .bashrc file source /opt/ros/melodic/setup.bash source /home/anthony/catkin_ws/devel/setup.bash source /home/anthony/ws_moveit/devel/setup.bash source /home/anthony/catkin_ws/src/MYNT-EYE-S-SDK/wrappers/ros/devel/setup.bash export ROS_PACKAGE_PATH=/home/anthony/catkin_ws/src/MYNT-EYE-S-SDK/wrappers/ros/src:/home/anthony/catkin_ws/src:/opt/ros/melodic/share:/home/anthony/catkin_ws/src/MYNT-EYE-ORB-SLAM2-Sample/Examples/ROS/ORB_SLAM2:/home/anthony/ws_moveit/src echo "ROS package path:" $ROS_PACKAGE_PATH if i do: locate move_group_interface_tutorial I ran locate
Viewing all 598 articles
Browse latest View live


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