Skip to content

Commit

Permalink
Merge pull request #56 from bemilio/retrieve_weight_from_unicycle_patch
Browse files Browse the repository at this point in the history
Added weight retrieval function
  • Loading branch information
GiulioRomualdi committed Mar 26, 2020
2 parents 73b8add + 204a113 commit 8992665
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ All notable changes to this project are documented in this file.
## [Unreleased]
### Added
- Adding the possibility to use Gazebo base data inside the walking controller
- `TrajectoryGenerator` class of the `TrajectoryPlanner` library includes now
the method `getWeightPercentage` to retrieve the amount of weight on each foot
requested by the planner.

### Changed
- Adding the `use_external_robot_base` parameter inside the `dcm_walking_with_joypad.ini`
- Adding the Gazebo base data port inside the `robotControl.ini`
- Tunning the `zmpControllerParams.ini` and `dcmReactiveControllerParams.ini`
- Tunning the `zmpControllerParams.ini` and `dcmReactiveControllerParams.ini`
- Modifying the follwoing classes for geting and using Gazebo base data:
- `/KinDynWrapper/Wrapper`
- `RobotInterface/Helper`
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD 14)

## MAIN project
project(WalkingControllers
VERSION 0.4.101)
VERSION 0.4.102)

# Defines the CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_BINDIR and many other useful macros.
# See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ namespace WalkingControllers
*/
bool getMergePoints(std::vector<size_t>& mergePoints);

/**
* Get the weight percentage for the left and right foot
* @param weightInLeft vector containing the weight on the left foot (0 in case in case of
* stance foot during SS, 1 in case of swing foot)
* @param weightInRight vector containing the weight on the right foot (0 in case in case of
* stance foot during SS, 1 in case of swing foot)
* @return true/false in case of success/failure.
*/
bool getWeightPercentage(std::vector<double> &weightInLeft, std::vector<double> &weightInRight);


/**
* Reset the planner
*/
Expand Down
13 changes: 13 additions & 0 deletions src/TrajectoryPlanner/src/TrajectoryGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,19 @@ bool TrajectoryGenerator::getMergePoints(std::vector<size_t>& mergePoints)
return true;
}

bool TrajectoryGenerator::getWeightPercentage(std::vector<double> &weightInLeft,
std::vector<double> &weightInRight)
{
if(!isTrajectoryComputed())
{
yError() << "[getWeightPercentage] No trajectories are available";
return false;
}

m_dcmGenerator->getWeightPercentage(weightInLeft, weightInRight);
return true;
}

void TrajectoryGenerator::reset()
{
// the mutex is automatically released when lock_guard goes out of its scope
Expand Down

0 comments on commit 8992665

Please sign in to comment.