Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Commit dad4180

Browse files
authored
Merge pull request #183 from project-march/fix/log-fatal
Fix/log fatal
2 parents e50b193 + 085ac42 commit dad4180

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

march_hardware/src/EtherCAT/EthercatMaster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void EthercatMaster::monitorSlaveConnection()
197197
if (!ec_slave[slave].state)
198198
{
199199
// TODO(@Tim, @Isha, @Martijn) throw error when it happens multiple times in a short period of time.
200-
ROS_WARN("EtherCAT train lost connection from slave %d onwards", slave);
200+
ROS_WARN_THROTTLE(1, "EtherCAT train lost connection from slave %d onwards", slave);
201201
return;
202202
}
203203
}

march_hardware/src/IMotionCube.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ bool IMotionCube::goToTargetState(IMotionCubeTargetState targetState)
468468
while (!targetState.isReached(this->getStatusWord()))
469469
{
470470
this->setControlWord(targetState.getControlWord());
471-
ROS_INFO_DELAYED_THROTTLE(2, "\tWaiting for '%s': %s", targetState.getDescription().c_str(),
471+
ROS_INFO_DELAYED_THROTTLE(5, "\tWaiting for '%s': %s", targetState.getDescription().c_str(),
472472
std::bitset<16>(this->getStatusWord()).to_string().c_str());
473473
if (targetState.getState() == IMotionCubeTargetState::OPERATION_ENABLED.getState() &&
474474
this->getState(this->getStatusWord()) == IMCState::fault)

march_hardware_interface/src/march_hardware_interface.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ void MarchHardwareInterface::init()
217217
joint.prepareActuation();
218218
}
219219
}
220+
ROS_INFO("Successfully actuated all joints");
220221
}
221222

222223
void MarchHardwareInterface::update(const ros::TimerEvent& e)
@@ -501,6 +502,7 @@ void MarchHardwareInterface::iMotionCubeStateCheck(int joint_index)
501502
errorStream << "Motion Error: " << iMotionCubeState.motionErrorDescription << "(" << iMotionCubeState.motionError
502503
<< ")" << std::endl;
503504

505+
ROS_FATAL("%s", errorStream.str().c_str());
504506
throw std::runtime_error(errorStream.str());
505507
}
506508
}
@@ -512,16 +514,17 @@ void MarchHardwareInterface::outsideLimitsCheck(int joint_index)
512514
if (joint_position_[joint_index] < soft_limits_[joint_index].min_position ||
513515
joint_position_[joint_index] > soft_limits_[joint_index].max_position)
514516
{
515-
ROS_ERROR_THROTTLE(1, "Joint %s is outside of its soft_limits_ (%f, %f). Actual position: %f",
517+
ROS_ERROR_THROTTLE(1, "Joint %s is outside of its soft limits (%f, %f). Actual position: %f",
516518
joint_names_[joint_index].c_str(), soft_limits_[joint_index].min_position,
517519
soft_limits_[joint_index].max_position, joint_position_[joint_index]);
518520

519521
if (joint.canActuate())
520522
{
521523
std::ostringstream errorStream;
522-
errorStream << "Joint " << joint_names_[joint_index].c_str() << " is out of its soft_limits_ ("
524+
errorStream << "Joint " << joint_names_[joint_index].c_str() << " is out of its soft limits ("
523525
<< soft_limits_[joint_index].min_position << ", " << soft_limits_[joint_index].max_position
524526
<< "). Actual position: " << joint_position_[joint_index];
527+
ROS_FATAL("%s", errorStream.str().c_str());
525528
throw ::std::runtime_error(errorStream.str());
526529
}
527530
}

0 commit comments

Comments
 (0)