机械臂仿真与真机执行代码
应用介绍
此项目是机械臂仿真与真机执行代码。
下面展示小部分代码:
Green_font_prefix="\033[32m"
Red_font_prefix="\033[31m"
Green_background_prefix="\033[42;37m"
Red_background_prefix="\033[41;37m"
Font_color_suffix="\033[0m"
Info="${Green_font_prefix}[Info]${Font_color_suffix}"
Error="${Red_font_prefix}[Error]${Font_color_suffix}"
Tip="${Green_font_prefix}[Warn]${Font_color_suffix}"
OSVersion=$(lsb_release -r --short)
OSDescription=$(lsb_release -d --short)
check_system_version()
{
if [[ "${OSVersion}" == "14.04" ]]; then
ROS_Ver="indigo"
elif [[ "${OSVersion}" == "16.04" ]]; then
ROS_Ver="kinetic"
elif [[ "${OSVersion}" == "18.04" ]]; then
ROS_Ver="melodic"
else
echo -e "${Error} PROBOT don't support ${OSDescription} !" && exit 1
fi
}
check_ros_version()
{
echo -e "${Tip} The system version: ${OSDescription}"
if [ -f "/usr/bin/rosversion" ]; then
ROSVER=`/usr/bin/rosversion -d`
if [ $ROSVER ]; then
echo -e "${Tip} The ROS version: ${ROSVER}"
return
fi
fi
echo -e "${Error} ROS has not installed in this computer, please install ROS with 1."
}
install_ros()
{
if [ -f "/usr/bin/rosversion" ]; then
ROSVER=`/usr/bin/rosversion -d`
if [ $ROSVER ]; then
echo -e "${Tip} The ROS ${ROSVER} has been installed!"
echo && stty erase ^? && read -p "Do you want to continue? y/n:" choose
if [[ "${choose}" == "y" ]]; then
echo -e "${Info}Start to install ROS!"
else
exit
fi
fi
fi
echo -e "${Green_font_prefix}Install ROS ...${Font_color_suffix}"
sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
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 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get -y update
sudo apt-get -y install ros-${ROS_Ver}-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/${ROS_Ver}/setup.bash" >> ~/.bashrc
source /opt/ros/${ROS_Ver}/setup.bash
sudo apt-get -y install python-rosinstall python-rosinstall-generator python-wstool build-essential
echo -e "${Green_font_prefix}ROS has installed finished.${Font_color_suffix}"
}
install_probot_dependents()
{
echo -e "${Green_font_prefix}Install probot dependent packages ...${Font_color_suffix}"
sudo apt-get -y install ros-${ROS_Ver}-moveit-*
sudo apt-get -y install ros-${ROS_Ver}-industrial-*
sudo apt-get -y install ros-${ROS_Ver}-gazebo-ros-control
sudo apt-get -y install ros-${ROS_Ver}-ros-control ros-${ROS_Ver}-ros-controllers
sudo apt-get -y install ros-${ROS_Ver}-trac-ik-kinematics-plugin
sudo apt-get -y install ros-${ROS_Ver}-usb-cam
echo -e "${Green_font_prefix}Dependent packages have installed finished.${Font_color_suffix}"
}
install_probot()
{
echo -e "${Green_font_prefix}Install probot packages ...${Font_color_suffix}"
if [ ! -d ~/probot_anno_ws ]; then
mkdir ~/probot_anno_ws
mkdir ~/probot_anno_ws/src
mkdir ~/probot_anno_ws/src/probot_anno
cp -R * ~/probot_anno_ws/src/probot_anno
chmod +x ~/probot_anno_ws/src/probot_anno/probot_demo/scripts/*
chmod +x ~/probot_anno_ws/src/probot_anno/probot_driver/bin/*
chmod +x ~/probot_anno_ws/src/probot_anno/probot_driver/scripts/*
cd ~/probot_anno_ws
catkin_make
echo "source ~/probot_anno_ws/devel/setup.bash --extend" >> ~/.bashrc
source ~/.bashrc
echo -e "${Green_font_prefix}PROBOT has installed to $(pwd)
Please have a happy journey!${Font_color_suffix}"
else
echo -e "${Red_font_prefix}The probot_anno_ws folder has existed, please delete and reinstall!${Font_color_suffix}"
fi
}
install_all_environment()
{
install_ros
install_probot_dependents
install_probot
}
.........................想了解更多请下载附件
©版权声明:本文内容由互联网用户自发贡献,版权归原创作者所有,本站不拥有所有权,也不承担相关法律责任。如果您发现本站中有涉嫌抄袭的内容,欢迎发送邮件至: [email protected] 进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。
转载请注明出处: apollocode » 机械臂仿真与真机执行代码
文件列表(部分)
名称 | 大小 | 修改日期 |
---|---|---|
install.sh | 1.50 KB | 2020-09-24 |
CMakeLists.txt | 0.44 KB | 2020-03-29 |
ikfast.h | 3.79 KB | 2020-03-29 |
package.xml | 0.99 KB | 2020-03-29 |
probot_anno_manipulator_moveit_ikfast_plugin_description.xml | 0.23 KB | 2020-03-29 |
probot_anno_manipulator_ikfast_moveit_plugin.cpp | 10.87 KB | 2020-03-29 |
probot_anno_manipulator_ikfast_solver.cpp | 34.93 KB | 2020-03-29 |
update_ikfast_plugin.sh | 0.14 KB | 2020-03-29 |
misc.xml | 0.18 KB | 2020-03-29 |
modules.xml | 0.19 KB | 2020-03-29 |
probot_anno_moveit_config.iml | 0.09 KB | 2020-03-29 |
vcs.xml | 0.16 KB | 2020-03-29 |
workspace.xml | 1.36 KB | 2020-03-29 |
.setup_assistant | 0.21 KB | 2020-03-29 |
CMakeCache.txt | 4.80 KB | 2020-03-29 |
CMakeCCompiler.cmake | 0.77 KB | 2020-03-29 |
CMakeCXXCompiler.cmake | 1.32 KB | 2020-03-29 |
CMakeDetermineCompilerABI_C.bin | 2.43 KB | 2020-03-29 |
CMakeDetermineCompilerABI_CXX.bin | 2.43 KB | 2020-03-29 |
CMakeSystem.cmake | 0.16 KB | 2020-03-29 |
a.out | 2.36 KB | 2020-03-29 |
CMakeCCompilerId.c | 3.78 KB | 2020-03-29 |
a.out | 2.37 KB | 2020-03-29 |
CMakeCXXCompilerId.cpp | 3.69 KB | 2020-03-29 |
clion-environment.txt | 0.04 KB | 2020-03-29 |
clion-log.txt | 0.65 KB | 2020-03-29 |
cmake.check_cache | 0.08 KB | 2020-03-29 |
CMakeOutput.log | 3.52 KB | 2020-03-29 |
CMakeLists.txt | 0.21 KB | 2020-03-29 |
chomp_planning.yaml | 0.27 KB | 2020-03-29 |
发表评论 取消回复