Skip to content

Commit

Permalink
- gazebo bug fixed (when ctrl_module_name_ == "none")
Browse files Browse the repository at this point in the history
  • Loading branch information
ROBOTIS-zerom committed Dec 20, 2018
1 parent 7b7250c commit edde9d2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions robotis_controller/src/robotis_controller/robotis_controller.cpp
Expand Up @@ -1097,13 +1097,26 @@ void RobotisController::process()
}
else if (gazebo_mode_ == true)
{
std_msgs::Float64 joint_msg;

for (auto& dxl_it : robot_->dxls_)
{
std::string joint_name = dxl_it.first;
Dynamixel *dxl = dxl_it.second;
DynamixelState *dxl_state = dxl_it.second->dxl_state_;

if (dxl->ctrl_module_name_ == "none")
{
joint_msg.data = dxl_state->goal_position_;
gazebo_joint_position_pub_[joint_name].publish(joint_msg);
}
}

for (auto module_it = motion_modules_.begin(); module_it != motion_modules_.end(); module_it++)
{
if ((*module_it)->getModuleEnable() == false)
continue;

std_msgs::Float64 joint_msg;

for (auto& dxl_it : robot_->dxls_)
{
std::string joint_name = dxl_it.first;
Expand Down

0 comments on commit edde9d2

Please sign in to comment.