Thursday, January 23, 2014

Quora post on how to stay motivated !



1. All it takes is one step to get you started…


#1


2. Otherwise, you’ll end up like this guy:


#2


3. Think you have a marathon of a struggle ahead of you? Well, these BLIND guys ran 26.2 miles.


#3


4. So start by taking the stairs and stop being lazy.


#4


5. Because others wished they were as fortunate as you are.


#5


6. If you are afraid of failure, get over it.


#6


7. You’ve got two options, either suffer the pain of discipline or suffer the pain of regret.


#7


8. Don’t make excuses.


#8


9. And don’t wait around for things to magically happen.


#9


10. Face adversity? Turn it into determination.


#10


11. You’re never too young or too old to make shit happen.


#11


12. There will always be obstacles in your way.


#12


13. So learn to embrace and enjoy the journey, even if it’s tough.


#13


14. Because where there’s a will there’s a way.


#14


15. Whether it’s finding the courage to talk to the hottie across the bar…


#15


16. Or getting back in shape…


#16


17. Remember that you’re awesome.


#17



#18


18. And that you can do it.


#19


19. Seriously, you fucking can!


#20


20. Now,


#21


21. So stop jerking yourself and listen to what this wolf has to say.


http://www.dormstormer.com/wp-co...
http://www.dormstormer.com/wp-co...
#22


22. Because you’ve got a lot more potential than you might think.


#23
  
Upvoted • 33+ Comments • 35) • Thank • Report • Wed
Sam Mathew

Monday, January 13, 2014

How to source different version of opencv with ROS

Issue to use a stand alone installation of opencv bypassing the opencv that ships with  ros

source

http://answers.ros.org/question/61923/how-to-use-newer-versions-of-opencv-in-fuerte/
http://answers.ros.org/question/47249/problem-with-using-opencv_gpu-inside-ros/


I cheated and went to /opt/ros/fuerte/include and changed the name of opencv2 to opencv2bak. This way it finds the right includes. I don't think it's the right way to do it, though.

Also, went to /opt/ros/fuerte/share/OpenCV/OpenCVConfig.cmake and edited the Install path variable to /usr/local (where I installed)




Wednesday, January 1, 2014

link c code with c++ ROS code

link c code with c++ ROS code

asked 23 hours ago
edward gravatar image
jensenb gravatar image
I am having trouble with linking c-code with C++-code. The C++ code describes a ROS-node. I made a program that can read a compressed image-stream over udp with gstreamer in c-code. Each image-buffer calls a C++-method of the ROS-node, which effectively converts the gstreamer stream into a ROS image stream.
I organised it as such:
  1. udp_to_ros3.c file that describes gstreamer-functionality,
  2. ros_cpp.cpp file with class and wrapper for C-code to indirectly call class
  3. ros_cpp.o.so dynamic library compiled by catkin_make from ros_cpp.cpp (location: /home/edward/catkin_ws/devel/lib/)
  4. im_imageconv.h header of wrapper-code, used in ros_cpp.cpp and upd_to_ros3.c
I compiled upd_to_ros3.c to upd_to_ros3.o, and ros_cpp.o.so is compiled by catkin_make.
Now try to link it with: gcc -Wall -L/home/edward/catkin_ws/devel/lib/ udp_to_ros3.o -lros_cpp.o $(pkg-config --cflags --libs gstreamer-0.10) -lgstapp-0.10 -o udp_to_ros_image
I get the following errors:
/home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference to cv::fastFree(void*)' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference toros::init(int&, char**, std::basic_string, std::allocator > const&, unsigned int)' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference toros::NodeHandle::~NodeHandle()' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference toimage_transport::ImageTransport::ImageTransport(ros::NodeHandle const&)' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference to ros::Time::now()' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference toimage_transport::Publisher::publish(boost::shared_ptr > const> const&) const' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference toimage_transport::ImageTransport::~ImageTransport()' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference toros::NodeHandle::NodeHandle(std::basic_string, std::allocator > const&, std::map, std::allocator >, std::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::basic_string, std::allocator > > > > const&)' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference to cv::waitKey(int)' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference tocv_bridge::CvImage::toImageMsg() const' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference to ros::spinOnce()' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference tocv::Mat::copySize(cv::Mat const&)' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference to cv::Mat::deallocate()' /home/edward/catkin_ws/devel/lib//libros_cpp.o.so: undefined reference toimage_transport::ImageTransport::advertise(std::basic_string, std::allocator > const&, unsigned int, bool)' collect2: ld returned 1 exit status
I think it needs the ROS-headerfiles, but maybe also the libraries (?) as used by catkin to be able to link the two files. But even when I add -I/opt/ros/groovy/include/ros/ it still complains about undefined reference to ros:: things.
How to solve this the most pragmatic? Do I need to compile also the C-file within catkin CMakefile and link them together, or is there another way ?
retag close delete

2 Answers

0
answered 19 hours ago
jensenb gravatar image
To answer your last question, you do not necessarily need to compile your standalone (in the sense of ROS independent) c code within catkin. It is pretty straight forward to compile your c code as a shared or static library, and then link your ROS node to it using the standard CMake syntax (by adding your c library to target_link_libraries(...) for example).
To address your linker errors. You are not missing header files, you are improperly specify the libraries to link to and the library search paths. Remember that "-L" specifies the search path, and the "-l" specifies the library name (preferably without path and without ending). For object files ".o" you do not need the "-l" flag prefix. you are missing lots of opencv libraries in command, you can try adding "-lopencv_core" and "-lcv_bridge -limage_transport" to take care of the missing OpenCV and OpenCV binding symbols.
But I highly recommend you use the cakin for building and integrating your ROS code, and not to build things by hand.
EDIT: Responding to your further comments, you are using the CMake commands incorrectly. To create your library and link to it in CMake you should use:
add_library(upd_to_ros SHARED src/upd_to_ros3.cpp) #add the source files for your "external" library code here
add_executable(imageconv_node src/ros_cpp.cpp )
target_link_libraries(imageconv_node 
    upd_to_ros
    ${catkin_LIBRARIES} 
)
Note that your ROS node imageconv_node declared in your CMakeLists.txt will need a typical main function, and it is bad practice to hard code full paths in a CMakeLists.txt.
delete link

Comments

see comment below
edward (14 hours ago)
I also tried it by hand , compiled : gcc -Wall upd_to_ros3.o -o udp_to_ros_image -L/home/edward/catkin_ws/devel/lib/ -lros_cpp.o $(pkg-config --cflags --libs gstreamer-0.10) -lgstapp-0.10 -lopencv_core -L/opt/ros/groovy/lib/ -lrostime -limage_transport -lcv_bridge -lopencv_highgui This was successful.
edward (13 hours ago)
0
answered 14 hours ago
edward gravatar image
Thank you for your answer Jensenb. In the catkin CMakeList.txt I declared the following:
add_executable(imageconv_node src/ros_cpp.cpp ) <-- br="" has="" is="" it="" library="" main="" nbsp="" no="" really="" the="" which="">target_link_libraries(
/home/edward/c920/upd_to_ros3.o
<-- before="" br="" compiled="">${catkin_LIBRARIES}
)
Then get the following error:
CMake Error at CMakeLists.txt:115 (target_link_libraries): Cannot specify link libraries for target "/home/edward/c920/upd_to_ros3.o" which is not built by this project.
How to continue?
delete link

Comments

Please do not answers to your question that are not answers but further questions. Instead either edit your original question, or post a comment to my answer. You should delete this post.
jensenb (38 mins ago)

Yo

Best and Fastest Download Accelerator for Ubuntu is PROZGUI