我试图让我自己的ROS包在Gumstix Overo上工作。该项目的最终目标是从Caspa(相机)获取图像并使用ROS进行流式传输。为此,我在Yocto项目中取得了最大的成功:Pocky,它使用了BitBake交叉编译工具链。为此,我按照此GitHub仓库中的README.md说明进行操作:https://github.com/gumstix/Gumstix-YoctoProject-Repo
仅供参考,Gumstix官方网站上的实际闪存和安装说明更清晰。
我使用以下命令成功地使用所有ROS元数据和附加内容编译BitBake项目:
$ bitbake gumstix-console-image
(需要相当长的时间和大量的磁盘空间)以及稍后的闪存和安装。
这是我尝试编译的包:https://github.com/elikos/groundStationPublic我尽量保持文件夹尽可能简单,以限制潜在的路径问题,所以一切都在基础目录......(非常难看,我知道)
这是我的CMakelist.txt:
cmake_minimum_required(VERSION 2.8.3)
project(groundStationPublic)
## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS cv_bridge image_transport roscpp rospy std_msgs genmsg)
find_package(OpenCV REQUIRED)
## Declare ROS messages and services
#add_message_files(FILES Num.msg)
#add_service_files(FILES AddTwoInts.srv)
## Generate added messages and services
#generate_messages(DEPENDENCIES std_msgs)
## Declare a catkin package
catkin_package()
include_directories(include ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
add_executable(talker talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
#add_dependencies(talker beginner_tutorials_generate_messages_cpp)
add_executable(listener listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
#add_dependencies(listener beginner_tutorials_generate_messages_cpp)
add_executable(cornerDetection main.cpp ConerDetection.cpp LineDetection.cpp ImagePublisher.cpp)
target_link_libraries(cornerDetection ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
add_executable(bonPublisher bonPublisher.cpp)
target_link_libraries(bonPublisher ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
这是我的BitBake包装配方:
DESCRIPTION = "Elikos groundstation code."
SECTION = "devel"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=d566ef916e9dedc494f5f793a6690ba5"
DEPENDS = "roscpp rospy catkin std-msgs"
RDEPENDS_${PN} = "roscpp rospy std-msgs"
SRC_URI = "git://github.com/elikos/groundStationPublic.git"
SRCREV = "${AUTOREV}"
PV = "1.0.0+gitr${SRCPV}"
S = "${WORKDIR}/git"
inherit catkin
ROS_SPN = "groundStationPublic"
我已在~/yocto/poky/meta-ros/recipes-ros/groundStationPublic
如果我执行命令bitbake groundStationPublic
,一切都编译好了。没有错误。 (您可能会从x264_git收到错误,但正确的sourcerev是:SRCREV =" ffc3ad4945da69f3caa2b40e4eed715a9a8d9526")
最后,我的问题是:
/usr/share/
...... rosrun groundStationPublic talker
答案 0 :(得分:2)
好吧,终于找到了我自己问题的答案:
我必须在~/yocto/poky/meta-gumstix-extras/recipies-images/gumstix/gumstix-consol-image.bb
:
UTILITIES_INSTALL = " \
[...]
packagegroup-ros-comm \
python-wstool \
python-email \
python-distutils \
git \
git-perltools \
python-rosinstall \
rospy-tutorials \
roscpp-tutorials \
groundStationPublic \
[...]
"
并确保将UTILITIES_INSTALL添加到:
IMAGE_INSTALL += " \
[...]
${UTILITIES_INSTALL} \
[...]
"
我还必须更改CMakelist.txt以明确告诉它安装目标的位置,所以这里是新的CMakelist.txt(注意最后几行中的差异):
cmake_minimum_required(VERSION 2.8.3)
project(groundStationPublic)
## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS cv_bridge image_transport roscpp rospy std_msgs genmsg)
find_package(OpenCV REQUIRED)
## Declare ROS messages and services
#add_message_files(FILES Num.msg)
#add_service_files(FILES AddTwoInts.srv)
## Generate added messages and services
#generate_messages(DEPENDENCIES std_msgs)
## Declare a catkin package
catkin_package()
include_directories(include ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
#add_dependencies(talker beginner_tutorials_generate_messages_cpp)
add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
#add_dependencies(listener beginner_tutorials_generate_messages_cpp)
add_executable(cornerDetection src/main.cpp src/ConerDetection.cpp src/LineDetection.cpp src/ImagePublisher.cpp)
target_link_libraries(cornerDetection ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
add_executable(bonPublisher src/bonPublisher.cpp)
target_link_libraries(bonPublisher ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
add_executable(exempleSubscriber src/exempleSubscriber.cpp)
target_link_libraries(exempleSubscriber ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
install(TARGETS talker listener cornerDetection bonPublisher exempleSubscriber
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
不幸的是,我目前遇到的问题是opencv无法从caspa中读取图像(来自/ dev / video6)......但那还有其他问题!< / p>