libfranka  0.8.0
FCI C++ API
vacuum_gripper.h
Go to the documentation of this file.
1 // Copyright (c) 2019 Franka Emika GmbH
2 // Use of this source code is governed by the Apache-2.0 license, see LICENSE
3 #pragma once
4 
5 #include <chrono>
6 #include <cstdint>
7 #include <memory>
8 #include <string>
9 
11 
17 namespace franka {
18 
19 class Network;
20 
29  public:
33  using ServerVersion = uint16_t;
34 
38  enum class ProductionSetupProfile { kP0, kP1, kP2, kP3 };
39 
48  explicit VacuumGripper(const std::string& franka_address);
49 
55  VacuumGripper(VacuumGripper&& vacuum_gripper) noexcept;
56 
64  VacuumGripper& operator=(VacuumGripper&& vacuum_gripper) noexcept;
65 
69  ~VacuumGripper() noexcept;
70 
83  bool vacuum(uint8_t vacuum,
84  std::chrono::milliseconds timeout,
85  ProductionSetupProfile profile = ProductionSetupProfile::kP0) const;
86 
97  bool dropOff(std::chrono::milliseconds timeout) const;
98 
107  bool stop() const;
108 
118 
124  ServerVersion serverVersion() const noexcept;
125 
127  VacuumGripper(const VacuumGripper&) = delete;
128  VacuumGripper& operator=(const VacuumGripper&) = delete;
130 
131  private:
132  std::unique_ptr<Network> network_;
133 
134  uint16_t ri_version_;
135 };
136 
137 } // namespace franka
ServerVersion serverVersion() const noexcept
Returns the software version reported by the connected server.
VacuumGripper & operator=(VacuumGripper &&vacuum_gripper) noexcept
Move-assigns this VacuumGripper from another VacuumGripper instance.
Maintains a network connection to the vacuum gripper, provides the current vacuum gripper state...
Definition: vacuum_gripper.h:28
bool vacuum(uint8_t vacuum, std::chrono::milliseconds timeout, ProductionSetupProfile profile=ProductionSetupProfile::kP0) const
Vacuums an object.
VacuumGripper(const std::string &franka_address)
Establishes a connection with a vacuum gripper connected to a robot.
uint16_t ServerVersion
Version of the vacuum gripper server.
Definition: vacuum_gripper.h:33
Definition: command_types.h:13
Describes the vacuum gripper state.
Definition: vacuum_gripper_state.h:31
VacuumGripperState readOnce() const
Waits for a vacuum gripper state update and returns it.
bool dropOff(std::chrono::milliseconds timeout) const
Drops the grasped object off.
ProductionSetupProfile
Vacuum production setup profile.
Definition: vacuum_gripper.h:38
bool stop() const
Stops a currently running vacuum gripper vacuum or drop off operation.
~VacuumGripper() noexcept
Closes the connection.
Contains the franka::VacuumGripperState type.