Skip to content

Commit

Permalink
Retrieve state of the robot instead of command when planning a R2G tr…
Browse files Browse the repository at this point in the history
…ajectory
  • Loading branch information
memnone committed Jul 4, 2016
1 parent f2d1863 commit 5d8b8da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion include/Spam/App/PosePlanner/PosePlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ class PosePlanner : public grasp::Player {
golem::Controller::State dflt = controller->createState();
controller->setToDefault(dflt);

//controller->lookupCommand(time, dflt);
controller->lookupState(time, dflt);
dflt.cvel.setToDefault(info.getJoints());
dflt.cacc.setToDefault(info.getJoints());
Expand Down
2 changes: 1 addition & 1 deletion src/Spam/App/R2GPlanner/R2GPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ void R2GPlanner::perform(const std::string& data, const std::string& item, const
throw Message(Message::LEVEL_ERROR, "Player::perform(): At least two waypoints required");

golem::Controller::State::Seq initTrajectory;
findTrajectory(grasp::Waypoint::lookup(*controller).command, &trajectory.front(), nullptr, SEC_TM_REAL_ZERO, initTrajectory);
findTrajectory(grasp::Waypoint::lookup(*controller).state, &trajectory.front(), nullptr, SEC_TM_REAL_ZERO, initTrajectory);

golem::Controller::State::Seq completeTrajectory = initTrajectory;
completeTrajectory.insert(completeTrajectory.end(), trajectory.begin(), trajectory.end());
Expand Down
7 changes: 3 additions & 4 deletions src/Spam/Demo/FT/FTDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void FTDemo::create(const Desc& desc) {

menuCmdMap.insert(std::make_pair("ZX", [=]() {
// setup initial variables
const Controller::State home = grasp::Waypoint::lookup(*controller).command;
const Controller::State home = lookupState(); // grasp::Waypoint::lookup(*controller).command;

std::string r2gHandlerItemName = "SpamDataR2GTrajectory+SpamDataR2GTrajectoryDemoR2G";
grasp::data::Handler::Map::const_iterator r2gTrjHandlerPtr = handlerMap.find(r2gHandlerItemName);
Expand Down Expand Up @@ -385,17 +385,16 @@ void FTDemo::create(const Desc& desc) {

Controller::State::Seq seq;
if (grasp::to<Data>(dataCurrentPtr)->stratType != Strategy::IR3NE)
r2gtrajectory->createTrajectory(grasp::Waypoint::lookup(*controller).command, seq);
r2gtrajectory->createTrajectory(grasp::Waypoint::lookup(*controller).state, seq);
else
r2gtrajectory->createIGTrajectory(grasp::Waypoint::lookup(*controller).command, seq);
r2gtrajectory->createIGTrajectory(grasp::Waypoint::lookup(*controller).state, seq);

// find global trajectory & perform
R2GPlanner::perform(dataCurrentPtr->first, actionToString(grasp::to<Data>(dataCurrentPtr)->actionType).c_str(), seq, false);

if (contactOccured && grasp::to<Data>(dataCurrentPtr)->stratType != Strategy::ELEMENTARY) {
contactOccured = false;
updateAndResample(dataCurrentPtr);
enableForceReading = false;
++iteration;
continue;
//}
Expand Down

0 comments on commit 5d8b8da

Please sign in to comment.