Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS 2:電流制御モードへの対応 #170

Open
ShotaAk opened this issue Jan 17, 2023 · 0 comments
Open

ROS 2:電流制御モードへの対応 #170

ShotaAk opened this issue Jan 17, 2023 · 0 comments
Labels

Comments

@ShotaAk
Copy link
Collaborator

ShotaAk commented Jan 17, 2023

現状の問題点

ROS 2パッケージはサーボモータの位置制御モードにしか対応していません。

改善案

電流制御モードへ対応させるために下記のファイルに変更が必要です。

effortのコマンドインタフェースの追加

std::vector<hardware_interface::CommandInterface>
CraneX7Hardware::export_command_interfaces()
{
std::vector<hardware_interface::CommandInterface> command_interfaces;
for (std::size_t i = 0; i < info_.joints.size(); i++) {
command_interfaces.emplace_back(
hardware_interface::CommandInterface(
info_.joints[i].name, hardware_interface::HW_IF_POSITION, &hw_position_commands_[i]));
}
return command_interfaces;
}

crane_x7_descriptionにも変更が必要です。

https://github.com/rt-net/crane_x7_description/blob/73cd53f70acb7c14a14099a77a28b7a9c2cb3fae/urdf/crane_x7.ros2_control.xacro#L47-L56

effort -> currentの変換および電流値の書き込み

hardware_->set_positions(GROUP_NAME, hw_position_commands_);

RT_Manipulators_library用のパラメータ変更

sync_writeとサーボモータのOperating Modeの変更

sync_write:
- position
joint1: { id: 2, dynamixel: "XM430", operating_mode: 3 }
joint2: { id: 3, dynamixel: "XM540", operating_mode: 3 }
joint3: { id: 4, dynamixel: "XM430", operating_mode: 3 }
joint4: { id: 5, dynamixel: "XM430", operating_mode: 3 }
joint5: { id: 6, dynamixel: "XM430", operating_mode: 3 }
joint6: { id: 7, dynamixel: "XM430", operating_mode: 3 }
joint7: { id: 8, dynamixel: "XM430", operating_mode: 3 }
joint_hand: { id: 9, dynamixel: "XM430", operating_mode: 3 }

コントローラの変更

どのコントローラを使用するのかはアプリケーションに依存します

https://github.com/rt-net/crane_x7_ros/blob/ros2/crane_x7_control/config/crane_x7_controllers.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant