Dynamixel Hardware Interface

** Dynamixel로 구성된 로봇 팔들을 ROS2 Control을 이용해서 MoveIt2에서 직접 제어**

문제:

안녕하세요, Dynamixel로 연결된 한쪽 팔에 대해서 MoveIt 프레임워크를 통해서 특정 동작 수행을 하려고 하고 있습니다. URDF 모델링 파일과, SRDF 모델링 파일 및 기본 config 설정 파일을 만들어서 Rviz 화면상에서는 모션 플랜과 실행(plan, execute)이 되는 것을 확인할 수 있는데요

실행시 Rviz 화면상이 아닌 실제 로봇에 control 값이 적용 되도록 프로젝트를 구축하고 싶습니다.

대표적으로, ROS2 Control과 Dynamixel Hardware Interface를 이용해서 만들려고 하는데요

매뉴얼을 봐서 어떻게 사용해야 될지 떠오르지 않아서, 이렇게 물어보게 되었습니다.


사용할 DYNAMIXEL 컨트롤러:

  • Dynamixel XM540-W270-T/R - 2개
  • Dynamixel XM430-W350-T/R - 3개

사용할 소프트웨어 인터페이스:

  • MoveIt2
  • ROS2 Controller (ROS2 Humble 버전)
  • Dynamixel Hardware Interface

Hello,

I recommend referring to OpenMANIPULATOR-X:
:point_right: OpenMANIPULATOR-X GitHub Repository

When I created the package, I followed this order:
:one: Description:two: MoveIt Config:three: Bringup (Gazebo → Hardware) → :four: Teleop

From what you’ve mentioned, it seems that you’ve completed the MoveIt Config setup.
I suggest creating the Gazebo and ROS2 Control files inside the description folder and then proceeding with the bringup process.

Let me know if you need further assistance!

Thanks for your kindness.

I checked the ROS2 control files in the Description folder in OpenManipulator-X pkg.

However, based on the code below, it seems that this file is only used in a simulation environment, while I wanna control Dynamixel directly.

<!-- By default, set up controllers for simulation. This won't work on real hardware -->
<plugin>mock_components/GenericSystem</plugin>

Wouldn’t it be a problem to leave this content as it is when controlling Dynamixel hardware using ROS2 Control?

If not, what specific modifications should I make to connect it with the Dynamixel hardware?

혹시 moveit_config 폴더 안에 open_manipulator_x.ros2_control.xacro 이 파일의 내용인가요?

해당 파일은 moveit setup assistant로 생성 할 때 자동 생성된 파일로 bringup 에 사용되지 않습니다.

저희의 ros2_control에 관련한 파일은 다음에서 볼 수 있습니다.


Is this file open_manipulator_x.ros2_control.xacro located inside the moveit_config folder?

That file is automatically generated when using the MoveIt Setup Assistant and is not used for bringup.

Our relevant ros2_control file can be found here:
open_manipulator_x_system.ros2_control.xacro

그렇군요, moveit_config에 있는 파일 맞아요

bringup이랑 관련된 설정 파일(ros2_control 포함)들 조정해주면 될 것 같네요.

감사합니다.

1 Like

위 과정되로,

제가 사용하고 있는 Custom 로봇 팔에 대해서 Dynamixel Hardware를 결합시키는 데 성공했습니다! 따라서, 동기화가 잘 되고 있는데요,

이제 Motion Planning을 위해, Target Value를 Joints로 주면 항상 성공하는 데 반면, Target Value를 End Effector의 Pose로 주면 대부분 실패하게 됩니다.

어떻게 해결해야 될지 감이 잘 잡히지 않는데요, 도움 요청할 수 있을지요?

안녕하세요.
로봇팔이 움직인다니 축하드립니다!

inverse kinematics가 잘 안풀리는 문제에 대해선 kinematics.yaml file 을 수정해보시는것을 추천드립니다.

https://moveit.picknik.ai/humble/doc/examples/kinematics_configuration/kinematics_configuration_tutorial.html

저희가 비슷한 상황일 때 kinematics.yaml 파일 내부 kinematics_solver를 다양한 플러그인들로 수정해 보며 가장 잘 작동하는 것을 선정했습니다. plugin 종류는 외부에서 찾거나 moveit_setup_assistant 에서 planning group 설정할 때 확인하실 수 있습니다.

또 다음 코드처럼 Tolerance를 넉넉히 설정하는것도 도움이 될 수 있습니다.

위 방법들을 시도해보시고 잘되는 다른 방법을 찾으신다면 저희에게도 알려주세요!!
감사합니다.


Hello,
Congratulations on getting the robotic arm to move! :tada:

For issues with inverse kinematics not solving correctly, I recommend modifying the kinematics.yaml file.

:link: Kinematics Configuration Tutorial

When we encountered a similar situation, we experimented with different kinematics_solver plugins inside the kinematics.yaml file and selected the one that worked best.
You can find available plugins externally or check them when setting up the planning group in MoveIt Setup Assistant.

Additionally, increasing the Tolerance value, as shown in the following code, might help:
:link: Example Code - Hello MoveIt

Try these approaches, and if you discover a better solution, please let us know!

Thank you! :blush:

답변 감사합니다 :slight_smile:

여러 방법으로 파라미터를 수정해보고 있는데요 쉽지가 않네요.

target으로 joint values를 넣었을 때 플래닝이 잘 되는 것을 참고해 봤을 때 ompl_planning.yaml 내 파라미터 변경은 상관이 없을까요???

추가로, Rviz에서도 Show Working Space를 보았을 때 2m로 나오는 데 이부분은 단순 Rviz 설정 값일지요


제가 적용한 파라미터 는 다음과 같습니다.

Planner cpp 코드 내

void MotionPlanner::setParameter(){
    // move_group_interface_.setPlannerId("RRTConnect");  // 더 빠른 탐색을 위해 RRTConnect 사용
    
    move_group_interface_.setWorkspace(-10.0, -10.0, -10.0, 10.0, 10.0, 10.0);  
    move_group_interface_.setPlanningTime(10.0);  // 플래닝 시간이 충분한지 확인
    move_group_interface_.setNumPlanningAttempts(100);  // 더 많은 시도를 허용
    move_group_interface_.allowReplanning(true);  // 재계획(Replanning) 활성화
    
    move_group_interface_.setGoalPositionTolerance(0.3);  
    move_group_interface_.setGoalOrientationTolerance(3.14);  
    
}

kinematics.yaml

arm_group:
  kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin
  # kinematics_solver Lists..
  # cached_ik_kinematics_plugin/CachedKDLKinematicsPlugin cached_ik_kinematics_plugin/CachedSrvKinematicsPlugin kdl_kinematics_plugin/KDLKinematicsPlugin lma_kinematics_plugin/LMAKinematicsPlugin prbt_manipulator/IKFastKinematicsPlugin srv_kinematics_plugin/SrvKinematicsPlugin
  kinematics_solver_attempts: 50
  kinematics_solver_search_resolution: 0.05
  kinematics_solver_timeout: 1.0
  position_only_ik: True

ompl_planning.yaml은 변경해본적이 없습니다.

rviz의 show working space는 Openmanipulator_x 인 경우에도 2m로 나오네요.