-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Lintでdynamixelディレクトリをチェックする * dynamixelクラスを追加し、hardwareクラスに組み込む * ライブラリのREADMEにファイルの説明を追加 * sample01のREADMEのコンフィグファイルにdynamixel情報を追加 * 各コンフィグファイルにDynamixel情報を追加 * ライブラリのバージョンを1.1.0に更新 * includeを修正 * 親ディレクトリのincludeが発生していたため、dynamixelフォルダを削除した * README修正 * ADDR_TORQUE_ENABLEをhardwareから削除 * 使用していない定数を削除
- Loading branch information
Shota Aoki
authored
Mar 16, 2022
1 parent
06e5e17
commit 65bc609
Showing
32 changed files
with
484 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2022 RT Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_BASE_HPP_ | ||
#define RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_BASE_HPP_ | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "hardware_communicator.hpp" | ||
|
||
namespace dynamixel_base { | ||
|
||
using comm_t = std::shared_ptr<hardware_communicator::Communicator>; | ||
|
||
class DynamixelBase { | ||
public: | ||
explicit DynamixelBase(const uint8_t id) : id_(id), name_("base") {} | ||
~DynamixelBase() {} | ||
|
||
uint8_t get_id() const { return id_; } | ||
std::string get_name() const { return name_; } | ||
virtual bool write_torque_enable( | ||
const dynamixel_base::comm_t & comm, const bool enable) { return false; } | ||
|
||
protected: | ||
uint8_t id_; | ||
std::string name_; | ||
}; | ||
|
||
} // namespace dynamixel_base | ||
|
||
#endif // RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_BASE_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2022 RT Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM_HPP_ | ||
#define RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM_HPP_ | ||
|
||
#include "dynamixel_base.hpp" | ||
|
||
namespace dynamixel_xm { | ||
|
||
class DynamixelXM : public dynamixel_base::DynamixelBase { | ||
public: | ||
explicit DynamixelXM(const uint8_t id); | ||
bool write_torque_enable(const dynamixel_base::comm_t & comm, const bool enable); | ||
}; | ||
|
||
} // namespace dynamixel_xm | ||
|
||
#endif // RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2022 RT Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM430_HPP_ | ||
#define RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM430_HPP_ | ||
|
||
#include "dynamixel_xm.hpp" | ||
|
||
namespace dynamixel_xm430 { | ||
|
||
class DynamixelXM430 : public dynamixel_xm::DynamixelXM { | ||
public: | ||
explicit DynamixelXM430(const uint8_t id); | ||
}; | ||
|
||
} // namespace dynamixel_xm430 | ||
|
||
#endif // RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM430_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2022 RT Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM540_HPP_ | ||
#define RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM540_HPP_ | ||
|
||
#include "dynamixel_xm.hpp" | ||
|
||
namespace dynamixel_xm540 { | ||
|
||
class DynamixelXM540 : public dynamixel_xm::DynamixelXM { | ||
public: | ||
explicit DynamixelXM540(const uint8_t id); | ||
}; | ||
|
||
} // namespace dynamixel_xm540 | ||
|
||
#endif // RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM540_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2022 RT Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
|
||
#include "dynamixel_xm.hpp" | ||
|
||
|
||
namespace dynamixel_xm { | ||
|
||
const uint16_t ADDR_TORQUE_ENABLE = 64; | ||
|
||
DynamixelXM::DynamixelXM(const uint8_t id) | ||
: dynamixel_base::DynamixelBase(id) { | ||
name_ = "XM"; | ||
} | ||
|
||
bool DynamixelXM::write_torque_enable(const dynamixel_base::comm_t & comm, const bool enable) { | ||
return comm->write_byte_data(id_, ADDR_TORQUE_ENABLE, enable); | ||
} | ||
|
||
} // namespace dynamixel_xm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2022 RT Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
|
||
#include "dynamixel_xm430.hpp" | ||
|
||
|
||
namespace dynamixel_xm430 { | ||
|
||
DynamixelXM430::DynamixelXM430(const uint8_t id) | ||
: dynamixel_xm::DynamixelXM(id) { | ||
name_ = "XM430"; | ||
} | ||
|
||
} // namespace dynamixel_xm430 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2022 RT Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
|
||
#include "dynamixel_xm540.hpp" | ||
|
||
|
||
namespace dynamixel_xm540 { | ||
|
||
DynamixelXM540::DynamixelXM540(const uint8_t id) | ||
: dynamixel_xm::DynamixelXM(id) { | ||
name_ = "XM540"; | ||
} | ||
|
||
} // namespace dynamixel_xm540 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.