Skip to content

Commit

Permalink
Add GPIO section in README
Browse files Browse the repository at this point in the history
  • Loading branch information
munseng-flexiv committed Jan 25, 2024
1 parent 9f9aaeb commit fa037b8
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,17 @@ This project was developed for ROS 2 Foxy (Ubuntu 20.04) and Humble (Ubuntu 22.0
source install/setup.bash
```

**NOTE**: Remember to source the setup file and the workspace whenever a new terminal is opened:

```bash
source /opt/ros/humble/setup.bash
source ~/flexiv_ros2_ws/install/setup.bash
```
> [!NOTE]
> Remember to source the setup file and the workspace whenever a new terminal is opened:
> ```bash
> source /opt/ros/humble/setup.bash
> source ~/flexiv_ros2_ws/install/setup.bash
> ```
## Usage
**NOTE**: the instruction below is only a quick reference, see the [Flexiv ROS 2 Documentation](https://rdk.flexiv.com/manual/ros2_packages.html) for more information.
> [!NOTE]
> The instruction below is only a quick reference, see the [Flexiv ROS 2 Documentation](https://rdk.flexiv.com/manual/ros2_packages.html) for more information.
The prerequisites of using ROS 2 with Flexiv Rizon robot are [enable RDK on the robot server](https://rdk.flexiv.com/manual/getting_started.html#activate-rdk-server) and [establish connection](https://rdk.flexiv.com/manual/getting_started.html#establish-connection) between the workstation PC and the robot.
Expand All @@ -111,13 +112,15 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
ros2 launch flexiv_bringup rizon.launch.py robot_ip:=[robot_ip] local_ip:=[local_ip] rizon_type:=rizon4
```
**NOTE**: To test whether the connection between ROS and the robot is established, you could disable the starting of RViz first by setting the `start_rviz` launch argument to false.
- Test with fake hardware (`ros2_control` capability):
```bash
ros2 launch flexiv_bringup rizon.launch.py robot_ip:=dont-care local_ip:=dont-care use_fake_hardware:=true
```
> [!TIP]
> To test whether the connection between ROS and the robot is established, you could disable the starting of RViz first by setting the `start_rviz` launch argument to false.
2. Publish commands to controllers
- To send the goal position to the controller by using the node from `flexiv_test_nodes`, start the following command in a new terminal:
Expand All @@ -133,8 +136,6 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
ros2 launch flexiv_bringup rizon.launch.py robot_ip:=[robot_ip] local_ip:=[local_ip] robot_controller:=joint_impedance_controller
```
**NOTE**: The command starts the robot in the joint torque mode. In this mode, gravity and friction are compensated **only** for the robot **without** any attached objects (e.g. the gripper, camera).

Open a new terminal and run the launch file:
```bash
Expand All @@ -143,7 +144,11 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
The robot should run a sine-sweep motion with joint impedance control.
**NOTE**: joint impedance control is not supported in fake/simulated hardware.
> [!NOTE]
> The command starts the robot in the joint torque mode. In this mode, gravity and friction are compensated **only** for the robot **without** any attached objects (e.g. the gripper, camera).
> [!NOTE]
> Joint impedance control is not supported in fake/simulated hardware.
### Using MoveIt
Expand All @@ -169,4 +174,15 @@ The robot driver (`rizon.launch.py`) publishes the following feedback states to
- `/force_torque_sensor_broadcaster/wrench`: Force-torque (FT) sensor raw reading in flange frame: $^{flange}F_{raw}$ in force $[N]$ and moment $[Nm]$. The value is 0 if no FT sensor is installed. [[`geometry_msgs/WrenchStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/WrenchStamped.html)]
- `/tcp_pose_broadcaster/tcp_pose`: Measured TCP pose expressed in base frame $^{0}T_{TCP}$ in position $[m]$ and quaternion. [[`geometry_msgs/PoseStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseStamped.html)]
**NOTE**: The topic names of the broadcasters are specified in `flexiv_bringup/config/rizon_controllers.yaml`
> [!NOTE]
> The topic names of the broadcasters are specified in `flexiv_bringup/config/rizon_controllers.yaml`
### GPIO
All digital inputs on the robot control box can be accessed via the ROS topic `/gpio_controller/gpio_inputs`, which publishes the current state of all the 16 digital input ports *(True: port high, false: port low)*.
The digital output ports on the control box can be set by publishing to the topic `/gpio_controller/gpio_outputs`. For example:
```bash
ros2 topic pub /gpio_controller/gpio_outputs flexiv_msgs/msg/GPIOStates "{states: [{pin: 0, state: true}, {pin: 2, state: true}]}"
```

0 comments on commit fa037b8

Please sign in to comment.