raspberryp4 ros kinetic install

https://blog.csdn.net/sinat_23857245/article/details/45225147

# 编辑 `/etc/apt/sources.list` 文件,删除原文件所有内容,用以下内容取代:
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ buster main non-free contrib
deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ buster main non-free contrib

# 编辑 `/etc/apt/sources.list.d/raspi.list` 文件,删除原文件所有内容,用以下内容取代:
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ buster main ui

Linux下安装Boost1.58

  1. 首先登陆Boost官网(http://www.boost.org/)。

  2. 点击中间download下面的 Version 1.58.0,下载boost_1_58_0.tar.bz2。

  3. 解压下载文件

# tar --bzip2 -xvf boost_1_58_0.tar.bz2

  1. 进入解压后的文件,获得bjam

# cd boost_1_58_0

# ./bootstrap.sh

可以看到在当前目录下生成了bjam文件

  1. 完整编译Boost

# ./bjam

编译时间比较长

  1. 将生成的库默认安装到 /urs/local/lib 目录

# ./bjam install

此时可以看到 /urs/local/lib 目录下包含了很多Boost文件

ROS 中使用 catkin_make 时如果想默认使用支持c++11新特性来编译,而不是在每个 CMakeLists.txt 文件里写进去
sudo vim /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
set(CMAKE_CXX_FLAGS “-std=c++11 ${CMAKE_CXX_FLAGS}”)
std::remove_cv_t 需要用c++14
由于ubuntu18.04安装的ros-melodic使用的是c++14的标准,很多c++11的用法不可支持使用
即便是CMakeLists.txt中添加
add_definitions(-std=c++11)
或者 add_definitions(-std=c++14)
或者 add_definitions(-std=c++17)
都不行!!!!
解决办法:

所有用到
std::random_device()
std::mt19937()
的源文件中都需要包含头文件#include

另外一个解决办法是包含万能的头文件:
#include<bits/stdc++.h>

openwrt系统中,编译代码时用到了sqlite3,里面有std::to_string().错误。 error: ‘to_string’ is not a member of ‘std’

查百度,都说是加上-std=c++11 但是我这个已经加上,还是不行,经过几天的百度,没有解决,最后没办法了。只好GOOGLE(特殊时期), 看了几个帖子以后,问题解决了。由于工具链本身没有使用标准的c++11库,导致编译不了,

解决办法:Cmakelists.txt 需要加上以下几个选项;如果是makefile文件,同样的道理;

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-D_GLIBCXX_USE_C99=1)

If you are using Cmake to compile, add line:

“add_definitions(-std=c++14)”

after find_package command.*********************************************

sudo apt install libogre-1.9-dev libpoco-dev
sudo apt-get install sip-dev pyqt5-dev python-sip-dev pyqt5-dev-tools
sudo apt-get install libfcl-dev
sudo apt install freeglut3 freeglut3-dev

git clone https://github.com/ompl/omplapp.git
cd omplapp
git clone https://github.com/ompl/ompl.git

eigenpy安装 或在github下载源码安装
https://github.com/stack-of-tasks/eigenpy/releases
sudo sh -c “echo ‘deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub buster robotpkg’ >> /etc/apt/sources.list.d/robotpkg.list”
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
sudo apt-get update
sudo apt install robotpkg-py27-eigenpy

安装ros过程中找不到Boost

sudo ./src/catkin/bin/catkin_make_isolated --install -DBOOST_ROOT=/home/pi/boost_1_58_0 -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic

///START setup

sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake

sudo rosdep init
rosdep update

mkdir -p ~/ros_catkin_ws
cd ~/ros_catkin_ws

rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
wstool init src kinetic-ros_comm-wet.rosinstall
(
Desktop: rosinstall_generator desktop --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-wet.rosinstall
wstool init src kinetic-desktop-wet.rosinstall
)

(if wstool init fails or is interrupted, you can resume the download by running:
wstool update -j4 -t src )

mkdir -p ~/ros_catkin_ws/external_src
cd ~/ros_catkin_ws/external_src
wget http://sourceforge.net/projects/assimp/files/assimp-3.1/assimp-3.1.1_no_test_models.zip/download -O assimp-3.1.1_no_test_models.zip
unzip assimp-3.1.1_no_test_models.zip
cd assimp-3.1.1
cmake .
make
sudo make install

cd ~/ros_catkin_ws
rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r --os=debian:buster

sudo ./src/catkin/bin/catkin_make_isolated --install -DBOOST_ROOT=/home/pi/boost_1_58_0 -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic
( compilation will fail with an “internal compiler error” caused by memory exhaustion. A quick fix for this is to add swap space to the Pi and recompile. If the error persists try building with the -j2 option instead of the default -j4 option:

sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_PREFIX_PATH=/home/corvin/eigenpy -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python3=OFF --install-space /opt/ros/kinetic -j2)

sudo catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic
source /opt/ros/kinetic/setup.bash
echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc

/end

Maintaining a Source Checkout
Updating the Workspace
See the Ubuntu source install instructions for steps on updating the ros_catkin_ws workspace. The same steps should apply to the Raspberry Pi.

