With proper setup, you can treat a group of pressure controllers like one larger device.
You can choose to run one controller, or set up a group of pressure controllers to act as one larger “meta-controller”.
This ROS Package is compatible with both serial and raw USB communication. Serial is limited to roughly 50 Hz communication rate to/from the controllers, whereas raw USB (sometimes called HID) is capable of 300 Hz reliably for this system. For more info about configuring communication protocols, check out the firmware documentation.
ROS conventions are mixed in terms of the correct way to handle user config files interacting with packages. You could just edit the pressure_controller_ros package directly, but that gets messy since that would create a combination of user settings and package source code. Instead, here’s the preferred method to avoid this:
- Create a new package where all your configs are stored
- From within your catkin workspace, go to the source directory
- Make a new package with a name you choose (like “pressure_controller_configs”) that depends on the “pressure_controller_ros” package
- Get back to your workspace directory and run
catkin_maketo build the new package
cd src catkin_create_pkg pressure_controller_configs pressure_controller_ros cd .. catkin_make
- Add the correct config folders
- Go into your new package
- Copy the default config folders from the pressure_control_ros package
cd src/pressure_controller_configs cp -r $(rospack find pressure_controller_ros)/config .
- Make your own launch file referencing the pressure_control_cbt package
- Launch files are located in the launch folder of this package. Take a look there for the arguments you’ll need to pass to each file when you “include” them in your own launch files
- Make the launch directory:
- Make a new launch file to bringup the pressure controllers bringup_pressure.launch
- Note that you can set the “config_package”. Set this to your new package: “pressure_controller_configs”. This tells the startup routine where to look for your config files.
When starting up the pressure controllers, use this new launch file rather than the one in the original package.
roslaunch pressure_controller_configs bringup_pressure.launch profile:=[YOUR PROFILE] hw_profile:=[YOUR HARDWARE PROFILE]
A hardware config file allows you to define several parameters about how your hardware is set up. This takes the form of a yaml file where you define a list of devices, where each entry in the list is a dictionary defining the settings for one pressure controller.
Browse some examples in “pressure_controller_ros” » “config” » “hardware”.
- Native USB (HID) Settings (Only required for devices in HID mode)
- vendor_id (
int) - Vendor ID number (unique to MCU manufacturer)
- product_id (
int) - Product ID number (unique to MCU board type)
- serial_number (
str) - Serial number (unique to each device)
- vendor_id (
- Serial Settings (Only required for devices in serial mode)
- devname (
str) - Device name (ttyACM# or ttyUSB#)
- baudrate (
int) - Baud Rate (standard is 115200 baud)
- devname (
- Common Settings
- num_channels (
int) - Number of control channels the device has
- cmd_spec (
str) - Command specification number to use
- cmd_format (
str) - String format for data to be sent to the controller
- num_channels (
Here’s an example of a hardware config with 2 pressure controllers in HID mode
devices: # The first controller - vendor_id: 5824 product_id: 1158 serial_number: 6467390 num_channels: 8 cmd_spec: '2.1' cmd_format: '%0.2f' # The second controller - vendor_id: 5824 product_id: 1158 serial_number: 5587550 num_channels: 8 cmd_spec: '2.1' cmd_format: '%0.2f'
Here’s an example of a hardware config with 1 pressure controller in serial mode
devices: - devname: /dev/ttyACM0 baudrate: 115200 num_channels: 8 cmd_spec: '2.1' cmd_format: '%0.2f'
To set up device information in your hardware config file, just run a terminal command and copy the information.
- Start a new hardware config file (must be located in the “config” » “hardware” of either this package or your own package)
- Plug one pressure controller in at a time.
- Run a ROS command to get information about USB devices:
rosrun pressure_controller_ros find_hid_devices.py
rosrun pressure_controller_ros find_serial_devices.py
- From the list, find the required device identifiers and copy them into your hardware config.
- Plug in the next pressure controller and repeat steps 2-4.
This ROS driver takes care of the low-level details of coordinating pressure control devices:
- low-level splitting of commands to different controllers
- Synchronizing timers on all controllers
- Stitching data from several controllers back into a single “data” signal (gets published to a ROS topic)
With proper setup, you can treat a group of pressure controllers like one larger device with the combined number of channels.