ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

blakeh's profile - activity

2020-05-03 11:51:04 -0500 received badge  Famous Question (source)
2017-05-16 19:40:28 -0500 marked best answer Why can't roslaunch or rosrun find my executable?

I'm trying to build a little package which sends commands from the keyboard to turtlesim. The examples are rosbuild based and I'm trying to do it in hydro/catkin.

I've got it building and putting a binary in catkin_ws/install/lib/PROJECTNAME/ How do I specify in the .launch file that ROS should look in /install/lib/PROJECTNAME ?? If I copy the binary from /build/PROJECTNAME to /src/PROJECTNAME it runs. Should I just copy it over every time? There must be a better way!

Thanks

2017-01-23 11:37:47 -0500 received badge  Nice Question (source)
2015-06-26 01:06:18 -0500 received badge  Notable Question (source)
2015-02-06 20:33:22 -0500 received badge  Famous Question (source)
2015-02-06 20:33:22 -0500 received badge  Notable Question (source)
2015-01-12 20:44:48 -0500 received badge  Famous Question (source)
2014-11-04 17:22:00 -0500 commented answer 64 bit catkin/ boost issue

We had another upgrade pushed (by IT org) and this happened again (as you predicted!) But, removing build and devel did not solve the problem.

2014-11-04 17:20:50 -0500 received badge  Notable Question (source)
2014-10-30 12:50:42 -0500 received badge  Popular Question (source)
2014-10-28 17:53:55 -0500 commented question qt message fail

Sorry - my bad --- yes it was publisher.publish() ... thanks

2014-10-28 16:00:30 -0500 asked a question qt message fail

I have a large ROS package including python and C++ nodes and also a C++ GUI in QT. The QT node interacts with other ROS nodes via service calls and that works great. Ros::spinOnce is being called in a loop in a separate QThread and I've confirmed with log statements that that loop is running. However when I try to instantiate a msg publisher on the same node handle as used successfully for the service client, the following happens:

1) ROS logs and rqt shows that the publisher is properly advertised 2) publisher.publish() statments result in no output (either to console or to ROS logs).

My non-QT C++ nodes publish and receive messages without difficulty in the standard manner.

Any ideas??

2014-09-26 10:41:05 -0500 commented question 64 bit catkin/ boost issue

Thanks - obvious is OK! However : apt-get install returned:

libboost-all-dev is already the newest version.

2014-09-26 04:05:33 -0500 received badge  Popular Question (source)
2014-09-25 13:58:46 -0500 commented answer 64 bit catkin/ boost issue

Thanks Tulley - we did remove those dirs which did not fix the problem. So if you have a better suggestion I'd love to implement it.

2014-09-25 13:26:20 -0500 answered a question 64 bit catkin/ boost issue

Thanks. rm-rf of build and devel didn't do it. Maybe install would have. The following commands fixed it:

>cd /usr/lib
> sudo ln libboost_regex.so.1.46.1          /usr/lib/libboost_regex-mt.so 
> sudo ln libboost_date_time.so.1.46.1   /usr/lib/libboost_date_time-mt.so
> sudo ln libboost_system.so.1.46.1       /usr/lib/libboost_system-mt.so
> sudo ln libboost_thread.so.1.46.1         /usr/lib/libboost_thread-mt.so
2014-09-25 12:27:42 -0500 asked a question 64 bit catkin/ boost issue

I have a new ubuntu 64 bit 14.04 upgrade and a project which used to build successfully with catkin_make. Now I'm getting