Adding Released Packages
You may add additional packages to the installed ros workspace that have been released into the ros ecosystem. First, a new rosinstall file must be created including the new packages (Note, this can also be done at the initial install). For example, if we have installed ros_comm, but want to add ros_control and joystick_drivers, the command would be:

$ cd ~/ros_catkin_ws
$ rosinstall_generator nav_msgs actionlib astra_camera astra_launch bfl bond bondcpp tf serial ros_control joystick_drivers --rosdistro kinetic --deps --wet-only --tar > kinetic-custom_ros.rosinstall
You may keep listing as many ROS packages as you’d like separated by spaces.

rosinstall_generator navigation openslam_gmapping roscpp_core bond_core class_loader tf serial ros_control joystick_drivers --rosdistro kinetic --deps --wet-only --tar > kinetic-custom_ros.rosinstall

Next, update the workspace with wstool:

$ wstool merge -t src kinetic-custom_ros.rosinstall
$ wstool update -t src
After updating the workspace, you may want to run rosdep to install any new dependencies that are required:

Raspbian Jessie:

$ rosdep install --from-paths src --ignore-src --rosdistro kinetic -y -r --os=debian:buster
Finally, now that the workspace is up to date and dependencies are satisfied, rebuild the workspace:

$ sudo ./src/catkin/bin/catkin_make_isolated --install -DBOOST_ROOT=/home/pi/boost_1_58_0 -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python3=OFF --install-space /opt/ros/kinetic

/
树莓派4部署ROS

配置源

sudo sh -c ‘echo “deb https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

然后更新一下

sudo apt-get update
sudo apt-get upgrade

安装依赖

sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake

然后初始化一下

sudo rosdep init
rosdep update

编译源码

首先建立工作空间

mkdir -p ~/ros_catkin_ws
cd ~/ros_catkin_ws

然后配置一下安装文件,初始化工作空间,并下载源码

rosinstall_generator desktop rosserial perception joystick_drivers --rosdistro kinetic --deps --wet-only --exclude perception_pcl --tar > kinetic-custom_ros.rosinstall

wstool init src kinetic-custom_ros.rosinstall
#失败或者打断更新
wstool update -t src

为源码添加依赖

rosdep install --from-paths src --ignore-src --rosdistro kinetic -y -r --os=debian:jessie

开始编译

sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic

编译之后添加ROS配置到bash启动项

echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
echo “export EDITOR=‘nano -w’” >> ~/.bashrc

Ubuntu Mate

安装可以按照x64下面的Ubuntu安装,会简单很多。

sudo sh -c ‘echo “deb https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo rosdep init
rosdep update
echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosinstall

1
2
3
4
5
6
7
8
9

问题
问题1:

ros_catkin_ws/src/rospack/include/rospack/rospack.h:108:10: fatal error : boost/tr1/unordered_set.hpp: No such file or directory

1

原因:
tr1已经被boost移除了,且src下的 这个rospack包没有更新这个补丁。

解决办法:
去github下载rospack代替,rospack地址

cd ~/ros_catkin_ws/src/
sudo rm -rf rospack
sudo git clone https://github.com/ros/rospack.git

1
2
3

问题2:

CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find TinyXML2 (missing: TinyXML2_LIBRARY TinyXML2_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/opt/ros/kinetic/share/cmake_modules/cmake/Modules/FindTinyXML2.cmake:65 (find_package_handle_standard_args)
CMakeLists.txt:8 (find_package)

1
2
3
4
5
6
7

解决办法:

sudo apt-get install libtinyxml2-dev

//opencv3
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/home/xxxx/opencv-3.0.0-beta/opencv_contrib-3.0.0-beta/modules/ …

$ cmake -DENABLE_PRECOMPILED_HEADERS=OFF -D CMAKE_BUILD_TYPE=Release -DBUILD_TIFF=ON -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/home/xxxx/opencv-3.0.0-beta/opencv_contrib-3.0.0-beta/modules/ …
要注意opencv_contrib 的路径要对

$ make
$ sudo make install

///

rviz
shared_autonomy_manipulation
catkin
ompl
octomap
xacro
qt_gui_core
teleop_tools
control_msgs
panda_moveit_config
robot_calibration
linux_peripheral_interfaces
camera_info_manager_py
navigation
rqt_robot_steering
ros_environment
urdfdom_py
laser_filters
rqt_reconfigure
perception_pcl
navigation_experimental
navigation_tutorials
moveit_pr2
vrx
rospack
ros
genpy
rosconsole
roscpp_core
python_qt_binding
warehouse_ros_mongo
resource_retriever
realtime_tools
pointcloud_to_laserscan
robot_state_publisher
warehouse_ros
std_msgs
ros_comm_msgs
message_runtime
genmsg
gencpp
actionlib
rqt_robot_monitor
octomap_rviz_plugins
interactive_marker_twist_server
slam_gmapping
openslam_gmapping
moveit
microstrain_3dmgx2_imu
joystick_drivers
laser_assembler
image_pipeline
gazebo_ros_pkgs
roslisp_common
sicktoolbox
sicktoolbox_wrapper
uav_testing
robot_pose_ekf
roswww
rvizweb
driver_common
wifi_ddwrt
ros_realtime
ros_controllers
cmake_modules
rqt_plot
eml
calibration
rosconsole_bridge
ros_tutorials
twist_mux
twist_mux_msgs
bfl
depthimage_to_laserscan
graft
rqt_tf_tree
control_toolbox
imu_pipeline
octomap_mapping
rosdoc_lite
teleop_twist_joy
opencv3
std_capabilities
capabilities
moveit_visual_tools
geometric_shapes
openni2_camera
geometry2
common_msgs
teleop_twist_keyboard
roslisp
rosserial
vmrc
octomap_ros
bond_core
dynamic_reconfigure
openni_camera
ros_control
leap_motion
slam_karto
moveit_resources
convex_decomposition
ivcon
view_controller_msgs
willow_maps
app_manager
pr2_mechanism_msgs
open_karto
sparse_bundle_adjustment
ros_comm
urg_node
simple_grasping
laser_proc
urg_c
sbpl
kdl_parser
usb_cam
interactive_markers
rqt_image_view
rqt_rviz
cartographer_ros
cartographer
rqt_dep
rqt_graph
audio_common
metapackages
ar_track_alvar
rgbd_launch
libg2o
image_transport_plugins
visualization_tutorials
urdf_sim_tutorial
rqt_robot_plugins
rqt_common_plugins
rqt_robot_dashboard
rqt_shell
urdf_tutorial
collada_urdf
geometry
diagnostics
vision_opencv
rqt_runtime_monitor
rqt_nav_view
nodelet_core
class_loader
rqt_top
pluginlib
stage_ros
stage
laser_pipeline
srdfdom
rqt_launch
moveit_msgs
object_recognition_msgs
rqt_moveit
urdf_geometry_parser
executive_smach
urdf
filters
geometry_tutorials
common_tutorials
laser_geometry
media_export
octomap_msgs
image_common
rqt_pose_view
rqt_action
rqt_bag
rqt_srv
rqt_service_caller
rqt_web
rqt_msg
rqt_console
rqt_logger_level
rqt_topic
pcl_msgs
roslint
rqt_publisher
rqt_py_console
rqt
navigation_msgs
joint_state_publisher
random_numbers
eigen_stl_containers
rqt_pr2_dashboard
geometry_angles_utils
webkit_dependency
qwt_dependency
gl_dependency
message_generation
genlisp
rosbag_migration_rule
object_recognition_transparent_objects
ecto_opencv
openni2_launch
fcl
robot_model
iot_bridge
ecto
pr2_common
household_objects_database_msgs
pcl_conversions
openni_launch
scan_tools
csm
object_recognition_core
moveit_metapackages
moveit_robots
object_recognition_ros
manipulation_msgs
moveit_ikfast
moveit_setup_assistant
moveit_ros
moveit_core
object_recognition_ros_visualization
object_recognition_reconstruction
moveit_commander
ecto_pcl
object_recognition_tod
object_recognition_capture
ecto_openni
ecto_image_pipeline
ecto_ros
opencv_candidate
mongo_cxx_driver
humanoid_msgs
ar_track_alvar_msgs
korg_nanokontrol
moveit_plugins
moveit_planners
force_torque_tools
graspit_ros
object_recognition_linemod
smart_battery_msgs
pr2_ethercat_drivers
pocketsphinx
object_recognition_tabletop
libccd
nao_viz
cram_3rdparty
hokuyo_node
household_objects_database
shape_tools
object_recognition_renderer
gperftools_21
rosbag_image_compressor
map_store
rqt_graphprofiler
rosprofiler
pr2_simulator
nao_sensors
ros_topology_msgs
ros_statistics_msgs
urdfdom
urdfdom_headers
console_bridge
opencv2
razer_hydra
rviz_animated_view_controller
rqt_capabilities
rviz_fixed_view_controller
sql_database
cram_core
pr2_mechanism
dynamixel_pro_controller
map_msgs
pr2_controllers
pr2_power_drivers
roslisp_repl
dynamixel_pro_driver
pr2_robot
oculus_rviz_plugins
pcl-fuerte
tf2_web_republisher
oculus_sdk
dynamixel_pro_arm
dynamixel_pro_arm_moveit_config
dynamixel_pro_moveit_controller
pcl
opencv2_doc
openni_tracker
gazebo
rx
reflexxes_type2
depthcloud_encoder
depthcloudjs
ros_web_video
ros_http_video_streamer
flann
interactive_marker_proxy
opencv2-fuerte
swig-wx
urdfdom_headers-fuerte
console_bridge-fuerte
swig-wx-fuerte
flann-fuerte
urdfdom-fuerte
octovis
libccd-fuerte
ompl-fuerte
flirtlib
langs
langs-dev
pr2_controllers_msgs
orocos_kdl
ecto_ros-fuerte
sbpl-fuerte
perception_pcl
interactive_markers
pcl-fuerte-release_defunct
yaml_cpp

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值