Skip to content

Commit

Permalink
docstring and comments added
Browse files Browse the repository at this point in the history
  • Loading branch information
tcappellari-bdai committed Feb 27, 2025
1 parent ffe1310 commit acc7612
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ class StateStreamingHandler {
*/
void get_joint_states(JointStates& joint_states);
/**
* @brief Get a struct of the current foot states of the robot.
* @brief Save the current foot states of the robot where:
* CONTACT_UNKNOWN 0 Unknown contact. Do not use.
CONTACT_MADE 1 The foot is currently in contact with the ground.
CONTACT_LOST 2 The foot is not in contact with the ground.
*/
void get_foot_states(::bosdyn::api::FootState::Contact& foot_states);

Expand All @@ -97,6 +100,7 @@ class StateStreamingHandler {
std::vector<float> current_position_;
std::vector<float> current_velocity_;
std::vector<float> current_load_;
// store the current foot contact states
::bosdyn::api::FootState::Contact current_foot_state_;
// responsible for ensuring read/writes of joint states do not happen at the same time.
std::mutex mutex_;
Expand Down Expand Up @@ -145,7 +149,6 @@ class SpotHardware : public hardware_interface::SystemInterface {
// The 3 state interfaces are position, velocity, and effort.
static constexpr size_t state_interfaces_per_joint_ = 3;
size_t njoints_;
size_t nfeet_;

// Login info
std::string hostname_;
Expand Down
1 change: 0 additions & 1 deletion spot_hardware_interface/src/spot_hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ void StateStreamingHandler::get_joint_states(JointStates& joint_states) {
void StateStreamingHandler::get_foot_states(::bosdyn::api::FootState::Contact& foot_states) {
// lock so that read/write doesn't happen at the same time
const std::lock_guard<std::mutex> lock(mutex_);
// Fill in members of the joint states stuct passed in by reference.
foot_states = current_foot_state_;
}

Expand Down

0 comments on commit acc7612

Please sign in to comment.