Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ name walking-coordinator
# height of the com
com_height 0.565
# sampling time
sampling_time 0.01
sampling_time 0.004
# Specify the frame to use to control the robot height. Currently, we support only the following options: com, root_link
height_reference_frame root_link

Expand Down
16 changes: 12 additions & 4 deletions src/WalkingModule/src/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <WalkingControllers/YarpUtilities/Helper.h>
#include <WalkingControllers/StdUtilities/Helper.h>

constexpr std::size_t askNewTrajectoryIndex = 80;

using namespace WalkingControllers;

void WalkingModule::propagateTime()
Expand Down Expand Up @@ -382,6 +384,7 @@ bool WalkingModule::configure(yarp::os::ResourceFinder& rf)
m_profiler->addTimer("MPC");

m_profiler->addTimer("IK");
m_profiler->addTimer("Send Data");
m_profiler->addTimer("Total");

// initialize some variables
Expand Down Expand Up @@ -649,7 +652,7 @@ bool WalkingModule::updateModule()
if(m_newTrajectoryRequired)
{
// when we are near to the merge point the new trajectory is evaluated
if(m_newTrajectoryMergeCounter == 20)
if(m_newTrajectoryMergeCounter == askNewTrajectoryIndex)
{

double initTimeTrajectory;
Expand Down Expand Up @@ -922,6 +925,9 @@ bool WalkingModule::updateModule()
// send data to the logger
if(m_dumpData)
{

m_profiler->setInitTime("Send Data");

iDynTree::Vector2 desiredZMP;
if(m_useMPC)
desiredZMP = m_walkingController->getControllerOutput();
Expand Down Expand Up @@ -1019,6 +1025,8 @@ bool WalkingModule::updateModule()

m_loggerPort.write();

m_profiler->setEndTime("Send Data");

}

// in the approaching phase the robot should not move and the trajectories should not advance
Expand Down Expand Up @@ -1534,13 +1542,13 @@ bool WalkingModule::setPlannerInput(double x, double y)
return true;

// Since the evaluation of a new trajectory takes time the new trajectory will be merged after x cycles
m_newTrajectoryMergeCounter = 20;
m_newTrajectoryMergeCounter = askNewTrajectoryIndex;
}

// the trajectory was not finished the new trajectory will be attached at the next merge point
else
{
if(m_mergePoints.front() > 20)
if(m_mergePoints.front() > askNewTrajectoryIndex)
m_newTrajectoryMergeCounter = m_mergePoints.front();
else if(m_mergePoints.size() > 1)
{
Expand All @@ -1554,7 +1562,7 @@ bool WalkingModule::setPlannerInput(double x, double y)
if(m_newTrajectoryRequired)
return true;

m_newTrajectoryMergeCounter = 20;
m_newTrajectoryMergeCounter = askNewTrajectoryIndex;
}
}

Expand Down