Folks,
I have a folder called "**lib**" inside my ROS package. The "**lib**" folder has two **.so** libraries (one is named "**librobotsdk.so**") that my package needs (the libraries inside "**lib**" are **not** part of any other ROS package). I am trying to add them to my CMakeList.txt in the next way:
include_directories(${PROJECT_SOURCE_DIR}/lib)
#link_directories(${PROJECT_SOURCE_DIR}/lib)
But when I do something like this inside my CMakeList.txt:
set(EXTRALIB_BIN robotsdk)
then I get the following error:
/usr/bin/ld: cannot find -lrobosdk
How can I include a library (in this case shared libraries) to my ROS path so tha **cakin_make** can compile it?
Thanks
↧
Shared libraries with catkin
↧
Ubuntu 14.04 Ros Indigo unmet dependencies
Hi everyone,
I decided to upgrade both OS and Ros distro.
I followed the usual preliminary instructions for the installation,
but when I try to install the full version with
sudo apt-get install ros-indigo-desktop-full
I get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ros-indigo-desktop-full : Depends: ros-indigo-perception but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I have been using Ros since Diamondback and I do not remember having this issue.
I browsed the web looking for possible solutions, but I found none.
Does anyone of you have a way to solve it?
Thanks in advance,
tambo
↧
↧
Package dependencies cannot be resolved
I'm a completely new Linux user running Ubuntu 14.04 and trying to install the ros-indigo-desktop-full package and I get the following error:
The following packages have unmet dependencies:
libcheese-gtk23: Depends: cheese-common (= 3.10.2-0ubuntu2) but 3.10.2-0ubuntu2 is to be installed
libcheese7: Depends: libgudev-1.0-0 (>= 146) but 1:204-5ubuntu20.10 is to be installed
Depends: cheese-common (= 3.10.2-0ubuntu2) but 3.10.2-0ubuntu2 is to be installed
libclutter-1.0-0: Depends: libatk1.0-0 (>= 2.5.3) but 2.10.0-2ubuntu2 is to be installed
Depends: libc6 (>= 2.14) but 2.19-0ubuntu6.6 is to be installed
Depends: libfontconfig1 (>= 2.9.0) but 2.11.0-0ubuntu4.1 is to be installed
Depends: libglib2.0-0 (>= 2.37.3) but 2.40.2-0ubuntu1 is to be installed
Depends: libgtk-3-0 (>= 3.3.18) but 3.10.8-0ubuntu1.4 is to be installed
Depends: libpango-1.0-0 (>= 1.30) but 1.36.3-1ubuntu1.1 is to be installed
Depends: libpangocairo-1.0-0 (>= 1.30) but 1.36.3-1ubuntu1.1 is to be installed
Depends: libpangoft2-1.0-0 (>= 1.30) but 1.36.3-1ubuntu1.1 is to be installed
Depends: libx11-6 (>= 2:1.2.99.901) but 2:1.6.2-1ubuntu2 is to be installed
Depends: libxcomposite1 (>= 1:0.3-1) but 1:0.4.4-1 is to be installed
Depends: libxdamage1 (>= 1:1.1) but 1:1.1.4-1ubuntu1 is to be installed
Depends: libxi6 (>= 2:1.2.99.4) but 2:1.7.1.901-1ubuntu1 is to be installed
ros-indigo-desktop-full:
↧
How to add cv_bridge and image_transport package to compile in Raspberry Pi?
Hi,
I have installed ROS indigo in Raspberry Pi by following [this link](http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi). I also installed opencv using [this](http://www.uco.es/investiga/grupos/ava/node/40). I can view the continuous image using ROS. Now I want to convert CV image from Raspberry Pi to ROS image and send it thru the node and read it from ubuntu PC. I'm following [this tutorial](http://wiki.ros.org/image_transport/Tutorials). I am having the following error after catkin_make. I think I missing dependencies or package. Please help.
> -- +++ processing catkin package: 'learning_image_transport'> -- ==> add_subdirectory(learning_image_transport)> CMake Error at> /home/pi/catkin_ws/devel/share/cv_bridge/cmake/cv_bridgeConfig.cmake:106> (message): Project 'cv_bridge'> specifies > '/home/pi/catkin_ws/src/vision_opencv/cv_bridge/include'> as an include dir, which is not> found. It does neither exist as an> absolute directory nor in > '/home/pi/catkin_ws/src/vision_opencv/cv_bridge//home/pi/catkin_ws/src/vision_opencv/cv_bridge/include'.> Ask the maintainer 'Vincent Rabaud>' to fix it.> Call Stack (most recent call first): > /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75> (find_package) > learning_image_transport/CMakeLists.txt:7> (find_package)
-- Configuring incomplete, errors occurred!
Invoking "cmake" failed
↧
Node dependencies
Hello,
Is there a simple way to create a dependency graph between ROS nodes? I would like to build a graph-like data structure where the presence of an edge between two nodes of the graph (representing ROS nodes) means that one of the nodes subscribes to a topic that the other node publishes, or that one of the nodes requests a service that the other node provides.
Any information on this would be highly appreciated !
Thanks.
↧
↧
catkin build can't find shared library from a dependent package
I've Just started using `catkin_tools`, and `catkin build`. It seems to require more precicely specified CMakeLists.txt files, and this is causing my grief at the moment.
I have package_A that depends on package_B's shared library. They are both within the one workspace.
When I `catkin build package_A`, package_B is built first, and it's shared library is placed in `devel/lib`. However, when package_A is linked, I get an error saying it can't find the library generated by package_B.
In package_A's CMakeLists.txt:
- I have used `find_package (package_B)`,
- I have included package_B in the `catkin_package( CATKIN_DEPENDS )` section,
- I have package_B mentioned in the `target_link_libraries` for the package_A target.
In package_B's CMakeLists.txt:
- I have package_B mentioned in `catkin_package ( LIBRARIES )` section.
*If I add a line `link_directories(${CATKIN_DEVEL_PREFIX}/lib})` then it works fine. However, this doesn't look like the proper solution to me.*
Any suggestions on what I'm missing / doing wrong?
Cheers,
Nap
Here are the CMakeLists.txt files from the packages in full:
Package_A:
cmake_minimum_required(VERSION 2.8.3)
project(whiteboard_test)
find_package(catkin REQUIRED COMPONENTS gusimplewhiteboard)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS gusimplewhiteboard
)
set(CMAKE_C_FLAGS "-std=c99")
set(CMAKE_CXX_FLAGS "-std=c++11 -DWHITEBOARD_POSTER_STRING_CONVERSION=1")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-rpath -Wl,${CMAKE_INSTALL_PREFIX}/lib")
include_directories(
include
${gusimplewhiteboard_INCLUDE_DIRS}
)
### THIS LINE IS REQUIRED TO FIND THE LIBRARY????? ###
link_directories(${CATKIN_DEVEL_PREFIX}/lib)
add_executable(whiteboard_test
src/whiteboard_test.cpp
)
target_link_libraries(whiteboard_test
gusimplewhiteboard
${CMAKE_DL_LIBS}
${LIBDISPATCH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
dispatch
)
add_dependencies(whiteboard_test
gusimplewhiteboard
)
**SOLVED BY:**
Removing:
### THIS LINE IS REQUIRED TO FIND THE LIBRARY????? ###
link_directories(${CATKIN_DEVEL_PREFIX}/lib)
and changing `target_link_libraries` statement to:
target_link_libraries(whiteboard_test
${catkin_LIBRARIES}
${CMAKE_DL_LIBS}
${LIBDISPATCH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
dispatch
)
↧
unmet dependencies while installing Ros on Ubuntu
Hello,
I'm using Ubuntu 13.04 (Raring) x64 with a virtual machine
I run:
sudo apt-get install ros-hydro-desktop-full
I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ros-hydro-desktop-full : Depends: ros-hydro-desktop but it is not going to be installed
Depends: ros-hydro-mobile but it is not going to be installed
Depends: ros-hydro-perception but it is not going to be installed
Depends: ros-hydro-simulators but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I have followed every step on the ros wiki (from allowing "restricted," "universe," and "multiverse." to updating the index)
I have also checked other solutions and many of them suggested using aptitude, still I couldn't use aptitude since I had errors while installing its package.
If you need more details let me know.
Help me !
Thanks :)
[UPDATE]
It's just that ROS Hydro didn't work out with ubuntu 13.04 due to its instability I guess. I recommend you guys, if you have this problem, to switch to a more stable ubuntu distribution (12.04 LTS worked just fine with me)
Thanks :)
↧
CMake Error for depending two custom packages
I have created a package called agv_msgs. I want to make this package contain my custom messages. I have built it with no problems. After that I have created another packege called agv_teleop and while creating this package I indicated agv_msgs, std_msgs, roscpp and rospy as its dependencies. I have modified the CMake list but when I try to catkin_make them I get the following error;
CMake Error at /home/emreay/catkin_ws/devel/share/agv_msgs/cmake/agv_msgsConfig.cmake:141 (message):
Project 'agv_teleop' tried to find library 'agv_msgs'. The library is
neither a target nor built/installed properly. Did you compile project
'agv_msgs'? Did you find_package() it before the subdirectory containing
its code is included?
Call Stack (most recent call first):
/opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake:75 (find_package)
agv_teleop/CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I have done the catkin_make for agv_msgs before I create the agv_teleop package. I also included agv_teleop for find_package() in CMakeLists of agv_teleop. I cannot figure out what I was doing wrong.
My CMakeLists for agv_msgs;
cmake_minimum_required(VERSION 2.8.3)
project(agv_msgs)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_generation
)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependencies might have been
## pulled in transitively but can be declared for certainty nonetheless:
## * add a build_depend tag for "message_generation"
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
add_message_files(
FILES
uint8Array.msg
)
## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
LIBRARIES agv_msgs
CATKIN_DEPENDS roscpp rospy std_msgs
DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
)
## Declare a cpp library
# add_library(agv_msgs
# src/${PROJECT_NAME}/agv_msgs.cpp
# )
## Declare a cpp executable
# add_executable(agv_msgs_node src/agv_msgs_node.cpp)
## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(agv_msgs_node agv_msgs_generate_messages_cpp)
## Specify libraries to link a library or executable target against
# target_link_libraries(agv_msgs_node
# ${catkin_LIBRARIES}
# )
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables and/or libraries for installation
# install(TARGETS agv_msgs agv_msgs_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
# )
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_agv_msgs.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
My CMakeLists for agv_teleop;
cmake_minimum_required(VERSION 2.8.3)
project(agv_teleop)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
agv_msgs
ps3joy
roscpp
rospy
std_msgs
message_generation
tf
)
## System dependencies are found with CMake's conventions
## find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependencies might have been
## pulled in transitively but can be declared for certainty nonetheless:
## * add a build_depend tag for "message_generation"
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )
## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
agv_msgs
std_msgs
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
LIBRARIES agv_teleop
CATKIN_DEPENDS agv_msgs ps3joy roscpp rospy std_msgs
DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
/home/emreay/catkin_ws/src/agv_msgs
)
## Declare a cpp library
# add_library(agv_teleop
# src/${PROJECT_NAME}/agv_teleop.cpp
# )
## Declare a cpp executable
# add_executable(agv_teleop_node src/agv_teleop_node.cpp)
## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(agv_teleop_node agv_teleop_generate_messages_cpp)
## Specify libraries to link a library or executable target against
# target_link_libraries(agv_teleop_node
# ${catkin_LIBRARIES}
# )
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables and/or libraries for installation
# install(TARGETS agv_teleop agv_teleop_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
# )
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_agv_teleop.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
add_executable(teleop src/teleop.cpp)
target_link_libraries(teleop ${catkin_LIBRARIES})
add_dependencies(teleop agv_gencpp)
↧
missing dependencies when installing ros_lib for arduino
Hey there,
So I was trying to install ros_lib for arduino. I followed all the instructions [here](http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup), but after the installation, the following errors popped up: http://i.imgur.com/uNqHszQ.png
What might have caused the faliure? is it serious? how should I fix it?
Thanks a lot
↧
↧
Release package which depends on 3rd party libraries
Hello everyone,
My question is related to do a release of packages that depends on a 3rd party library. Until now, I have solved my problem for the doc buildfarm by adding a command in the `CMakeList.txt` which launch a script to install the 3rd parties in the system (headers and libs). I know this could be considered as a trick but it worked fine.
Here the `CMakeList.txt`:
# install third parties
execute_process(COMMAND sudo bash install.bash
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/third_parties/
)
After that, I tried to do the release version of these packages. So, I read the tutorial of "[Wrapping an external library in ROS](http://wiki.ros.org/ROS/Tutorials/Wrapping%20External%20Libraries)" which says that this way is deprecated. And, I read then the tutorial "[Releasing a Third Party Package (with bloom)](http://wiki.ros.org/bloom/Tutorials/ReleaseThirdParty)" but I do not understand very well the steps for releasing the 3rd party code.
I really appreciate some help.
Thanks.
**Edit 1:**
My 3rd parties look like this:
### get source code and install exodriver
echo "INSTALLING EXODRIVER..."
echo
cd /tmp
rm -fr exodriver
git clone git://github.com/labjack/exodriver.git
cd exodriver/
# solve bug
sed -i "193s/usermod.*/usermod -a -G \$GROUP \$USER/" install.sh
sudo bash install.sh
# config links
ldconfig
echo "FINISH!"
echo
### get source code and install labjack driver (C lang)
echo "INSTALLING LJACKLM DRIVER..."
echo
cd /tmp
rm -fr ljacklm*
wget http://labjack.com/sites/default/files/2013/10/ljacklm.zip
unzip ljacklm.zip
cd ljacklm/libljacklm/
make
sudo make install
# config links
ldconfig
echo "FINISH!"
echo
This is one of my `install.bash` I commented before, in this case for a labjack device.
I would like to create a release for a package which depends on this 3rd party, and with the explanation of the tutorial for bloom I do not understand how to do it.
If somebody knows a project where I can find something similar I appreciate.
**Edit 2:**
I have found another way to launch my scripts when a rosdep install. This is explained in REP 112, and it is the [rdmanifest description](http://www.ros.org/reps/rep-0112.html#rosdep-manifests-rdmanifest).
I have found another question similar [answered](http://answers.ros.org/question/12191/how-rdmanifest-are-handled-by-ros_release/) that says rdmanifest only works with debian dependencies.
**Edit 3:**
Blocked in step [2.4](http://wiki.ros.org/bloom/Tutorials/ReleaseThirdParty#Adding_an_Install_Rule_as_a_Patch) of the bloom tutorial. Many differences between the "eml" example and mine.
**Edit 4:**
I add more information about my pkgs. My repo organization looks like this:
- maggie_drivers (repo)
- maggie_drivers (metapkg)
- maggie_ir_drivers (pkg with 3rd party deps)
- maggie_labjack_drivers (pkg with 3rd party deps)
- maggie_rfid_drivers (pkg with 3rd party deps)
- maggie_*_drivers (other pkgs)
Here the [link](https://github.com/UC3MSocialRobots/maggie_drivers) to GitHub.
↧
Automatically get missing package dependencies
I have been looking for this for some time now. There is a lot of question about dependencies but I didn't really find what I needed.
I am working on a raspberry pi where there is no prebuilt packages.
I installed the minimal version of ROS and some packages are missing.
Now I want to compile my own package that needs those missing packages.
What would be the command to automatically fetch the sources of all those missing packages and compile eveything in the right order?
I tried
catkin-make --rosdep-install
but it doesn't seem to work
↧
Is there an easy way to "embed" all my pip dependencies into a "catkin generated" deb ?
I want to release a package depending on a lot of pip dependencies.
I do not want to create and have to maintain a deb package for each one of my dependencies.
So I was wondering if there is any way to embed all my pip dependencies into a "catkin-generated" deb ?
↧
Unable to install Turtlebot
I am running ROS Indigo on Ubuntu Trusty but am unable to install Turtlebot from this tutorial:
http://wiki.ros.org/turtlebot/Tutorials/indigo/Turtlebot%20Installation
The error I get is:
sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ros-indigo-turtlebot-simulator : Depends: ros-indigo-turtlebot-gazebo but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I am running Ubuntu 14.04.2 LTS on a Acer Aspire S3 laptop, Linux kernal 3.13.0-55-generic x86_64 .
As requested in the feedback, I ran with -f -o Debug::pkgProblemResolver=yes and was still unable to install Turtlebot:
sudo apt-get install -f -o Debug::pkgProblemResolver=yes ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs > allout.txt 2>&1 Reading package lists... Building dependency tree... Reading state information... Starting pkgProblemResolver with broken count: 6 Starting 2 pkgProblemResolver with broken count: 6 Investigating (0) libsdformat2 [ amd64 ] < 2.3.2-1~trusty > ( libs ) Broken libsdformat2:amd64 Conflicts on libsdformat1 [ amd64 ] < none -> 1.4.11-1ubuntu0.1 > ( universe/libs ) Considering libsdformat1:amd64 -1 as a solution to libsdformat2:amd64 10 Added libsdformat1:amd64 to the remove list Conflicts//Breaks against version 1.4.11-1osrf1 for libsdformat1 but that is not InstVer, ignoring Conflicts//Breaks against version 1.4.11-1 for libsdformat1 but that is not InstVer, ignoring Fixing libsdformat2:amd64 via keep of libsdformat1:amd64 Investigating (0) libsdformat-dev [ amd64 ] < none -> 1.4.11-1ubuntu0.1 > ( universe/libdevel ) Broken libsdformat-dev:amd64 Depends on libsdformat1 [ amd64 ] < none -> 1.4.11-1ubuntu0.1 > ( universe/libs ) (= 1.4.11-1ubuntu0.1) Considering libsdformat1:amd64 -1 as a solution to libsdformat-dev:amd64 3 Holding Back libsdformat-dev:amd64 rather than change libsdformat1:amd64 Investigating (0) ros-indigo-gazebo4-msgs [ amd64 ] < 2.4.6-0trusty > ( misc ) Broken ros-indigo-gazebo4-msgs:amd64 Conflicts on ros-indigo-gazebo-msgs [ amd64 ] < none -> 2.4.8-0trusty-20150522-1307-+0000 > ( misc ) Considering ros-indigo-gazebo-msgs:amd64 -1 as a solution to ros-indigo-gazebo4-msgs:amd64 3 Added ros-indigo-gazebo-msgs:amd64 to the remove list Fixing ros-indigo-gazebo4-msgs:amd64 via keep of ros-indigo-gazebo-msgs:amd64 Investigating (0) ros-indigo-gazebo4-ros [ amd64 ] < 2.4.6-0trusty > ( misc ) Broken ros-indigo-gazebo4-ros:amd64 Conflicts on ros-indigo-gazebo-ros [ amd64 ] < none -> 2.4.8-0trusty-20150523-0901-+0000 > ( misc ) Considering ros-indigo-gazebo-ros:amd64 0 as a solution to ros-indigo-gazebo4-ros:amd64 1 Added ros-indigo-gazebo-ros:amd64 to the remove list Fixing ros-indigo-gazebo4-ros:amd64 via keep of ros-indigo-gazebo-ros:amd64 Investigating (0) ros-indigo-gazebo4-plugins [ amd64 ] < 2.4.6-0trusty > ( misc ) Broken ros-indigo-gazebo4-plugins:amd64 Conflicts on ros-indigo-gazebo-plugins [ amd64 ] < none -> 2.4.8-0trusty-20150523-1223-+0000 > ( misc ) Considering ros-indigo-gazebo-plugins:amd64 -2 as a solution to ros-indigo-gazebo4-plugins:amd64 0 Added ros-indigo-gazebo-plugins:amd64 to the remove list Fixing ros-indigo-gazebo4-plugins:amd64 via keep of ros-indigo-gazebo-plugins:amd64 Investigating (0) gazebo2 [ amd64 ] < none -> 2.2.5-1~trusty > ( devel ) Broken gazebo2:amd64 Depends on libsdformat-dev [ amd64 ] < none -> 1.4.11-1ubuntu0.1 > ( universe/libdevel ) (>= 1.4.11-1osrf1) Considering libsdformat-dev:amd64 3 as a solution to gazebo2:amd64 -1 Holding Back gazebo2:amd64 rather than change libsdformat-dev:amd64 Investigating (0) ros-indigo-kobuki-gazebo-plugins [ amd64 ] < none -> 0.4.2-0trusty-20150523-1235-+0000 > ( misc ) Broken ros-indigo-kobuki-gazebo-plugins:amd64 Depends on gazebo2 [ amd64 ] < none -> 2.2.5-1~trusty > ( devel ) Considering gazebo2:amd64 -1 as a solution to ros-indigo-kobuki-gazebo-plugins:amd64 -1 Holding Back ros-indigo-kobuki-gazebo-plugins:amd64 rather than change gazebo2:amd64 Investigating (0) ros-indigo-turtlebot-gazebo [ amd64 ] < none -> 2.2.0-0trusty-20150704-1259-+0000 > ( misc ) Broken ros-indigo-turtlebot-gazebo:amd64 Depends on ros-indigo-gazebo-ros [ amd64 ] < none -> 2.4.8-0trusty-20150523-0901-+0000 > ( misc ) Considering ros-indigo-gazebo-ros:amd64 0 as a solution to ros-indigo-turtlebot-gazebo:amd64 -1 Holding Back ros-indigo-turtlebot-gazebo:amd64 rather than change ros-indigo-gazebo-ros:amd64 Investigating (1) ros-indigo-turtlebot-simulator [ amd64 ] < none -> 2.2.0-0trusty-20150704-1330-+0000 > ( misc ) Broken ros-indigo-turtlebot-simulator:amd64 Depends on ros-indigo-turtlebot-gazebo [ amd64 ] < none -> 2.2.0-0trusty-20150704-1259-+0000 > ( misc ) Considering ros-indigo-turtlebot-gazebo:amd64 -1 as a solution to ros-indigo-turtlebot-simulator:amd64 9998 Re-Instated libsdformat1:amd64 Re-Instated libsdformat-dev:amd64 Re-Instated gazebo2:amd64 Re-Instated ros-indigo-gazebo-msgs:amd64 Re-Instated ros-indigo-gazebo-ros:amd64 Re-Instated ros-indigo-gazebo-plugins:amd64 Re-Instated ros-indigo-kobuki-gazebo-plugins:amd64 Re-Instated ros-indigo-turtlebot-gazebo:amd64 Investigating (1) libsdformat2 [ amd64 ] < 2.3.2-1~trusty > ( libs ) Broken libsdformat2:amd64 Conflicts on libsdformat1 [ amd64 ] < none -> 1.4.11-1ubuntu0.1 > ( universe/libs ) Considering libsdformat1:amd64 -1 as a solution to libsdformat2:amd64 10 Added libsdformat1:amd64 to the remove list Conflicts//Breaks against version 1.4.11-1osrf1 for libsdformat1 but that is not InstVer, ignoring Conflicts//Breaks against version 1.4.11-1 for libsdformat1 but that is not InstVer, ignoring Fixing libsdformat2:amd64 via keep of libsdformat1:amd64 Investigating (1) libsdformat-dev [ amd64 ] < none -> 1.4.11-1ubuntu0.1 > ( universe/libdevel ) Broken libsdformat-dev:amd64 Depends on libsdformat1 [ amd64 ] < none -> 1.4.11-1ubuntu0.1 > ( universe/libs ) (= 1.4.11-1ubuntu0.1) Considering libsdformat1:amd64 -1 as a solution to libsdformat-dev:amd64 3 Holding Back libsdformat-dev:amd64 rather than change libsdformat1:amd64 Investigating (1) ros-indigo-gazebo4-msgs [ amd64 ] < 2.4.6-0trusty > ( misc ) Broken ros-indigo-gazebo4-msgs:amd64 Conflicts on ros-indigo-gazebo-msgs [ amd64 ] < none -> 2.4.8-0trusty-20150522-1307-+0000 > ( misc ) Considering ros-indigo-gazebo-msgs:amd64 -1 as a solution to ros-indigo-gazebo4-msgs:amd64 3 Added ros-indigo-gazebo-msgs:amd64 to the remove list Fixing ros-indigo-gazebo4-msgs:amd64 via keep of ros-indigo-gazebo-msgs:amd64 Investigating (1) ros-indigo-gazebo4-ros [ amd64 ] < 2.4.6-0trusty > ( misc ) Broken ros-indigo-gazebo4-ros:amd64 Conflicts on ros-indigo-gazebo-ros [ amd64 ] < none -> 2.4.8-0trusty-20150523-0901-+0000 > ( misc ) Considering ros-indigo-gazebo-ros:amd64 0 as a solution to ros-indigo-gazebo4-ros:amd64 1 Added ros-indigo-gazebo-ros:amd64 to the remove list Fixing ros-indigo-gazebo4-ros:amd64 via keep of ros-indigo-gazebo-ros:amd64 Investigating (1) ros-indigo-gazebo4-plugins [ amd64 ] < 2.4.6-0trusty > ( misc ) Broken ros-indigo-gazebo4-plugins:amd64 Conflicts on ros-indigo-gazebo-plugins [ amd64 ] < none -> 2.4.8-0trusty-20150523-1223-+0000 > ( misc ) Considering ros-indigo-gazebo-plugins:amd64 -2 as a solution to ros-indigo-gazebo4-plugins:amd64 0 Added ros-indigo-gazebo-plugins:amd64 to the remove list Fixing ros-indigo-gazebo4-plugins:amd64 via keep of ros-indigo-gazebo-plugins:amd64 Investigating (1) gazebo2 [ amd64 ] < none -> 2.2.5-1~trusty > ( devel ) Broken gazebo2:amd64 Depends on libsdformat-dev [ amd64 ] < none -> 1.4.11-1ubuntu0.1 > ( universe/libdevel ) (>= 1.4.11-1osrf1) Considering libsdformat-dev:amd64 3 as a solution to gazebo2:amd64 -1 Holding Back gazebo2:amd64 rather than change libsdformat-dev:amd64 Investigating (1) ros-indigo-kobuki-gazebo-plugins [ amd64 ] < none -> 0.4.2-0trusty-20150523-1235-+0000 > ( misc ) Broken ros-indigo-kobuki-gazebo-plugins:amd64 Depends on gazebo2 [ amd64 ] < none -> 2.2.5-1~trusty > ( devel ) Considering gazebo2:amd64 -1 as a solution to ros-indigo-kobuki-gazebo-plugins:amd64 -1 Holding Back ros-indigo-kobuki-gazebo-plugins:amd64 rather than change gazebo2:amd64 Investigating (1) ros-indigo-turtlebot-gazebo [ amd64 ] < none -> 2.2.0-0trusty-20150704-1259-+0000 > ( misc ) Broken ros-indigo-turtlebot-gazebo:amd64 Depends on ros-indigo-gazebo-ros [ amd64 ] < none -> 2.4.8-0trusty-20150523-0901-+0000 > ( misc ) Considering ros-indigo-gazebo-ros:amd64 0 as a solution to ros-indigo-turtlebot-gazebo:amd64 -1 Holding Back ros-indigo-turtlebot-gazebo:amd64 rather than change ros-indigo-gazebo-ros:amd64 Investigating (2) ros-indigo-turtlebot-simulator [ amd64 ] < none -> 2.2.0-0trusty-20150704-1330-+0000 > ( misc ) Broken ros-indigo-turtlebot-simulator:amd64 Depends on ros-indigo-turtlebot-gazebo [ amd64 ] < none -> 2.2.0-0trusty-20150704-1259-+0000 > ( misc ) Considering ros-indigo-turtlebot-gazebo:amd64 -1 as a solution to ros-indigo-turtlebot-simulator:amd64 9998 Done ros-indigo-kobuki-ftdi is already the newest version. ros-indigo-kobuki-ftdi set to manually installed. ros-indigo-turtlebot is already the newest version. ros-indigo-turtlebot-apps is already the newest version. Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: ros-indigo-turtlebot-simulator : Depends: ros-indigo-turtlebot-gazebo but it is not going to be installed E: Unable to correct problems, you have held broken packages.I did however find a workaround and was able to get round the above issues. I first ran:
sudo apt-get install libsdformat1Then
sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgsand that worked without any issues. I even ran the Gazebo Turtlebot and Teleop tutorials and everything seems to run fine.
↧
↧
Best way to add/use directories inside of /msg?
I've been struggling with this for a few days now, and I can't seem to find any answers involving this. I'm working with a relatively large project with hundreds of messages, and there's no way it's reasonable to just put them all in the base msg directory. However, I can't find any reasonable way to implement multiple directories which rely on eachother using the catkin build system/default CMake macros given. I'd rather not have to create many packages containing only messages, it seems like creating a hierarchy would be difficult that way and it doesn't make sense.
↧
CMakeLists.txt vs package.xml
Hi all,
I have been using ROS for a bit more than a year now and there is still something I cannot understand in the relation between the CMakeLists.txt used and the extra catkin-specific information added by package.xml.
For a package all the link-time and run-time dependencies are already described inside the CMakeLists.txt, so why do we need to re-state these dependencies inside the package.xml? Firstly the information seems redundant and secondly when is the information inside package.xml used? What is it used for?
I have looked for the information on the net but no explanation was clear to me.
Thanks,
Antoine.
↧
library dependencies
I have a catkin library that I'm trying to edit the CMakeLists.txt file for so it builds a package containing services before it compiles the package.
I just learned that in order to do this for a regular package of executables, you use the `add_dependencies()` keywords in Cmake. How do you go about doing this for a library?
cmake_minimum_required(VERSION 2.8.3)
project(baxter_kinematics)
find_package(cmake_modules REQUIRED)
find_package(Eigen REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
sensor_msgs
tf
cwru_srv
)
include_directories(
${Eigen_INCLUDE_DIRS}
${PROJECT_NAME}/include
)
add_definitions(${EIGEN_DEFINITIONS})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp std_msgs sensor_msgs tf baxter_core_msgs cwru_srv
DEPENDS eigen system_lib
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_library(
${PROJECT_NAME}
src/baxter_kinematics.cpp
)
## Declare a cpp executable
add_executable(baxter_kinematics_test_main src/baxter_kinematics_test_main.cpp)
target_link_libraries(baxter_kinematics_test_main baxter_kinematics ${catkin_LIBRARIES})
## ???
## add_dependencies(baxter_kinematics cwru_srv)
↧
Help! Cannot install Ros because of this.
The following packages have unmet dependencies:
libgl1-mesa-dev-lts-utopic : Depends: mesa-common-dev-lts-utopic (= 10.3.2-0ubuntu1~trusty2) but it is not going to be installed
Depends: libgl1-mesa-glx-lts-utopic (= 10.3.2-0ubuntu1~trusty2) but it is not going to be installed
unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
Depends: libcheese7 (>= 3.0.1) but it is not going to be installed
↧
↧
Is test_depend actually used for anything?
Under catkin (in hydro), package.xml files can have "test_depend" entries. This seems like a good idea, as sometimes our tests have dependencies that the rest of our code does not have. HOWEVER, I can't see any way that those test_depend entries are actually used or referenced by the catkin build machinery or rosdep or anything. Are they just there to be informative to developers who want to run tests? Or does catkin actually download and install those dependencies when you type "catkin run_tests"? Or do those dependencies get installed when you use "rosdep install"?
I see in the documentation http://wiki.ros.org/catkin/package.xml and http://wiki.ros.org/catkin/conceptual_overview#Dependency_Management specifics on *when* one should declare test_depend-encies, but I don't see any mention of what is actually done with them. What are the consequences of putting them in? Leaving them out?
Is this a feature that is yet to be implemented, or is it implemented and not documented? Or do I just need help finding the docs?
(The motivation for this question is that I'm trying to automate the running of tests with Travis, and my package has some test_dependencies which are not build_dependencies, and I want to make sure the test script installs the test dependencies, since Travis runs essentially on a blank machine every time.)
Thanks!
↧
gazebo_ros missing(indigo 14.04)
Hi everyone,I'm using indigo on Ubuntu 14.04 LTS.
i have installed **indigo full desktop** version,deleted **Gazebo Ver 2** and installed **Gazebo Ver 6.1.0** from the gazebosim website.
i am now trying to launch a xacro model in gazebo, and the following error occurs:
edmond@edmond:~$ roslaunch myrobot_gazebo gazebo.launch
... logging to /home/edmond/.ros/log/a1af2d0c-aa3e-11e5-9405-c81f662b396f/roslaunch-edmond-4794.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.
Traceback (most recent call last):
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307, in main
p.start()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start
self._start_infrastructure()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 217, in _start_infrastructure
self._load_config()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 132, in _load_config
roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
loader.load(f, config, verbose=verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 730, in load
self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 702, in _load_launch
self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 666, in _recurse_load
val = self._include_tag(tag, context, ros_config, default_machine, is_core, verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
return f(*args, **kwds)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 587, in _include_tag
inc_filename = self.resolve_args(tag.attributes['file'].value, context)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 183, in resolve_args
return substitution_args.resolve_args(args, context=context.resolve_dict, resolve_anon=self.resolve_anon)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 312, in resolve_args
resolved = _resolve_args(resolved, context, resolve_anon, commands)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 325, in _resolve_args
resolved = commands[command](resolved, a, args, context)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 141, in _find
source_path_to_packages=source_path_to_packages)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 184, in _find_executable
full_path = _get_executable_path(rp.get_path(args[0]), path)
File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 200, in get_path
raise ResourceNotFound(name, ros_paths=self._ros_paths)
**ResourceNotFound: gazebo_ros**
ROS path [0]=/opt/ros/indigo/share/ros
ROS path [1]=/home/edmond/rosws/src
ROS path [2]=/opt/ros/indigo/share
ROS path [3]=/opt/ros/indigo/stacks
so i tried installing **ros-indigo-gazebo-ros**, but then
edmond@edmond:~$ sudo apt-get install ros-indigo-gazebo-ros
**The following packages have unmet dependencies!:**
ros-indigo-gazebo-ros : Depends: gazebo2 but it is not going to be installed
Depends: libsdformat1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
does anyone has the idea how to fix this problem?
Thanks a lot!
---------
btw, how to edit the format when posting? i can only see the hints for italic,bold, link and image on the right hand side..thanks again!
↧
eclipse and catkin_make not linking to ros.h dependencies
Hello all,
So I am working on a project where I basically want to create a node to take information from another, check it, then publish that information elsewhere. I was working on it yesterday and my coding environment was working fine(eclipse mars) however at one point yesterday it stopped recognizing all of my references to ros functions or message types. I thought it was just an eclipse specific thing so I tried to run it with catkin_make in my catkin workspace and that threw the same "undefined reference to ros*" errors as the build did in eclipse. Like I said, all was fine and dandy but now it isn't working. Below is the code for the node I am working with.
#include
#include "/opt/ros/indigo/include/ros/ros.h"
#include
#include
#include
#include
/// ROS node name
const std::string ComponentName = "vel_cmd_filter_node";
const std::string J5CommandTopic = "/j5_cmd";
const std::string MoveBaseCmd = "/cmd_vel";
/// default forward linear velocity command in m/s
const float DefaultVelocityCmd = 0.0;
/// default angular velocity command in rad/s
const float DefaultTurnRateCmd = 0.0;
/// the rate at which the component will publish commands
const int LoopRate = 10; // Hz
/// input value limits
/// these are just here for safety and do not reflect the actual limits of the platform
const double MaxVelocityCommand = 3.0;
const double MaxTurnRateCommand = 1.0;
geometry_msgs::Twist incoming;
void chatterCallback(const geometry_msgs::Twist& velcmd);
geometry_msgs::Twist getCommandMsg();
int main(int argc, char **argv) {
// get all command line arguments that aren't ROS specific
// these should be the velocity command parameters
// initialize ROS
std::vector args;
geometry_msgs::Twist velcmd;
ros::init(argc,argv, ComponentName);
ros::removeROSArgs(argc, argv, args);
ros::NodeHandle nh;
ros::Subscriber sub = nh.subscribe(MoveBaseCmd, 1000, chatterCallback);
// velocity command publisher
ros::Publisher velCmdPub = nh.advertise(J5CommandTopic, 1000);
// asynchronous spinner to receive ROS messages
ros::AsyncSpinner spinner(0);
// loop rate used to control the frequency of message publication
ros::Rate loop_rate(LoopRate);
// set up message command
geometry_msgs::Twist cmdMsg = getCommandMsg();
// run loop
spinner.start();
while (ros::ok()) {
// publish velocity command
ROS_INFO("Sending Velocity Command: {%f, %f}", cmdMsg.linear.x,
cmdMsg.angular.z);
if (cmdMsg.linear.x || cmdMsg.angular.z) {
velCmdPub.publish(cmdMsg);
}
ros::spinOnce();
loop_rate.sleep();
}
// shutdown component
spinner.stop();
ros::shutdown();
return 0;
}
void chatterCallback(const geometry_msgs::Twist& velcmd) {
ROS_INFO("I heard this velocity: [%f]", velcmd.linear.x);
ROS_INFO("I heard this rotation: [%f]", velcmd.angular.z);
incoming = velcmd;
}
geometry_msgs::Twist getCommandMsg() {
geometry_msgs::Twist msg;
// body coordinates
// x is forward linear motion
msg.linear.x = DefaultVelocityCmd;
// rotation around the Z axis
msg.angular.z = DefaultTurnRateCmd;
// all other parameters are ignored in the Twist message
// NOTE:: args[0] is the name of the
if (incoming.linear.x) {
try {
msg.linear.x = incoming.linear.x;
msg.linear.x = std::max(msg.linear.x, -MaxVelocityCommand);
msg.linear.x = std::min(msg.linear.x, MaxVelocityCommand);
}
catch (...) {
// could not parse the input, use default value
msg.linear.x = DefaultVelocityCmd;
}
}
if (incoming.angular.z) {
try {
msg.angular.z = incoming.angular.z;
msg.angular.z = std::max(msg.angular.z, -MaxTurnRateCommand);
msg.angular.z = std::min(msg.angular.z, MaxTurnRateCommand);
}
catch (...) {
// could not parse the input, use default value
msg.angular.z = DefaultTurnRateCmd;
}
}
return msg;
}
Sorry about the wonky formatting...I'm still trying to get use to this posting stuff. Please let me know if you need more info! And thanks for the help!!!
Here is my cmake file like requested!
cmake_minimum_required(VERSION 2.8.3)
project(vel_cmd_filter)
find_package(catkin REQUIRED COMPONENTS
j5_msgs
roscpp
rospy
std_msgs
genmsg
)
INCLUDE_DIRS include
LIBRARIES vel_cmd_filter
CATKIN_DEPENDS j5_msgs roscpp rospy std_msgs
DEPENDS system_lib
)
include_directories(
${catkin_INCLUDE_DIRS}
)
add_executable(vel_cmd_filter_node src/vel_cmd_filter_node.cpp)
I went through and deleted all the generated commented out things so you don't have to look at all that garbage. I also switched things around from my original post so I changed it to the most recent code.Thanks!
↧