-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add ROSControlItem #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コードレビューしました.
動作確認は追って行います. 動作確認もできました.
C++をROSのスタイルに合わせるのであれば,ご修正の際にclang-format等フォーマッタ通してもらうといいのかなと思いました.よろしくお願いします.
controller_manager | ||
control_toolbox | ||
pluginlib | ||
hardware_interface | ||
transmission_interface | ||
joint_limits_interface | ||
urdf | ||
angles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
長期手なメンテナンス性の視点から,既存パッケージ含めアルファベット順に整理していただいた方が良いかと思いました.
<depend>controller_manager</depend> | ||
<depend>control_toolbox</depend> | ||
<depend>pluginlib</depend> | ||
<depend>hardware_interface</depend> | ||
<depend>transmission_interface</depend> | ||
<depend>joint_limits_interface</depend> | ||
<depend>urdf</depend> | ||
<depend>angles</depend> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMakeと同じく既存パッケージ含めアルファベット順に整理していただいた方が良いかと思いました.
virtual bool start(void) override; | ||
virtual void input(void) override; | ||
virtual bool control(void) override; | ||
virtual void output(void) override; | ||
virtual void stop(void) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++なのでvoid引数は不要かと思います.
他の関数含めまとめて削除をお願いします.
|
||
ros::NodeHandle nh_; | ||
std::shared_ptr<pluginlib::ClassLoader<hardware_interface::RobotHWSim<cnoid::ControllerIO*>>> rbt_hw_sim_loader_; | ||
boost::shared_ptr<hardware_interface::RobotHWSim<cnoid::ControllerIO*>> rbt_hw_sim_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boost::shared_ptr
を使っている理由がplugin_libの問題である旨一言コメント入れておいていただければと思います.
@@ -0,0 +1,375 @@ | |||
///////////////////////////////// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
既存ファイルのことを鑑み,ファイル名のキャメルケース化をご検討いただければと思います.
#define HARDWARE_INTERFACE_ROBOT_HW_CNOID_H | ||
|
||
// ROS // | ||
#include <control_toolbox/pid.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
必須ではないですが,欲を言えばinclusion order揃っていると嬉しいです.
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
cnoid::ControllerIO* io_; | ||
|
||
// transmissions // | ||
std::vector<transmission_interface::TransmissionInfo> tmss_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この変数名はわかりづらい気がします……
joint_limits_interface::EffortJointSaturationInterface ej_sat_if_; | ||
joint_limits_interface::EffortJointSoftLimitsInterface ej_lim_if_; | ||
|
||
uint dof_{0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint
はC++の仕様にはないので,unsigned int
に書き換えてください.
return true; | ||
} | ||
|
||
bool RobotHWCnoid::registerJointLimits(const uint& i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint
-> unsigned int
ちなみにbringupがtypoなので正しくは↓ですね. roslaunch cnoid_tank_bringup choreonoid.launch |
@RyodoTanaka さん、@ssr-yuki さん、ありがとうございます。 |
ControllerItem を利用した ROS Control の実装を行いました.
choreonoid/cnoid_tank_pkgs#1
上記 PR に検証方法を記載していますが,こちらにも記しておきます.
よろしくお願いします.
上記コマンドで,ROSControlItem を利用したシミュレーションが起動できます.
その後,別ターミナルにて
で rqt gui を起動した後, Plugins -> Robot Tools -> Joint trajectory controller から動作確認が可能です.
以上,よろしくお願いします.