Class FakeDriver

Inheritance Relationships

Base Type

Class Documentation

class FakeDriver : public robotiq_driver::Driver

This is a fake driver that can be used for testing interactions with the hardware interface or the controller without being connected to the real hardware. At the moment the fake driver is very basic but it can be improved to behave as close as possible to the real hardware. To use this driver you have to enable the following parameter in your hardware interface configuration in the robot URDF.

Param use_dummy:

true

Public Functions

virtual void set_slave_address(uint8_t slave_address) override
virtual bool connect() override

Connect to the gripper serial connection.

virtual void disconnect() override

Disconnect from the gripper serial connection.

virtual void activate() override

Activates the gripper.

Throws:

serial::IOException – on failure to successfully communicate with gripper port

virtual void deactivate() override

Deactivates the gripper.

Throws:

serial::IOException – on failure to successfully communicate with gripper port

virtual void set_gripper_position(uint8_t position) override

Commands the gripper to move to the desired position.

Parameters:

pos – A value between 0x00 (fully open) and 0xFF (fully closed).

virtual uint8_t get_gripper_position() override

Return the current position of the gripper.

Throws:

serial::IOException – on failure to successfully communicate with gripper port

Returns:

uint8_t A value between 0x00 (fully open) and 0xFF (fully closed).

virtual bool gripper_is_moving() override

Returns true if the gripper is currently moving, false otherwise.

virtual void set_speed(uint8_t speed) override

Set the speed of the gripper.

Parameters:

speed – A value between 0x00 (stopped) and 0xFF (full speed).

virtual void set_force(uint8_t force) override

Set how forcefully the gripper opens or closes.

Parameters:

force – A value between 0x00 (no force) or 0xFF (maximum force).