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

Gideon's profile - activity

2022-10-15 19:43:37 -0500 received badge  Great Question (source)
2022-05-07 16:24:23 -0500 received badge  Good Question (source)
2016-08-03 06:21:49 -0500 received badge  Good Question (source)
2015-11-24 10:31:24 -0500 received badge  Good Question (source)
2015-11-12 03:20:32 -0500 received badge  Nice Question (source)
2015-11-12 03:20:29 -0500 received badge  Enlightened (source)
2015-11-12 03:20:29 -0500 received badge  Good Answer (source)
2014-10-25 13:27:04 -0500 received badge  Famous Question (source)
2014-09-24 22:59:13 -0500 received badge  Notable Question (source)
2014-08-21 10:28:31 -0500 commented answer ImportError: No module named cv_bridge

Thank you for your help. I had indigo and ubuntu 14.04 installed initially but there is no package available for the sphero so I downgraded. I will try to build the sphero package from source.

2014-08-21 10:15:55 -0500 received badge  Popular Question (source)
2014-08-19 20:06:46 -0500 asked a question ImportError: No module named cv_bridge

Hello all, I am trying to subscribe to a kinect publisher, grab an rgb image and convert it to an ipl image so I can manipulate it with opencv. I am using Fuerte and Ubuntu 12.04 and I am writing the code in Python. I am bit unsure how to make sure my package paths are all set up correctly. I have found some example code that I am posting below and I get an error stating

"ImportError: No module named cv_bridge"

I have added <run_depend>cv_bridge</run_depend> and <build_depend>cv_bridge</build_depend> to my package.xml

My package will hopefully control a sphero at some point, and so my package is called 'sphero_controller' and it is in a catkin workspace below my home folder. I have added this to the end of my .bashrc

export ROS_PACKAGE_PATH=/home/gideon:/opt/ros/fuerte/stacks:$ROS_PACKAGE_PATH

Does anyone know what I may be doing wrong?

Thanks

Gideon

#!/usr/bin/env python
import roslib
roslib.load_manifest('sphero_controller')
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 cv2.cv as cv

from std_msgs.msg import ColorRGBA

class image_converter:

  def __init__(self):
    self.image_pub = rospy.Publisher("image_topic_2",Image)

    cv2.namedWindow("Image window", 1)
    self.bridge = CvBridge()
    self.image_sub = rospy.Subscriber("/camera/rgb/image_color",Image,self.callback)

  def callback(self,data):
    try:
      cv_image = self.bridge.imgmsg_to_cv2(data, "bgr8")
    except CvBridgeError, e:
      print e

    (rows,cols,channels) = cv_image.shape
    if cols > 60 and rows > 60 :
      cv2.circle(cv_image, (50,50), 10, 255)

    cv2.imshow("Image window", cv_image)
    cv2.waitKey(3)

    try:
      self.image_pub.publish(self.bridge.cv2_to_imgmsg(cv_image, "bgr8"))
    except CvBridgeError, e:
      print e

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)
2014-01-28 17:22:42 -0500 marked best answer How to pass arrays in custom messages

Hello all, I have a node publishing temperature data from a string of 8 batteries written in python. Each battery has 8 temperature sensors, and so rather than building a message with 64 fields I have it broken down into 8 arrays each of length 8. I have written a healthMap node in C++ and I want to subscribe to the temperature data. What should my message structure look like? Python wants to use a tuple and C++ wants a vector. Does anyone have a code example that illustrates how to approach this? I also have little experience working with vectors in C++, so hopefully you could give me a sketch of what the subscriber looks like as well. Sorry for the long-winded question

Cheers

Gideon

2014-01-28 17:22:41 -0500 marked best answer Filling in time stamp data for rxplot

Hello everyone, I am plotting a message using rxplot and all the data is at t = 0. I have been poking around this forum and I found a conversation saying that time stamp data must be filled in (which isnt mentioned in the tutorial for rxplot, maybe this should be mentioned). Do I have to go through each node that publishes a message and time stamp it (i.e in main before spin doing something like topic.header.stamp = ros::Time::now(); ) Do I stamp it when it is received by another node? I have messages being sent all over the place so I am hesitant to do this, so I want to make sure this is what I need to do before hand.

Thanks

Gideon

2014-01-28 17:22:36 -0500 marked best answer Can a node act as a server and a publisher?

Hello all, I have a piece of hardware (LabJack UE9) I am using to interface with a diesel generator for data acquisition as well as for some simple controls (turning it on and off), and I would like to have the node that interfaces with it to be capable of both publishing acquired data and servicing client requests to turn the generator on and off. Is this possible? I have successfully implemented client/servers as well as publishers/subscribers, but I am having problems stitching them together.

Thanks

Gideon

2014-01-28 17:21:52 -0500 marked best answer roslaunch of dynamic reconfigure gui

I would like the dyanmic reconfigure gui to launch automatically from the launch file rather than having to open up a new terminal and rosrun it separately. Does anyone know if this is possible?

2013-01-25 02:15:02 -0500 received badge  Nice Question (source)
2012-09-12 12:22:04 -0500 received badge  Nice Question (source)
2012-08-27 09:25:28 -0500 received badge  Famous Question (source)
2012-08-24 16:48:02 -0500 received badge  Famous Question (source)
2012-08-23 14:12:15 -0500 received badge  Famous Question (source)
2012-08-20 07:53:41 -0500 received badge  Famous Question (source)
2012-08-07 13:54:02 -0500 received badge  Notable Question (source)
2012-07-06 00:12:58 -0500 received badge  Notable Question (source)
2012-06-14 09:01:33 -0500 marked best answer cannot specify link libraries for target

Hello everyone. I dont normally run to the forums for healp, but I have been dealing with an issue for two days and I am getting really frustrated. I am trying to interface with a LabJack from within a ROS node. The developers have published a .c file full of functions for native TCP operation. I have compiled it into a shared object library but I am unable to link to it (Upon linking, I get undefined reference errors on the lines where I call functions from the library). I found a post on this site that says after adding the /lib directory (where my shared object library lives) to the link directories in CMakeLists, given my lib as libfoo, I add to the CMakeLists file "target_link_libraries(myNode,foo)"

When I do this, I get the following error

CMake Error at CMakeLists.txt:36 (target_link_libraries): Cannot specify link libraries for target "myNode" which is not built by this project.

I am completely stumped. I am pasting my CMakeLists.txt. file just incase it helps. My node is for a diesel generator, called 'dieselGenerator' and my library (for the LabJack) is called libue9.so. It looks like comments get put in bold here, I dont mean to yell. I really appreciate your help.

Cheers

cmake_minimum_required (VERSION 2.4.6)
include ($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set (ROS_BUILD_TYPE RelWithDebInfo)

# Initialize the ROS build system.
rosbuild_init ()

# Set the default path for built executables to the "bin" directory.
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)


# Set the name to use for the executable.
set (BINNAME dieselGenerator)

# Set the source files to use with the executable.
#set (SRCS ${SRCS} src/ue9.c)
set (SRCS ${SRCS} src/dieselGenerator.cpp)

# Have ROS autogenerate code used in messages.
rosbuild_genmsg ()

# Set the directories where include files can be found.
include_directories (${PROJECT_SOURCE_DIR}/include)
# Make sure the compiler can find the libraries.
link_directories (${PROJECT_SOURCE_DIR}/lib)
target_link_libraries (dieselGenerator ue9)

# Build the executable that will be used to run this node.
rosbuild_add_executable (${BINNAME} ${SRCS})

# List the libraries here.
set (LIBS ${LIBS} ue9)