{"action":"created","issue":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/767","labels_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/767/labels{/name}","comments_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/767/comments","events_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/767/events","html_url":"https://github.com/RobotLocomotion/drake/issues/767","id":57804175,"number":767,"title":"Snopt7 problems and external dependencies for ATLAS","user":{"login":"Ahmedatcsir","id":10758924,"avatar_url":"https://avatars.githubusercontent.com/u/10758924?v=3","gravatar_id":"","url":"https://api.github.com/users/Ahmedatcsir","html_url":"https://github.com/Ahmedatcsir","followers_url":"https://api.github.com/users/Ahmedatcsir/followers","following_url":"https://api.github.com/users/Ahmedatcsir/following{/other_user}","gists_url":"https://api.github.com/users/Ahmedatcsir/gists{/gist_id}","starred_url":"https://api.github.com/users/Ahmedatcsir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ahmedatcsir/subscriptions","organizations_url":"https://api.github.com/users/Ahmedatcsir/orgs","repos_url":"https://api.github.com/users/Ahmedatcsir/repos","events_url":"https://api.github.com/users/Ahmedatcsir/events{/privacy}","received_events_url":"https://api.github.com/users/Ahmedatcsir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-16T13:28:01Z","updated_at":"2015-02-18T13:14:42Z","closed_at":null,"body":"Hi\r\n\r\nI'm trying to simulate the ATLAS humanoid on Drake but I can't to get it to work.\r\nI've built the Rgidbody distro (previously got the constructModelMex.mexa64 error), and run some of the other examples without a problem (although I had to set the fortran compiler variable to gfortran in some of the CMakeCache.txt files in the inner folders).\r\n\r\nI've installed snopt7 and am now getting the following error when I try executing runAtlasWalking.\r\n\r\n******************************\r\n>> runAtlasWalking\r\nUndefined function or variable \"A\".\r\n\r\nError in snopt (line 176)\r\n[x,F,inform,xmul,Fmul] = snoptmex( solveopt, x, ...\r\n\r\nError in NonlinearProgram/snopt (line 1377)\r\n        [x_free,objval,exitflag,xmul,Fmul] = snopt(x0_free, ...\r\n\r\nError in NonlinearProgram/solve (line 947)\r\n          [x,objval,exitflag,infeasible_constraint_name] = snopt(obj,x0);\r\n\r\nError in DynamicalSystem/resolveConstraints (line 325)\r\n      [x,~,exitflag,infeasible_constraint_name] = solve(prog,x0);\r\n\r\nError in TimeSteppingRigidBodyManipulator/resolveConstraints (line 901)\r\n      [varargout{:}] = resolveConstraints(obj.manip,x0,varargin{:});\r\n\r\nError in Atlas (line 47)\r\n        obj = obj.setInitialState(obj.resolveConstraints(zeros(obj.getNumStates(),1)));\r\n\r\nError in runAtlasWalking (line 26)\r\nr = Atlas(fullfile(getDrakePath,'examples','Atlas','urdf','atlas_minimal_contact.urdf'),options);\r\n\r\n*****************************\r\n\r\nI got the trial version of snopt7, precompiled mex file. Snopt.m has this definition \"function [x,F,inform,xmul,Fmul] = snopt(x, xlow, xupp, xmul, xstate, Flow, Fupp, Fmul, Fstate, userfun, varargin); there are 4 ways of calling snopt with exaclty 10, 12, 15 and 17 input arguments (from the snopt m file). In NonlinearProgram/snopt (line 1377) \"[x_free,objval,exitflag,xmul,Fmul] = snopt(x0_free, x_lb_free,x_ub_free, lb,ub, 'snoptUserfun',0,1,Avals,iAfun,jAvar,iGfun_free,jGvar_free);\" here you're passing 13 arguments. After a little digging I think you're missing the xmul, xstate, Fmul and Fstate arguments. \r\n\r\nWhat are the correct inputs for these?\r\n\r\nI searched for xmul and Fmul and didn't find it anywhere else in the file, so to see what would happen I set all missing arguments to empty matrices [], and called snopt with all 17 arguments and all in the correct positions. I then got the following error \"Maximum row size of 300 exceeded,\" which is indeed a limitation of the trial version (300*300). Maybe the empty matrices pushes it past its limit? I am not a student and I work at a research institute so I can't get the student edition. Also when I leave out the path to snopt it says the following:\r\n\"Error using RigidBodyManipulator/inverseKinBackend (line 33) inverseKinBackend requires SNOPT. Either try install SNOPT, or try using InverseKinematics (capital case) or InverseKinematicsTrajectory (capital case) and set solver to fmincon or ipopt\". What do I pass to InverseKinematics or InverseKinematicsTrajectory and how do I set the solver to fmincon?\r\n\r\nI have MATLAB's optimization toolbox. Is it possible to get rid of the dependencies on Gurobi which I also have a trial for (which will expire soon and I haven't even tested out the humanoid as yet), as well as snopt (seems like its possible from the above), and only use MATLAB's toolbox for everything? \r\n\r\nI just want to modify the walking algorithms, and implement my own. I don't need speed, high accuracy or high end optimation. What I'm working on is just for simulation and will not be implemented on any real robot. "},"comment":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/comments/74861529","html_url":"https://github.com/RobotLocomotion/drake/issues/767#issuecomment-74861529","issue_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/767","id":74861529,"user":{"login":"Ahmedatcsir","id":10758924,"avatar_url":"https://avatars.githubusercontent.com/u/10758924?v=3","gravatar_id":"","url":"https://api.github.com/users/Ahmedatcsir","html_url":"https://github.com/Ahmedatcsir","followers_url":"https://api.github.com/users/Ahmedatcsir/followers","following_url":"https://api.github.com/users/Ahmedatcsir/following{/other_user}","gists_url":"https://api.github.com/users/Ahmedatcsir/gists{/gist_id}","starred_url":"https://api.github.com/users/Ahmedatcsir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ahmedatcsir/subscriptions","organizations_url":"https://api.github.com/users/Ahmedatcsir/orgs","repos_url":"https://api.github.com/users/Ahmedatcsir/repos","events_url":"https://api.github.com/users/Ahmedatcsir/events{/privacy}","received_events_url":"https://api.github.com/users/Ahmedatcsir/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T13:14:42Z","updated_at":"2015-02-18T13:14:42Z","body":"I stuck the \"NonlinearProgramSnoptmex.mexa64\" file from a precomiled, binary version of Drake into my built version, I also added the OR check for \"NonlinearProgramSnoptmex\" via chechDependency and added obj.which_snopt=1; on the default option.  \r\n\r\nOriginal:\r\nfunction obj = setSolver(obj,solver)\r\n...\r\nelseif(strcmp(solver,'default'))\r\n        if(checkDependency('snopt'))\r\n          obj = obj.setSolver('snopt'); \r\n        elseif  \r\n\r\nmodified:\r\nfunction obj = setSolver(obj,solver)\r\n....\r\nelseif(strcmp(solver,'default'))\r\n        if(checkDependency('snopt') || checkDependency('NonlinearProgramSnoptmex'))\r\n          obj = obj.setSolver('snopt');     \r\n          obj.which_snopt = 1;\r\n        elseif\r\n\r\n\r\nI got past the 300x300 limitation of the Snopt trial, however now I'm getting an incorrect row dimension error ... \r\n\r\n\r\nError using snoptmex\r\njAvar has incorrect row dimension   192.  Should be length   304\r\n\r\nError in snsolve (line 176)\r\n[x,F,inform,xmul,Fmul] = snoptmex( solveopt, x, ...\r\n\r\nError in footstepPlanner.nonlinearCollocation (line 178)\r\n  [xstar, fval, ~, ~, exitflag] = snsolve(x0,xlow,xupp,xmul,xstate,    ...\r\n\r\nError in footstepPlanner.alternatingMIQP (line 37)\r\n  [plan, t] = footstepPlanner.nonlinearCollocation(obj, miqp_plan, weights, goal_pos);\r\n\r\nError in Biped/planFootsteps (line 95)\r\n  [plan, solvertime] = options.method_handle(obj, plan, weights, goal_pos);\r\n\r\nError in runAtlasWalking (line 52)\r\nfootstep_plan = r.planFootsteps(x0(1:nq), goal_pos);  "}}