make[2]: * No rule to make target `/usr/lib/libboost_regex-mt.so', needed by ... < one of my source files>

I've re-installed ros/indigo

Any ideas? (thanks in advance)

2014-08-21 07:25:52 -0500 received badge  Famous Question (source)
2014-08-05 22:12:57 -0500 received badge  Famous Question (source)
2014-07-24 07:05:30 -0500 received badge  Famous Question (source)
2014-07-20 12:44:13 -0500 received badge  Famous Question (source)
2014-07-09 15:18:48 -0500 received badge  Famous Question (source)
2014-06-30 07:44:52 -0500 received badge  Notable Question (source)
2014-06-19 05:04:32 -0500 received badge  Notable Question (source)
2014-05-28 13:45:05 -0500 received badge  Popular Question (source)
2014-05-28 06:47:36 -0500 commented answer rospy.service fail

Aha! that worked. thanks for your persistence.

2014-05-28 06:19:33 -0500 commented answer rospy.service fail

Latest output

blake@blake-Lenovo-IdeaPad-U530-Touch:~/Projects/Ros/catkin_ws$ source devel/setup.bash 
blake@blake-Lenovo-IdeaPad-U530-Touch:~/Projects/Ros/catkin_ws$ rossrv 
list      md5       package   packages  show      
blake@blake-Lenovo-IdeaPad-U530-Touch:~/Projects/Ros/catkin_ws$ rossrv show retractor_ros/PhidgetsServoCommand 
int64 servo
float64 displacement
---
int64 return_flag

blake@blake-Lenovo-IdeaPad-U530-Touch:~/Projects/Ros/catkin_ws$ rosrun retractor_ros pwm_servo.py 
Traceback (most recent call last):
  File "/home/blake/Projects/Ros/catkin_ws/src/pwm_ros/scripts/pwm_servo.py", line 23, in <module>
    from PhidgetsServoCommand.srv import *
ImportError: No module named PhidgetsServoCommand.srv
blake@blake-Lenovo-IdeaPad-U530-Touch:~/Projects/Ros/catkin_ws$ 

2014-05-28 05:58:06 -0500 commented answer rospy.service fail

Actually above is wrong. somehow that line is now an error!

2014-05-28 05:35:28 -0500 commented answer rospy.service fail

Thank you. It seems that different tutorials import differently and not as clearly. Fixing import statement to

#  Ros imports
from retractor_ros.srv import * 
import rospy
(and avoiding the underscores) Seemed to do the trick.

2014-05-28 05:13:54 -0500 received badge  Popular Question (source)
2014-05-26 01:29:11 -0500 received badge  Popular Question (source)
2014-05-22 08:00:09 -0500 asked a question rospy.service fail

Now that catkin is building my service files OK, I can't run it. The relevant code section is:

    rospy.init_node('servo_cmd_server', log_level=rospy.INFO)
    rospy.loginfo("Started Phidgets Servo Command Server Node")
    rospy.sleep(2.0)
    rospy.loginfo("Setting up the command service")
    rospy.loginfo("Namespace: %s", rospy.get_namespace())
    rospy.loginfo("getname:   %s", rospy.get_name())
    rospy.loginfo("Resolved name:   %s", rospy.resolve_name("PhidgetsServoCommand", caller_id="retractor_ros"))

    s = rospy.Service('retractor_cmd', _PhidgetsServoCommand, handle_servo_cmd)
    print 'Ready to receive servo commands!!!.'
    rospy.spin()

And the relevant output is:

[INFO] [WallTime: 1400781040.063425] Namespace: /
[INFO] [WallTime: 1400781040.063572] getname:   /servo_cmd_server
[INFO] [WallTime: 1400781040.063730] Resolved name:   /PhidgetsServoCommand
Traceback (most recent call last):
  File "/home/blake/Projects/Ros/catkin_ws/src/pwm_ros/scripts/pwm_servo.py", line 228, in <module>
    servo_cmd_server()      # start the server (doesn't return)
  File "/home/blake/Projects/Ros/catkin_ws/src/pwm_ros/scripts/pwm_servo.py", line 73, in servo_cmd_server
    s = rospy.Service('retractor_cmd', _PhidgetsServoCommand, handle_servo_cmd)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 696, in __init__
    super(Service, self).__init__(name, service_class, handler, buff_size)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 544, in __init__
    super(ServiceImpl, self).__init__(name, service_class)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/service.py", line 59, in __init__
    self.request_class = service_class._request_class
AttributeError: 'module' object has no attribute '_request_class'

Any ideas?? BTW, catkin has prefixed the MyName.srv file with an underscore to create _MyName.py . without the underscore, you get:

[INFO] [WallTime: 1400781520.326304] Namespace: /
[INFO] [WallTime: 1400781520.326438] getname:   /servo_cmd_server
[INFO] [WallTime: 1400781520.326581] Resolved name:   /PhidgetsServoCommand
Traceback (most recent call last):
  File "/home/blake/Projects/Ros/catkin_ws/src/pwm_ros/scripts/pwm_servo.py", line 228, in <module>
    servo_cmd_server()      # start the server (doesn't return)
  File "/home/blake/Projects/Ros/catkin_ws/src/pwm_ros/scripts/pwm_servo.py", line 73, in servo_cmd_server
    s = rospy.Service('retractor_cmd', PhidgetsServoCommand, handle_servo_cmd)
NameError: global name 'PhidgetsServoCommand' is not defined

Thanks!

2014-05-22 07:54:57 -0500 commented answer catkin can't find python service files

Now that I can import, i find that I can't actually start the service. Basically my project was working as long as I used the "AddTwoInts" service but I think somehow .h files from the ros distribution were sneaking into my build. Now that I have changed the name to "PhidgetsServoCommand", I had trouble above. Now that that is fixed, I can't do rospy.Service(). I'm going to post a new question with details... (Thanks again!)

2014-05-22 06:07:25 -0500 commented answer catkin can't find python service files

Thanks - your fix worked! To bad it's not in the documentation !

2014-05-22 06:07:25 -0500 received badge  Commentator
2014-05-21 16:11:26 -0500 asked a question catkin can't find python service files

I've got a python node which runs a service server. Catkin builds it fine and builds the service files (works fine for another package in C++ which uses the same .srv file). Even though it builds the file fine, at runtime the node can't import it. If I revise the python search path as shown:

PYTHONPATH='/home/blake/Projects/Ros/catkin_ws/devel/lib/python2.7/dist-packages/retractor_ros/srv/':$PYTHONPATH

it works. Here's my CMakelist.txt

cmake_minimum_required(VERSION 2.8.3)
project(retractor_ros)

set(BH_LIB_NAME XXXXXXXXXXX)


## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRE COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  rospy
  roscpp
  std_msgs
  message_generation
  ${BH_LIB_NAME}
)


## Generate services in the 'srv' folder
add_service_files(
   FILES
   PhidgetsServoCommand.srv
#   Service1.srv
#   Service2.srv
)

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs
 )

catkin_package(
  INCLUDE_DIRS 
#   LIBRARIES ${BH_LIB_NAME}
  CATKIN_DEPENDS message_runtime rospy roscpp std_msgs rstate_machine
#  DEPENDS system_lib
)

###########
## Build ##
########### 
include_directories(
  ${catkin_INCLUDE_DIRS}
#   /opt/ros/hydro/include/turtle_actionlib
  /home/blake/Projects/Ros/catkin_ws/devel/include/retractor_ros
  /home/blake/Projects/Ros/catkin_ws/src/pwm_ros
  /home/blake/Projects/Ros/catkin_ws/src/rstate_machine/include
)


## Declare a cpp executable
add_executable(retractor_ros_node retractor_fsm.cpp keyinput.cpp)
target_link_libraries(retractor_ros_node ${BH_LIB_NAME} ${catkin_LIBRARIES})

add_dependencies(${PROJECT_NAME}_node servo_fsm_generate_messages_cpp keyinput.cpp rstate_machine.cpp)

install(PROGRAMS
   scripts/pwm_servo.py
   ../devel/lib/retractor_ros/retractor_ros_node
   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
   )

## Mark executables and/or libraries for installation
install(TARGETS retractor_ros_node
#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
 ) 
2014-05-15 04:03:45 -0500 received badge  Notable Question (source)
2014-05-13 13:46:26 -0500 received badge  Scholar (source)
2014-05-13 07:56:25 -0500 commented answer How do I build a package as a library in catkin?

Thank you - on further checking CMakeList.txt and matching it carefully to the link in your answer, it seems to work now!

2014-05-11 12:06:31 -0500 received badge  Popular Question (source)
2014-05-10 06:55:40 -0500 commented answer How do I build a package as a library in catkin?

Right - yes I was using your link but posted the wrong one. I'll have to wait until Monday to post the CMakeLists.txt file --- thanks.