Skip to content

Commit

Permalink
Fixing a bug and making this code work. Consider eliminating it in th…
Browse files Browse the repository at this point in the history
…e future.

Ideally we can just flush json state to the db using the applications-linux
redis sim app. This is mostly superfluous.
  • Loading branch information
samirmenon committed Aug 22, 2016
1 parent a7ecf6e commit a6edf27
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions applications-web/scl_redis_serv_puma/scl_redis_serv_puma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ scl. If not, see <http://www.gnu.org/licenses/>.
#include <scl/parser/sclparser/CParserScl.hpp>
#include <scl/graphics/chai/CGraphicsChai.hpp>
#include <scl/graphics/chai/ChaiGlutHandlers.hpp>
#include <scl/util/DatabaseUtils.hpp>
#include <scl/serialization/SerializationJSON.hpp>

#include <scl/dynamics/scl/CDynamicsScl.hpp>
Expand Down Expand Up @@ -80,7 +79,6 @@ int main(int argc, char** argv)
scl::SGcModel rgcm; //Robot data structure with dynamic quantities...
scl::SRobotIO rio; //I/O data structure
scl::CGraphicsChai rchai; //Chai interface (updates graphics rendering tree etc.)
scl::CDynamicsScl dyn_scl; //Robot physics integrator...
scl_ext::CDynamicsSclSpatial dyn_sp_scl; //Robot physics integrator...
scl::CParserScl p; //This time, we'll parse the tree from a file...

Expand All @@ -98,8 +96,7 @@ int main(int argc, char** argv)
bool flag = p.readRobotFromFile("../../specs/Puma/PumaCfg.xml","../../specs/","PumaBot",rds);
flag = flag && rgcm.init(rds); //Simple way to set up dynamic tree...
flag = flag && dyn_sp_scl.init(rds); //Set up integrator object
flag = flag && dyn_scl.init(rds); //Set up dynamics computation object
flag = flag && rio.init(rds.name_,rds.dof_);
flag = flag && rio.init(rds);
for(unsigned int i=0;i<rds.dof_;++i){ rio.sensors_.q_(i) = rds.rb_tree_.at(i)->joint_default_pos_; }
if(false == flag){ return 1; } //Error check.

Expand Down Expand Up @@ -153,7 +150,7 @@ int main(int argc, char** argv)
if(thread_id==1) //Simulate physics and update the rio data structure..
while(iter < n_iters && true == scl_chai_glut_interface::CChaiGlobals::getData()->chai_glut_running)
{
dyn_sp_scl.integrator(rio,&rgcm,dt); iter++;
dyn_sp_scl.integrate(rgcm,rio,dt); iter++;

sutil::CSystemClock::tick(dt);
/** Slow down sim to real time */
Expand Down

0 comments on commit a6edf27

Please sign in to comment.