RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

User interface for Atlas controlling #517

Closed junji15 closed 10 years ago

junji15 commented 10 years ago

Hello. I've installed drake and use studentsnopt now. I want to ask few questions about IKtraj.m.

  1. I would like to apply testIKtraj for controlling of Atlas on a simulation. At the moment, I try to run testIKtraj on a gazebo with RosMatlab. But it doesn’t work well now.

・Which kind of user interface do you use to run testIKtraj for Atlas simulation? According to the thesis of MIT team, I guess “MIT DRC Viewer” is used. But if I want to use it, is it needed of any qualifications of members?

・If it’s possible to use testIKtraj on a gazebo with Rosmatlab, could you tell me the brief outline how to apply IKtraj for the simulation?

  1. Now, I use a studentsnopt to run testIKtraj.m When I run testIKtraj, the below message was appeared on Matlab.

    Check IK with WorldFixedPositionConstraint IK mex start to solve the problem Cell contents reference from a non-cell array object.

    Error in WorldFixedPositionConstraint/evalValidTime (line 29) kinsol = kinsol_cell{i};

    Error in MultipleTimeKinematicConstraint/eval (line 29) [c,dc_valid] = evalValidTime(obj,valid_kinsol_cell);

    Error in RigidBodyManipulator/inverseKinBackend>IKtraj_userfun (line 738) [c_i,dc_i]= mt_kc_cell{i}.eval(t_samples(qstart_idx:end),q_samples(:,qstart_idx:end));

    Error in RigidBodyManipulator/inverseKinBackend>@(w)IKtraj_userfun(obj,w,t,t_inbetween,t_samples,st_kc_cell,mt_kc_cell,q_nom,Qa,Qv,Q,velocity_mat,velocity_mat_qd0,velocity_mat_qdf,accel_mat,accel_mat_qd0,accel_mat_qdf,dqInbetweendqknot,dqInbetweendqd0,dqInbetweendqdf,nq,nT,num_inbetween_tSamples,num_qfree,num_qdotfree,nc_array,nG_array,nf_cum,nG_cum,stlpc_nc,mtlpc_nc,qfree_idx,qsc_weights_idx,qstart_idx,qdot0_idx,qdotf_idx,qsc,q0_fixed,qdot0_fixed,ikoptions.fixInitialState) (line 599) SNOPT_USERFUN = @(w) >>IKtraj_userfun(obj,w,t,t_inbetween,t_samples,st_kc_cell,mt_kc_cell,q_nom,...

    Error in snoptUserfun (line 6) [f,G] = SNOPT_USERFUN(x);

    Error in snwrapper (line 11) F = feval(userfun,x);

    Error in snopt (line 144) [x,F,xmul,Fmul,inform] = snoptcmex( solveopt, ...

    Error in RigidBodyManipulator/inverseKinBackend (line 611) [w_sol,F,info] = snopt(w0,xlow,xupp,Flow,Fupp,'snoptUserfun',0,1,A,iAfun,jAvar,iGfun,jGvar);

    Error in RigidBodyManipulator/inverseKinTraj (line 87) [q,qdot,qddot,info,infeasible_constraint]= inverseKinBackend(obj,2,t,q_seed,q_nom,varargin{:},ikoptions);

    Error in testIKtraj>test_IKtraj_userfun (line 265) [xtraj,info,infeasible_constraint] = inverseKinTraj(r,t,q_seed,q_nom,varargin{1:end-1},ikmexoptions);

    Error in testIKtraj (line 162) xtraj = test_IKtraj_userfun(r,t,q_seed_traj,q_nom_traj,kc1{:},kc2{:},kc3,kc4,qsc,kc_fixedPosition,stlpc,ikoptions);

    Error in run (line 63) evalin('caller', [script ';']);

How should I fix this problem? I would appreciate it very much if you could advise me anything. I’m looking forward to your response.

Best regards, Junji Kikuchi

hongkai-dai commented 10 years ago

Hi Junji,

Sorry for my belated reply.

We have not used the RosMATLAB yet. For the visualizer problem, could you run the following code

checkDependency('lcmgl');
p = RigidBodyManipulator([getDrakePath,'/examples/Atlas/urdf/atlas_minimal_contact.urdf'],struct('floating',true));
v = p.constructVisualizer();

If a visualizer pops up, then you can use it for now, this visualizer is called 'BotVisualizer'. I think we will ship our MIT DRC viewer with Drake soon, but you can use BotVisualizer for now.

For the testIKtraj problem, can you make sure that you have drake/systems/plants/constructModelMex.mexa64 file? If you do not have that mex file, then you can run make in drake folder.

RussTedrake commented 10 years ago

Just to add to Hongkai's response, we do have ros matlab wired into drake, but have preferred to use lcm for all of our communications into and out of matlab for atlas.

On Nov 2, 2014, at 1:17 AM, Hongkai Dai notifications@github.com wrote:

Hi Junji,

Sorry for my belated reply.

We have not used the RosMATLAB yet. For the visualizer problem, could you run the following code

checkDependency('lcmgl'); p = RigidBodyManipulator([getDrakePath,'/examples/Atlas/urdf/atlas_minimal_contact.urdf'],struct('floating',true)); v = p.constructVisualizer(); If a visualizer pops up, then you can use it for now, this visualizer is called 'BotVisualizer'. I think we will ship our MIT DRC viewer with Drake soon, but you can use BotVisualizer for now.

For the testIKtraj problem, can you make sure that you have drake/systems/plants/constructModelMex.mexa64 file? If you do not have that mex file, then you can run make in drake folder.

— Reply to this email directly or view it on GitHub.

junji15 commented 10 years ago

Dear Mr. Hongkai-dai , Mr. RussTedrake,

I’m sorry for late replying.

  1. Thank you for your advice. I could use 'BotVisualizer'. I’m looking forward to using MIT DRC viewer.
  2. I found “drake/systems/plants/constructModelMex.mexa64”. But it doesn’t still work. I guess the cause is ”studentsnopt” problem?
  3. Thank you for your advice. I will try to use lcm to connect Atlas and Matlab.

I greatly appreciate for your support.

Best regards, Junji Kikuchi

hongkai-dai commented 10 years ago

Hi Junji,

The testIKtraj error is on me. It uses a MATLAB version of inverseKinTraj, which has not been used for a while (We use C++ version of inverseKinTraj, and that requires a SNOPT shipped with fortran and C code). I will fix the bug. Thanks for finding out the error.

Hongkai