[ROS] Videos related to control motor in ros

The reason that I want to use ros_controls is visualization and control (inverse kinematic and joint_trajectory_controller) like those videos.

I show some videos related controlling motos in ros.

나는 ros-control을 활용하여 시각화, 그리고 실제 모터들을 상위 레벨에서의 컨트롤을 하고 싶다.

IK 문제를 풀어서,End effector를 목표 좌표로 이동

 


The video below shows displays the angle of each joint of the current robot in rviz (visualization tool).

He is changing the angle of the joint by hand and making sure it reads well.

아래 동영상은 현재 로봇의 각 조인트의 각도를 읽어서 rviz (시각화 툴)에 똑같이 나타낸다.

손으로 조인트의 각도를 변경하고 잘 읽히는지 확인 중이다.

 

The video below is a manual manipulation of the robotic arm using a joint-state-publisher.

The angle is being adjusted at the Slidar bar.

아래 동영상은 joint-state-publisher를 이용하여 로봇 팔을 수동으로 조작하는 것이다.

Slidar bar 에서 각도를 조정중이다.

The video below solved the inverse kinematics problem by using a package called Moveit.

The video shows the motion planner, the actual motion using Moveit.

Moveit이라는 패키지를 활용하여 inverse kinematics 문제를 풀었다.

그리고 motion planner, 실제 움직이는 것까지의 영상이다.

 


arudino-servo로도 가능한 일이다.

https://www.instructables.com/id/ROS-MoveIt-Robotic-Arm-Part-2-Robot-Controller/

https://github.com/cyborg-x1/ros_control_test

https://github.com/ros-controls/ros_control/wiki/hardware_interface

[ROS] What is ros-control

ros-control

http://wiki.ros.org/ros_control

 

  • A set of packages that include controller interfaces, controller managers, transmissions and hardware_interfaces.
  • The ros_control packages are a rewrite of the pr2_mechanism packages to make controllers generic to all robots beyond just the PR2.
  • The ros_control packages takes as input the joint state data from your robot’s actuator’s encoders and an input set point. It uses a generic control loop feedback mechanism, typically a PID controller, to control the output, typically effort, sent to your actuators. ros_control gets more complicated for physical mechanisms that do not have one-to-one mappings of joint positions, efforts, etc but these scenarios are accounted for using transmissions.

 

There are some modules.

  • Controller manager
  • Controller
  • Hardware interface

ros control

<http://wiki.ros.org/ros_control?action=AttachFile&do=get&target=gazebo_ros_control.png>

<http://gazebosim.org/tutorials/?tut=ros_control>

Controller don’t care which module (simulation or hardware) provide data.

Controller needs joint state info and joint command info.

 


Controller

There are many controller on ros-control.

I used joint state_controller and joint_trajectory_controller for head control.

You need to set control parameter (PID gain, velocity_ff, etc.)

In control.yaml, head_controller has two joint (pan_joint and tilt_joint) and make trajectories.

Trajectories are specified as a set of waypoints to be reached at specific time instants, which the controller attempts to execute as well as the mechanism allows. Waypoints consist of positions, and optionally velocities and accelerations.

 


Controller_manager

controller_manager manages some controllers

controller_manager needs to load controllers.

<!– Load joint controller configurations from YAML file to parameter server –>
<rosparam file=”$(find cam_pan_tilt)/config/control.yaml” command=”load”/>

<node name=”controller_spawner” pkg=”controller_manager” type=”spawner” respawn=”false”
output=”screen” ns=”/gretchen” args=”joint_state_controller
head_controller”/>


RQT_GRAPH

 

 


How to connect real robot

need to costruct hardware_inferface

It is hardware_interface example.

  • https://github.com/ros-controls/ros_control/wiki/hardware_interface

ROBOTICS made hardware_interface of dynamixel motor for ros-control.


Example

1) Head Controller

Head controller control pan and tilt. input of the controller is tf, joint_states, head_controller/state

  • tf
    • tf is relationship between frames
    • tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time.

  • joint_states
    • it is raw data from motor controller

  • head_controller/state
    • desired, actual, error check for control
    • it is calculated by controller.

output

  • head_controller/command
    • set radian postion at each joint

2) Other robot

You can easily control the robot manipulator using ros-control and moveit.

3) Simple pan title model

1. User click a point

2. make target_line using the point

Target_line consist of those

  • geometry_msgs/PointStamped target
  • geometry_msgs/Vector3 pointing_axis
  • string pointing_frame
  • duration min_duration
  • float64 max_velocity

3. calculate inverse kinematics for getting joint angles

4. publish angle on each joint

5. move


Why it is need?

Once control part constructed using ros-package.

Perception part focus recognition and just publish u,v.

Reference

  • http://wiki.ros.org/ros_control
  • http://gazebosim.org/tutorials/?tut=ros_control
  • http://wiki.ros.org/joint_trajectory_controller
  • https://pinkwink.kr/1013
  • https://github.com/ros-controls/ros_control/wiki/hardware_interface