Task control parser should accept the SControllerMultiTask data structure

Issue #186 new
Samir Menon repo owner created an issue

It's too annoying to rely on vectors of basic data structures etc.

For instance, we now have:

bool CParserScl::readTaskControllerFromFile(const std::string &arg_file,
      const std::string &arg_ctrl_name,
      std::vector<scl::STaskBase*> &ret_taskvec,
      std::vector<scl::SNonControlTaskBase*> &ret_task_non_ctrl_vec,
      std::vector<scl::sString2> ret_nonstd_params)

This could easily be replaced by:

bool CParserScl::readTaskControllerFromFile(const std::string &arg_file,
      const std::string &arg_ctrl_name, scl::SControllerMultiTask & ret_ctrl);

Simpler and we might as well assume that the multi task controller is a basic implementation. It is a fairly robust implementation and the initial thrust towards being more generic is now just leading to complex and messy parser code.

Finally, the JSON serializer works for this data type anyway. So it's pointless to try and break it down into more basic data..

Comments (2)

  1. Samir Menon reporter

    Some more cruft in the DbRegisterFunctions.cpp (428) file:

          //Now initialize the robot-specific parts.
          // NOTE TODO : Fix the init function to handle the torque filter options. There is some
          // leeway to do this in multiple ways because the parser inits the data structure and
          // then we also call the init function here. Ideally, this should move to the parser..
          flag = ret_ctrl->init(arg_ctrl_name,db->s_parser_.robots_.at(arg_robot_name),
              db->s_io_.io_data_.at(arg_robot_name));
          if(false == flag)
          { throw (std::runtime_error("Could not initialize the controller's data structure."));  }
    
  2. Log in to comment