1 #include <hrpModel/ModelLoaderUtil.h> 3 #include <hrpUtil/OnlineViewerUtil.h> 4 #include <hrpModel/OnlineViewerUtil.h> 12 int main(
int argc,
char *argv[])
15 std::cerr <<
"Usage: " << argv[0] <<
"[VRML model] [log file] [-olv] [linkName1:linkNam2 ...]" 22 for (
int i=3;
i<argc;
i++){
23 std::string str = argv[
i];
24 std::string::size_type
pos;
25 if ((pos = str.find(
":")) != std::string::npos){
26 std::string link1 = str.substr(0, pos);
27 std::string link2 = str.substr(pos+1);
28 std::cerr <<
"[" << link1 <<
"],[" << link2 <<
"]" << std::endl;
29 pairs.push_back(std::make_pair(link1, link2));
30 }
else if(str==
"-olv"){
38 std::cerr <<
"Error: failed to load model[" << argv[1] <<
"]" 44 std::cerr << scc.
numOfCheckPairs() <<
" pairs are defined" << std::endl;
46 OpenHRP::OnlineViewer_var olv;
49 olv->load(robot->name().c_str(), argv[1]);
52 OpenHRP::WorldState wstate;
53 wstate.characterPositions.length(1);
56 std::ifstream
ifs(argv[2]);
57 double tm, q[robot->numJoints()];
62 for (
unsigned int i=0;
i<robot->numJoints();
i++){
66 for (
unsigned int i=0;
i<pairs.size();
i++){
67 std::cout << tm <<
" " << pairs[
i].first <<
":" << pairs[
i].second
int main(int argc, char *argv[])
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
boost::shared_ptr< Body > BodyPtr
void setupCharacterPosition(CharacterPosition &characterPosition, BodyPtr body)
int loadBodyFromModelLoader(::World *world, const char *name, const char *url, CosNaming::NamingContext_var cxt)
LinkNamePairList check(const double *q)
std::vector< std::pair< std::string, std::string > > LinkNamePairList
void updateCharacterPosition(CharacterPosition &characterPosition, BodyPtr body)
HRP_UTIL_EXPORT OpenHRP::OnlineViewer_var getOnlineViewer(int argc, char **argv)
unsigned int numOfCheckPairs() const