$ catkin create pkg iiwa_14_r820_robot_control --catkin-deps ros_control ros_controllers
$ catkin build
catkin build 시 에러가 발생하면, iiwa_14_r820_robot_control에서 CMakeLists.txt 파일에서
ros_control, ros_controllers에 대해 주석 처리
cmake_minimum_required(VERSION 3.0.2)
project(iiwa_14_r820_robot_control)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## 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
# ros_control
# ros_controllers
)
...
$ catkin build
$ source ~/.bashrc
컨트롤러에 대한 설정 파일을 만들어줍니다.
iiwa_14_r820_robot_control/config/controllers.yaml
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
arm_controller:
type: position_controllers/JointTrajectoryController
joints:
- a1
- a2
- a3
- a4
- a5
- a6
- a7
constraints:
goal_time: 0.6
stopped_velocity_tolerance: 0.05
a1: {trajectory: 0.1, goal: 0.1}
a2: {trajectory: 0.1, goal: 0.1}
a3: {trajectory: 0.1, goal: 0.1}
a4: {trajectory: 0.1, goal: 0.1}
a5: {trajectory: 0.1, goal: 0.1}
a6: {trajectory: 0.1, goal: 0.1}
a7: {trajectory: 0.1, goal: 0.1}
stop_trajectory_duration: 0.5
state_publish_rate: 50
action_monitor_rate: 10
컨트롤러를 실행하기 위해서 launch 파일을 생성.
iiwa_14_r820_robot_control/launch/bringup_controllers.launch
<launch>
<rosparam file="$(find iiwa_14_r820_robot_control)/config/controllers.yaml" command="load"/>
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="true"
output="screen" args=" joint_state_controller
arm_controller">
</node>
</launch>
이제 로봇을 불러오고,
$ roslaunch iiwa_14_r820_robot_gazebo bringup.launch