Skip to content
Snippets Groups Projects
Select Git revision
  • 3c9e734697678c39dc39c2bb6d164b02c4d06822
  • noetic/main default protected
  • noetic/demo/ga-2023-1-motion-grammars
  • demo/ga-2023-1
  • noetic/feature/robotics-festival
  • feature/table-detector
  • ga-demo
  • noetic/feature/tags
  • noetic/feature/collab
  • ccnc-demo
10 results

cell.h

Blame
  • cell.h 931 B
    #ifndef CCF_IMMERSIVE_SORTING_CELL_H_
    #define CCF_IMMERSIVE_SORTING_CELL_H_
    
    #include <Scene.pb.h>
    #include <optional>
    #include <string>
    
    struct Cell
    {
      enum State
      {
        UNDEFINED,
        DISCONNECTED,
        IDLE,
        WORKING
      };
    
      std::string stateString() const
      {
        switch (state)
        {
          case DISCONNECTED:
            return "DISCONNECTED";
          case IDLE:
            return "IDLE";
          case WORKING:
            return "WORKING";
          default:
            return "UNDEFINED";
        }
      }
    
      std::string id;
      Scene scene;
      State state = UNDEFINED;
    
      Cell() = default;
    
      std::string robot() const
      {
        for (const auto& object : scene.objects())
        {
          if (object.type() == Object_Type_ARM)
          {
            return object.id();
          }
        }
        return "<no robot found>";
      }
    
      // one does not copy cells
      Cell(const Cell&) = delete;
      Cell& operator=(const Cell&) = delete;
    };
    
    #endif  // CCF_IMMERSIVE_SORTING_CELL_H_