forked from qiayuanl/legged_control
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reformat legged_common and legged_hw
- Loading branch information
Showing
15 changed files
with
256 additions
and
413 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
legged_common/include/legged_common/hardware_interface/ContactSensorInterface.h
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,35 @@ | ||
// | ||
// Created by qiayuan on 2021/11/5. | ||
// | ||
#pragma once | ||
#include <hardware_interface/internal/hardware_resource_manager.h> | ||
#include <hardware_interface/joint_state_interface.h> | ||
|
||
namespace legged { | ||
class ContactSensorHandle { | ||
public: | ||
ContactSensorHandle() = default; | ||
|
||
ContactSensorHandle(const std::string& name, const bool* is_contact) : name_(name), is_contact_(is_contact) { | ||
if (is_contact == nullptr) { | ||
throw hardware_interface::HardwareInterfaceException("Cannot create handle '" + name + "'. is_contact pointer is null."); | ||
} | ||
} | ||
|
||
std::string getName() const { return name_; } | ||
|
||
bool isContact() const { | ||
assert(is_contact_); | ||
return *is_contact_; | ||
} | ||
|
||
private: | ||
std::string name_; | ||
|
||
const bool* is_contact_ = {nullptr}; | ||
}; | ||
|
||
class ContactSensorInterface | ||
: public hardware_interface::HardwareResourceManager<ContactSensorHandle, hardware_interface::DontClaimResources> {}; | ||
|
||
} // namespace legged |
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
46 changes: 0 additions & 46 deletions
46
legged_common/include/legged_common/hardware_interface/contact_sensor_interface.h
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.