Skip to content

Commit

Permalink
Issue WPI-AIM#163. Setting activeControllerType to Force.
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanmunawar committed Apr 9, 2022
1 parent b444cc5 commit 1155775
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ambf_framework/afInputDevices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,13 @@ bool afSimulatedDevice::createFromAttribs(afSimulatedDeviceAttribs *a_attribs)
// Since an existing root body is bound to the physical device whose afComm should already be
// running
if(attribs.m_sdeDefined){
std::string simDevName = "simulated_device_" + std::to_string(m_phyDev->m_CCU_Manager->s_inputDeviceCount) + modelName;
m_rootLink->setPassive(false);
m_rootLink->setNamespace(m_rootLink->getNamespace() + "/simulated_device/");
m_rootLink->loadCommunicationPlugin(m_rootLink, a_attribs);
}

// Initialize the default controller to be the force controller
m_rootLink->m_activeControllerType = afControlType::FORCE;
}
else{
cerr << "ERROR! FAILED TO LOAD ROOT LINK FOR MODEL " << attribs.m_modelAttribs.m_filePath.c_str() << endl;
Expand Down
2 changes: 1 addition & 1 deletion ambf_plugins/core/ros_comm_plugin/ObjectCommPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ void afObjectCommunicationPlugin::rigidBodyFetchCommand(afRigidBodyPtr afRBPtr,
// IF THE COMMAND IS OF TYPE FORCE
switch (afCommand.cartesian_cmd_type) {
case ambf_msgs::RigidBodyCmd::TYPE_FORCE:{
afRBPtr->m_activeControllerType = afControlType::FORCE;
afRBPtr->m_activeControllerType = afControlType::FORCE;
if (afRBPtr->m_bulletRigidBody){
force.setValue(afCommand.wrench.force.x,
afCommand.wrench.force.y,
Expand Down

0 comments on commit 1155775

Please sign in to comment.