Skip to content

Commit

Permalink
Merge branch 'develop' into remove-moveit-config
Browse files Browse the repository at this point in the history
  • Loading branch information
fwalch committed Oct 22, 2018
2 parents 6c5f4b9 + 67101cd commit a07f25f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

Requires `libfranka` >= 0.5.0

* Moved `panda_moveit_config` to [`ros-planning`](https://github.com/ros-planning/panda_moveit_config).
* Moved `panda_moveit_config` to [`ros-planning`](https://github.com/ros-planning/panda_moveit_config)
* Publish `robot_mode` in `franka_state_controller`

## 0.6.0 - 2018-08-08

Expand Down
32 changes: 32 additions & 0 deletions franka_control/src/franka_state_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,38 @@ void FrankaStateController::publishFrankaStates(const ros::Time& time) {
publisher_franka_states_.msg_.last_motion_errors =
errorsToMessage(robot_state_.last_motion_errors);

switch (robot_state_.robot_mode) {
case franka::RobotMode::kOther:
publisher_franka_states_.msg_.robot_mode = franka_msgs::FrankaState::ROBOT_MODE_OTHER;
break;

case franka::RobotMode::kIdle:
publisher_franka_states_.msg_.robot_mode = franka_msgs::FrankaState::ROBOT_MODE_IDLE;
break;

case franka::RobotMode::kMove:
publisher_franka_states_.msg_.robot_mode = franka_msgs::FrankaState::ROBOT_MODE_MOVE;
break;

case franka::RobotMode::kGuiding:
publisher_franka_states_.msg_.robot_mode = franka_msgs::FrankaState::ROBOT_MODE_GUIDING;
break;

case franka::RobotMode::kReflex:
publisher_franka_states_.msg_.robot_mode = franka_msgs::FrankaState::ROBOT_MODE_REFLEX;
break;

case franka::RobotMode::kUserStopped:
publisher_franka_states_.msg_.robot_mode =
franka_msgs::FrankaState::ROBOT_MODE_USER_STOPPED;
break;

case franka::RobotMode::kAutomaticErrorRecovery:
publisher_franka_states_.msg_.robot_mode =
franka_msgs::FrankaState::ROBOT_MODE_AUTOMATIC_ERROR_RECOVERY;
break;
}

publisher_franka_states_.msg_.header.seq = sequence_number_;
publisher_franka_states_.msg_.header.stamp = time;
publisher_franka_states_.unlockAndPublish();
Expand Down
2 changes: 1 addition & 1 deletion franka_hw/src/franka_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ bool FrankaHW::prepareSwitch(const std::list<hardware_interface::ControllerInfo>

if (current_control_mode_ != requested_control_mode) {
ROS_INFO_STREAM("FrankaHW: Prepared switching controllers to "
<< requested_control_mode << "with parameters "
<< requested_control_mode << " with parameters "
<< "limit_rate=" << limit_rate << ", cutoff_frequency=" << cutoff_frequency
<< ", internal_controller=" << internal_controller);
current_control_mode_ = requested_control_mode;
Expand Down
8 changes: 8 additions & 0 deletions franka_msgs/msg/FrankaState.msg
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,13 @@ float64[16] O_T_EE_d
float64[16] F_T_EE
float64[16] EE_T_K
float64 time
uint8 ROBOT_MODE_OTHER=0
uint8 ROBOT_MODE_IDLE=1
uint8 ROBOT_MODE_MOVE=2
uint8 ROBOT_MODE_GUIDING=3
uint8 ROBOT_MODE_REFLEX=4
uint8 ROBOT_MODE_USER_STOPPED=5
uint8 ROBOT_MODE_AUTOMATIC_ERROR_RECOVERY=6
uint8 robot_mode
franka_msgs/Errors current_errors
franka_msgs/Errors last_motion_errors

0 comments on commit a07f25f

Please sign in to comment.