Skip to content
Snippets Groups Projects
Select Git revision
  • 488988e83354a3198debeff86a7428b495bd1a19
  • master default protected
  • johannes/feature/noetic
3 results

simple_simulation.sh

Blame
  • Forked from CeTI / ROS / panda_gazebo_workspace
    Source project has a limited visibility.
    control_mode.cpp 1.17 KiB
    // Copyright (c) 2017 Franka Emika GmbH
    // Use of this source code is governed by the Apache-2.0 license, see LICENSE
    #include <franka_hw/control_mode.h>
    
    #include <algorithm>
    #include <iterator>
    #include <string>
    #include <vector>
    
    namespace franka_hw {
    
    std::ostream& operator<<(std::ostream& ostream, ControlMode mode) {
      if (mode == ControlMode::None) {
        ostream << "<none>";
      } else {
        std::vector<std::string> names;
        if ((mode & ControlMode::JointTorque) != ControlMode::None) {
          names.emplace_back("JointTorque");
        }
        if ((mode & ControlMode::JointPosition) != ControlMode::None) {
          names.emplace_back("JointPosition");
        }
        if ((mode & ControlMode::JointVelocity) != ControlMode::None) {
          names.emplace_back("JointVelocity");
        }
        if ((mode & ControlMode::CartesianVelocity) != ControlMode::None) {
          names.emplace_back("CartesianVelocity");
        }
        if ((mode & ControlMode::CartesianPose) != ControlMode::None) {
          names.emplace_back("CartesianPose");
        }
        std::copy(names.cbegin(), names.cend() - 1, std::ostream_iterator<std::string>(ostream, ", "));
        ostream << names.back();
      }
      return ostream;
    }
    
    }  // namespace franka_hw