Hi,
I am writing a GUI interface to run nodes in ROS. The following code execute a rosrun process when pressing Button1.
I looked for a code in order to kill that process when pressing Button 2. I did not find something specific or related to this work.
#simple GUI
import os, time, signal, threading
from Tkinter import *
from subprocess import call
from subprocess import Popen
import subprocess
import numpy as np
import cv2
#from PIL import Image, ImageTk
from PIL import *
def f1():
subprocess.Popen(["rosrun", "package_name", "nodename"])
def f2():
// NEED CODE HERE
root.title("root")
root.geometry("500x500")
button1 = Button(root,text="CORE", bg="black", fg="white", width=25, padx = 20, command=f1)
button1.pack()
button2 = Button(root,text="CORE", bg="black", fg="white", width=25, padx = 20, command=f2)
button2.pack()
↧
killing a rosrun process using python script
↧
Change path of rosrun. Couldn't find executables?
I am following tutorials of ROS at the ROS wiki
//www.ros.org/wiki/ROS/Tutorials/ExaminingPublisherSubscriber.
When I try to run `rosrun beginner_tutorials talker`. It tells me that:
[rosrun] Couldn't find executable named talker below /home/maverick/catkin_ws/install/share/beginner_tutorials
I know that the executable is not in the install folder but rather in devel. How can I make it search for rosrun beginner_tutorial talker in
devel/lib/beginner_tutorials/talker
Additional information: When I ran find -executable -type f the output is given as below:
*./devel/lib/beginner_tutorials/add_two_ints_client
./devel/lib/beginner_tutorials/talker
./devel/lib/beginner_tutorials/add_two_ints_server
./devel/lib/beginner_tutorials/listener
./devel/_setup_util.py
./devel/env.sh
./install/_setup_util.py
./install/env.sh
./build/CMakeFiles/CompilerIdC/a.out
./build/CMakeFiles/CompilerIdCXX/a.out
./build/CMakeFiles/CMakeDetermineCompilerABI_C.bin
./build/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin
./build/catkin_generated/installspace/_setup_util.py
./build/catkin_generated/installspace/env.sh
./build/catkin_generated/setup_cached.sh
./build/catkin_generated/env_cached.sh*
After using the `env | grep ROS_PACKAGE_PATH` I get:
ROS_PACKAGE_PATH=/opt/ros/groovy/share:/opt/ros/groovy/stacks
and I have sourced the file using the following command:
source ./devel/setup.bash
↧
↧
[rosrun] Couldn't find executable named talker or listener
Hi I created two files with name : talker.cpp and listener.cpp and put them in path : catkin_ws1>src>beginner2_tutorials>src , and the chang the CmakeLists.txt as said in [11. Writing a Simple Publisher and Subscriber (C++) ROS tutorials](http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29) and then run `catkin_make` and then in root workspace run : `$ rosrun beginner2_tutorials talker` but I receive this result :
[`rosrun] Couldn't find executable named talker below /home/fatima/catkin_ws1/src/beginner2_tutorials`
I review [11. Writing a Simple Publisher and Subscriber (C++) ROS tutorials] again i have noticed that i should have two executable in directory of my devel space but i havent any executable file i have only pkgconfig and beginner2_tutorials.pc !!! i dont know how should i have executable in located by default at ~/catkin_ws/devel/lib/ , may be this is my problem so i couldnt run `$ rosrun beginner2_tutorials talker` so please help me to solve this
↧
Running rosrun with gdb
I am running this in ros:
rosrun object_recognition_capture upload -i final.bag -n 'example' example --commit
object_recognition_capture is a package and I want to run it with all these options. How can I run it with debuger, if there is any possible way to do it? The problem is that this system is c++/python hybrid. Called `upload` program is a python code, but it calls c++ functions. So I can't use neither gdb nor pdb.
↧
error running rosrun command
I am running catkin on Mac OS X, and build a project given in tutorial, when i run `catkin_make`, it build successfully without giving error.
but when i run `rosrun first_tutorial talker` command it gives me following error
dyld: Library not loaded: librospack.dylib
Referenced from: /Users/ankurkhandelwal/ros_catkin_ws/install_isolated/bin/rospack
Reason: image not found
find: ftsopen: No such file or directory
[rosrun] Couldn't find executable named talker below
find: ftsopen: No such file or directory
↧
↧
As the rosrun command completes?
Hi! I have here in the launch file:
When I type in the various terminals:
$ rosrun hector_trajectory_server hector_trajectory_server
$ rosrun hector_geotiff geotiff_node
$ rosrun hector_exploration_node exploration_planner_node
$ rosrun hector_path_follower hector_path_follower_node
$ rosrun hector_exploration_controller simple_exploration_controller
Is it correct? Or is missing something? Thanks!
↧
Start a node from python code - rospy equivalence rosrun - rosgui qt
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.
↧
Roslaunch blocking message publication
I have two simple Python nodes, a publisher outputting data at /mypub/data and a subscriber consuming that data.
When I run them using rosrun, everything works perfectly, but when I launch each of them using roslaunch, the subscriber never receives any topics being output by the publisher.
Logging inside the publisher shows messages are being published and `rosmsg list|grep -i mypackage` shows my message type has been generated, but when my publisher is running and publishing, `rostopic echo /mypub/data` shows nothing and appears to hang.
My publisher's launch file is trivial:
And the node seems to start up cleanly with the output:
started roslaunch server http://localhost:60558/
SUMMARY
========
PARAMETERS
* /rosdistro: indigo
* /rosversion: 1.11.16
NODES
/
mypub (mypackage/mypub_node.py)
ROS_MASTER_URI=http://localhost:11311
core service [/rosout] found
process[mypub-1]: started with pid [12609]
[DEBUG] [WallTime: 1458106329.532694] init_node, name[/mypub], pid[12609]
[DEBUG] [WallTime: 1458106329.535395] binding to 0.0.0.0 0
[DEBUG] [WallTime: 1458106329.537606] bound to 0.0.0.0 49259
[DEBUG] [WallTime: 1458106329.540770] ... service URL is rosrpc://localhost:49259
[DEBUG] [WallTime: 1458106329.542789] [/mypub/get_loggers]: new Service instance
[DEBUG] [WallTime: 1458106329.554825] ... service URL is rosrpc://localhost:49259
[DEBUG] [WallTime: 1458106329.556568] [/mypub/set_logger_level]: new Service instance
self.packet_pub = rospy.Publisher('~data', msgs.Data)
[DEBUG] [WallTime: 1458106329.639749] ... service URL is rosrpc://localhost:49259
If I start it instead with rosrun, like:
rosrun mypackage mypub_node.py
it again seems to start cleanly, with output:
[DEBUG] [WallTime: 1458107532.209104] init_node, name[/mypub], pid[13349]
[DEBUG] [WallTime: 1458107532.211273] binding to 0.0.0.0 0
[DEBUG] [WallTime: 1458107532.212995] bound to 0.0.0.0 37078
[DEBUG] [WallTime: 1458107532.215700] ... service URL is rosrpc://localhost:37078
[DEBUG] [WallTime: 1458107532.217320] [/mypub/get_loggers]: new Service instance
[DEBUG] [WallTime: 1458107532.228779] ... service URL is rosrpc://localhost:37078
[DEBUG] [WallTime: 1458107532.230445] [/mypub/set_logger_level]: new Service instance
[DEBUG] [WallTime: 1458107532.320980] ... service URL is rosrpc://localhost:37078
[DEBUG] [WallTime: 1458107532.323380] [/mypub/packet_write]: new Service instance
and then `rostopic echo /mypub/data` successfully shows the messages.
What's the difference between these two calls? Why is roslaunch preventing messages from being visible outside the node?
↧
Running two nodes for two webcams with usb_cam
I'm trying to run two different webcams. What I understood was I need to create two different nodes and set the parameters differently to run them. Both are [Logitech C270 cameras](http://www.logitech.com/en-in/product/hd-webcam-c270).
What I did was copy the usb_cam_node.cpp file to usb_cam_node1.cpp and usb_cam_node2.cpp.
I then run them as follows:
> `rosrun usb_cam usb_cam_node1 _video_device:=/dev/video1 _camera_name:=cam1`
> `rosrun usb_cam usb_cam_node2 _video_device:=/dev/video2 _camera_name:=cam2` I added executables to the CMakeList.txt as follows: >`add_executable(${PROJECT_NAME}_node1 nodes/usb_cam_node1.cpp)`>`add_executable(${PROJECT_NAME}_node2 nodes/usb_cam_node2.cpp)`>`target_link_libraries(${PROJECT_NAME}_node1`
>` ${PROJECT_NAME}`
>`${avcodec_LIBRARIES}`
>` ${swscale_LIBRARIES}`
>` ${catkin_LIBRARIES}`
>`)`
>`target_link_libraries(${PROJECT_NAME}_node2`
>` ${PROJECT_NAME}`
>`${avcodec_LIBRARIES}`
>` ${swscale_LIBRARIES}`
>` ${catkin_LIBRARIES}`
>`)`
However every time I execute one after the other, I get the following error. >[ WARN] [1458914475.903122037]: Shutdown request received.
>[ WARN] [1458914475.903222764]: Reason given for shutdown: [new node registered with same name] Quite obviously the nodes are different. Not sure what's going wrong.
> `rosrun usb_cam usb_cam_node2 _video_device:=/dev/video2 _camera_name:=cam2` I added executables to the CMakeList.txt as follows: >`add_executable(${PROJECT_NAME}_node1 nodes/usb_cam_node1.cpp)`>`add_executable(${PROJECT_NAME}_node2 nodes/usb_cam_node2.cpp)`>`target_link_libraries(${PROJECT_NAME}_node1`
>` ${PROJECT_NAME}`
>`${avcodec_LIBRARIES}`
>` ${swscale_LIBRARIES}`
>` ${catkin_LIBRARIES}`
>`)`
>`target_link_libraries(${PROJECT_NAME}_node2`
>` ${PROJECT_NAME}`
>`${avcodec_LIBRARIES}`
>` ${swscale_LIBRARIES}`
>` ${catkin_LIBRARIES}`
>`)`
However every time I execute one after the other, I get the following error. >[ WARN] [1458914475.903122037]: Shutdown request received.
>[ WARN] [1458914475.903222764]: Reason given for shutdown: [new node registered with same name] Quite obviously the nodes are different. Not sure what's going wrong.
↧
↧
Call rosrun from Matlab or alternative
I already have a ros package with an executable inside it. From the terminal this is what I do to execute it:
$ source ~/catkin_ws/devel/setup.bash
$ rosrun my_package my_executable
This executable print some text on the shell:
Hello world
I want to call this commands in Matlab and import the printed text. I tried creating a shell script like this:
#!/bin/bash
source ~/catkin_ws/devel/setup.bash
rosrun my_package my_executable
and running it from Matlab in the following way:
[a,b] = system('~/./my_script')
but this is what I get:
[rosrun] Couldn't find executable named my_executable below /home/user/catkin_ws/src/my_package
The script works fine if called directly from the shell. How can I solve?
↧
rosrun cannot find executables.
I realize this question has been asked to death, but when running `rosrun raspicam raspicam_node` I get the message `[rosrun] Couldn't find executable named raspicam_node below /opt/ros/indigo/share/raspicam`.
I am running Raspbian jessie on a Raspberry Pi 2 with ROS Indigo. catkin_make_isolated was used to build the workspace.
I placed the following lines in .bashrc:
`source /opt/ros/indigo/setup.bash
export ROS_PACKAGE_PATH=/home/pi/ros_catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
export ROS_WORKSPACE=/home/pi/ros_catkin_ws`
Prior to running `rosrun`, I enter the ros_catkin_ws directory and input `source devel_isolated/setup.bash`
The executable exists under `ros_catkin_ws/devel_isolated/raspicam/lib/raspicam`.
If I move the executable to `ros_catkin_ws/src/raspicam/src`, everything works fine, but I would rather it work without manually moving files.
Output of `echo $ROS_PACKAGE_PATH`
Before sourcing: `/home/pi/ros_catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks`
after sourcing: `/home/pi/ros_catkin_ws/src/image_transport_plugins/theora_image_transport:/opt/ros/indigo/share:/opt/ros/indigo/stacks`
↧
Error: cannot launch node of type [message_to_tf/message_to_tf]: can't locate node [message_to_tf] in package [message_to_tf]
I'm new in ros, i have downloaded `hector_quadrotor` package, and when i run the command `roslaunch hector_quadrotor_demo outdoor_flight_gazebo.launch` after opening a new terminal, everything is normal, but when i run that command again after running `cd ~/catkin_ws`, `catkin_make`, `source devel/setup.bash`, the error: `ERROR: cannot launch node of type [message_to_tf/message_to_tf]: can't locate node [message_to_tf] in package [message_to_tf]` occurred. The details like this:
aicrobo@ubuntu:~/catkin_ws$ roslaunch hector_quadrotor_demo outdoor_flight_gazebo.launch
... logging to /home/aicrobo/.ros/log/ace916f6-fc96-11e5-8da5-b888e3704f6c/roslaunch-ubuntu-11805.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://ubuntu:60744/
SUMMARY
========
PARAMETERS
* /base_link_frame: /base_link
* /controller/imu_topic:
* /controller/motor/type: hector_quadrotor_...
* /controller/pose/type: hector_quadrotor_...
* /controller/pose/xy/k_d: 0.0
* /controller/pose/xy/k_i: 0.0
* /controller/pose/xy/k_p: 2.0
* /controller/pose/xy/limit_output: 5.0
* /controller/pose/yaw/k_d: 0.0
* /controller/pose/yaw/k_i: 0.0
* /controller/pose/yaw/k_p: 2.0
* /controller/pose/yaw/limit_output: 1.0
* /controller/pose/z/k_d: 0.0
* /controller/pose/z/k_i: 0.0
* /controller/pose/z/k_p: 2.0
* /controller/pose/z/limit_output: 5.0
* /controller/state_topic:
* /controller/twist/angular/xy/k_d: 5.0
* /controller/twist/angular/xy/k_i: 5.0
* /controller/twist/angular/xy/k_p: 10.0
* /controller/twist/angular/xy/time_constant: 0.01
* /controller/twist/angular/z/k_d: 0.0
* /controller/twist/angular/z/k_i: 2.5
* /controller/twist/angular/z/k_p: 5.0
* /controller/twist/angular/z/limit_output: 3.0
* /controller/twist/angular/z/time_constant: 0.1
* /controller/twist/limits/force/z: 30.0
* /controller/twist/limits/load_factor: 1.5
* /controller/twist/limits/torque/xy: 10.0
* /controller/twist/limits/torque/z: 1.0
* /controller/twist/linear/xy/k_d: 0.0
* /controller/twist/linear/xy/k_i: 1.0
* /controller/twist/linear/xy/k_p: 5.0
* /controller/twist/linear/xy/limit_output: 10.0
* /controller/twist/linear/xy/time_constant: 0.05
* /controller/twist/linear/z/k_d: 0.0
* /controller/twist/linear/z/k_i: 1.0
* /controller/twist/linear/z/k_p: 5.0
* /controller/twist/linear/z/limit_output: 10.0
* /controller/twist/linear/z/time_constant: 0.05
* /controller/twist/type: hector_quadrotor_...
* /ground_truth_to_tf/frame_id: /world
* /ground_truth_to_tf/odometry_topic: ground_truth/state
* /ground_truth_to_tf/tf_prefix:
* /quadrotor_aerodynamics/C_mxy: 0.074156208
* /quadrotor_aerodynamics/C_mz: 0.050643264
* /quadrotor_aerodynamics/C_wxy: 0.12
* /quadrotor_aerodynamics/C_wz: 0.1
* /quadrotor_propulsion/CT0s: 1.53819048398e-05
* /quadrotor_propulsion/CT1s: -0.00025224
* /quadrotor_propulsion/CT2s: 0.0
* /quadrotor_propulsion/J_M: 2.5730480633e-05
* /quadrotor_propulsion/Psi: 0.00724217982751
* /quadrotor_propulsion/R_A: 0.201084219222
* /quadrotor_propulsion/alpha_m: 0.104863758314
* /quadrotor_propulsion/beta_m: 0.549262344778
* /quadrotor_propulsion/k_m: -7.01163190977e-05
* /quadrotor_propulsion/k_t: 0.0153368647144
* /quadrotor_propulsion/l_m: 0.275
* /robot_description: , set to ""
[ INFO] [1460536870.598390189, 7525.280000000]: Laser Plugin (robotNamespace = /), Info: Using the 'robotNamespace' param: '/'
[ INFO] [1460536870.598545005, 7525.280000000]: Starting Laser Plugin (ns = /)!
[ INFO] [1460536870.601936582, 7525.280000000]: Laser Plugin (ns = /) , set to ""
[INFO] [WallTime: 1460536870.650298] [7525.280000] Spawn status: SpawnModel: Successfully spawned model
[ INFO] [1460536870.752155340, 7525.280000000]: imu plugin missing , defaults to 0s
[ INFO] [1460536870.752232380, 7525.280000000]: imu plugin missing , defaults to 0s
[spawn_robot-3] process has finished cleanly
log file: /home/aicrobo/.ros/log/ace916f6-fc96-11e5-8da5-b888e3704f6c/spawn_robot-3*.log
[ INFO] [1460536870.948360580, 7525.280000000]: Loading gazebo_ros_control plugin
[ WARN] [1460536870.948494219, 7525.280000000]: Desired controller update period (0.010000000 s) is slower than the gazebo simulation period (0.001000000 s).
[ INFO] [1460536870.948546287, 7525.280000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1460536870.949639288, 7525.280000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[ INFO] [1460536871.255643333, 7525.280000000]: Loaded gazebo_ros_control.
Loaded the following quadrotor drag model parameters from namespace /quadrotor_aerodynamics:
C_wxy = 0.12
C_wz = 0.1
C_mxy = 0.0741562
C_mz = 0.0506433
[INFO] [WallTime: 1460536871.410639] [7525.347000] Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] [WallTime: 1460536871.413802] [7525.350000] Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] [WallTime: 1460536871.416055] [7525.352000] Loading controller: controller/twist
[INFO] [WallTime: 1460536871.628121] [7525.491000] Controller Spawner: Loaded controllers: controller/twist
[INFO] [WallTime: 1460536871.646547] [7525.505000] Started controllers: controller/twist
Warning [Publisher.cc:134] Queue limit reached for topic /gazebo/default/pose/local/info, deleting message. This warning is printed only once.
I have installed `message_to_tf` package in `/home/aicrobo/catkin_ws/src/message_to_tf`:
aicrobo@ubuntu:~/catkin_ws$ rospack find message_to_tf
/home/aicrobo/catkin_ws/src/message_to_tf
but when i run the command `rosrun message_to_tf message_to_tf.cpp`, the output like this:
aicrobo@ubuntu:~/catkin_ws$ rosrun message_to_tf message_to_tf
[rosrun] Couldn't find executable named message_to_tf.cpp below /home/aicrobo/catkin_ws/src/message_to_tf
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun] /home/aicrobo/catkin_ws/src/message_to_tf/src/message_to_tf.cpp
and the`ROS_PACKAGE_PATH` is:
aicrobo@ubuntu:~/catkin_ws$ echo $ROS_PACKAGE_PATH
/home/aicrobo/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
I don't know what's wrong with it, please help me, thank you very much!
↧
ROS Can't find my executable - install_isolated
Running ROS Indigo on Raspbian I run "catkin_make_isolated --install" and I cannot seem to run my C++ node with:
pi@rospi:~/ros_catkin_ws $ rosrun eyebot_testing eybot_testing_node
[rosrun] Couldn't find executable named eybot_testing_node below /home/pi/ros_catkin_ws/install_isolated/share/eyebot_testing
This is my CMakeLists.txt file that compiles just fine.
cmake_minimum_required(VERSION 2.8.3)
project(eyebot_testing)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
)
catkin_package(
INCLUDE_DIRS include
)
include_directories(include
${catkin_INCLUDE_DIRS}
/home/pi/eyebot/include
)
add_executable(eyebot_testing_node src/eyebot_testing_node.cpp)
find_library(eyebot_testing_node /home/pi/eyebot/lib)
target_link_libraries(eyebot_testing_node
${catkin_LIBRARIES}
wiringPi
mpsse
X11
lirc_client
m
opencv_core
opencv_highgui
opencv_imgproc
eyebot
)
My source statements are also correct, these are the two lines in my .basrc file:
source /opt/ros/indigo/setup.bash
source /home/pi/ros_catkin_ws/install_isolated/setup.bash
Upon attempting to locate my binary (as the compilation and linking was successful), I can only find them in `/home/pi/ros_catkin_ws/devel_isolated/eyebot_testing/lib/eyebot_testing/eyebot_testing_node`
If I attempt to source from there using the devel setup.bash script it won't find the package at all.
Ideas?
**Update:**
I added this for installation and it didn't change where the binary ended up, same result.
## Mark executables and/or libraries for installation
install(TARGETS eyebot_testing_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
)
↧
↧
rosrun cannot find executables under turtlesim
I know this question has been asked many times, but I really wanted to understand what was wrong with my commands and environment setup. I tried solutions from other sources but none worked in my case.
I installed ROS indigo on Raspberry Pi 3 following this tutorial http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi
And I am going through beginner tutorials, currently on section "Understanding ROS Nodes" with following link: http://wiki.ros.org/ROS/Tutorials/UnderstandingNodes
As I ran command `rosrun turtlesim turtlesim_node`, the terminal gave following output error: `[rosrun] Couldn't find executable named turtlesim_node below /home/pi/ros_catkin_ws/src/ros_tutorials/turtlesim`
I have added `source /opt/ros/indigo/setup.bash;
source ~/ros_catkin_ws/devel/setup.bash;`in the end of `~/.bashrc` file.
Also, my working space is `ros_catkin_ws`.
As I run `rospack profile`, it produces following output:
0.065189 /home/pi/ros_catkin_ws/src
0.029168 * /opt/ros/indigo/share
0.020896 /home/pi/ros_catkin_ws/src/ros_comm
0.008227 /home/pi/ros_catkin_ws/src/ros_control
0.005578 /home/pi/ros_catkin_ws/src/ros
0.003114 /home/pi/ros_catkin_ws/src/roscpp_core
0.002664 /home/pi/ros_catkin_ws/src/joystick_drivers
0.002548 /home/pi/ros_catkin_ws/src/common_msgs
0.002168 /home/pi/ros_catkin_ws/src/ros_tutorials
0.001130 /home/pi/ros_catkin_ws/src/diagnostics
0.000709 /home/pi/ros_catkin_ws/src/ros_comm_msgs
As I run `rospack find turtlesim`, it successfully find location of the package at `/home/pi/ros_catkin_ws/src/ros_tutorials/turtlesim`
So can someone give me detailed instructions on how to follow the tutorial and find the executables? Thank you so much.
↧
Error while running rosrun
while I run the command rosrun casper_communication casper.py ,I get an error saying that there is no such file or directory. Actually there is that file exist in my Raspberry pi.
↧
Use roscore, roslaunch and rosrun in bash script
Hello!
I want to start roscore and several ros nodes from a other program with a bash script:
#!/bin/bash
source /opt/ros/indigo/setup.bash
source /catkin_ws/devel/setup.bash
roscore
when I call the script manually everything works, but when i call it from the other program (with system(start_ros.sh)) nothing happens.
Any ideas what I'm doing wrong?
↧
rosrun rviz rviz segment fault
here is my detail error message:
xlib: extension "RANDR" missing on display ":1.0".
[INFO] [1464500665. 072712581]: rviz version 1.11.14
[INFO] [1464500665. 073763304]: compiled against Qt version 4.8.6
[INFO] [1464500665. 073981688]: compiled against OGRE version 1.9.0 (Ghadamon)
Segmentation fault
after I set export OPENSSL_cp=0
error messages like this:
[INFO] [1464509255. 713055269]: rviz version 1.11.14
[INFO] [1464509255. 714392812]: compiled against Qt version 4.8.6
[INFO] [1464509255. 714826350]: compiled against OGRE version 1.9.0 (Ghadamon)
[New Thread 0x6da32210 (LWP 2171)]
[New Thread 0x6d0ff210 (LWP 2172)]
[New Thread 0x6c8ff210 (LWP 2173)]
[New Thread 0x6c0ff210 (LWP 2178)]
Program received signal SIGSEGV, Segmentation fault.
0x74276f4c in glXCreateContext() from /usr/lib/arm-linux-gnueabihf/libGL.so.1
by the way, on my raspbian OS, I can not run glxgears, here is the error message:
Error: could not get an RGB, Double-buffered visual
but I could run glxgears on my computer
301 frames in 5.0 seconds = 60.121 FPS
OS: raspbian jessie.
device: raspberry Pi 3.
my computer: ubuntu 14.04 LTS, I use my computer to connect raspberrt by ssh.
that is all. anyone else could tell me how to fix this? thanks a lot!
↧
↧
How to run a node as a background process?
So I am trying to write a program in which a main publisher node will use the system function to run multiple subscriber nodes. I would like to use something like: "rosrun &", however this doesn't work for me and the subscriber node still runs in the same terminal window. How can I change the command so that it executes in the way i described? I can't seem to figure it out. Thanks!!
↧
Code does nothing when i run it (ROS, opencv: Depth map using two cameras)
So here's my problem. I'm using ROS and opencv, trying to create a depth map using two cameras. However, the code that i wrote, does not seem to do anything and im a little confused about why
#!/usr/bin/env python
from __future__ import print_function
import roslib
roslib.load_manifest('test_cam')
import sys
import rospy
import cv2
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import message_filters
class image_converter:
def __init__(self):
self.bridge = CvBridge()
self.image_sub_1 = message_filters.Subscriber("/cameras/left_hand_camera/image",Image)
self.image_sub_2 = message_filters.Subscriber("/cameras/head_camera/image",Image)
self.ts = message_filters.TimeSynchronizer([self.image_sub_1, self.image_sub_2], 10)
self.ts.registerCallback(self.callback)
def callback(self,Image):
try:
cv_image_1 = self.bridge.imgmsg_to_cv2(Image, "bgr8")
cv_image_2 = self.bridge.imgmsg_to_cv2(Image, "bgr8")
except CvBridgeError as e:
print(e)
stereo = cv2.StereoBM_create(numDisparities=16, blockSize=15)
disparity = stereo.compute(cv_image_1,cv_image_2)
plt.imshow(disparity,'gray')
plt.show()
plt.waitKey(1)
def main(args):
ic = image_converter()
rospy.init_node('image_converter', anonymous=True)
try:
rospy.spin()
except KeyboardInterrupt:
print("Shutting down")
cv2.destroyAllWindows()
if __name__ == '__main__':
main(sys.argv)
↧
How to run rviz on Odroid-XU4?
I installed Lubuntu 14.04 on Odroid-XU4 along with setting up the workspace for ros-indigo. Whenever I run "rosrun rviz rviz", it
displays "Bus error". How do I fix this problem?
↧