-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
150 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
cmake_minimum_required(VERSION 3.0.2) | ||
cmake_minimum_required(VERSION 3.5) | ||
project(mil_pneumatic_actuator) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
message_generation | ||
rospy | ||
) | ||
# Find dependencies | ||
find_package(ament_cmake REQUIRED) | ||
find_package(rosidl_default_generators REQUIRED) | ||
|
||
catkin_python_setup() | ||
# Set C++ standard | ||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
add_service_files( | ||
FILES | ||
SetValve.srv | ||
# Generate ROS interfaces | ||
rosidl_generate_interfaces(${PROJECT_NAME} | ||
"srv/SetValve.srv" | ||
) | ||
|
||
generate_messages() | ||
|
||
catkin_package(CATKIN_DEPENDS message_runtime) | ||
ament_export_dependencies(rosidl_default_runtime) | ||
ament_package() |
94 changes: 43 additions & 51 deletions
94
mil_common/drivers/mil_pneumatic_actuator/launch/example.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,44 @@ | ||
<launch> | ||
<param name="/is_simulation" value="True" /> | ||
<node pkg="mil_pneumatic_actuator" type="pneumatic_actuator_node" name="actuator_driver" output="screen"> | ||
<param name="port" value="/dev/serial/by-id/usb-MIL_Data_Merge_Board_Ports_5_to_8_DMBP58-if00-port0"/> | ||
<rosparam param="actuators"> | ||
# Stores information about each actuator. | ||
# Each actuator can be up to 2 physical valves (such as an extend/retract for a piston) | ||
# Actuators can be of type 'set' (open / close atomically) or 'pulse' (open for a short time, then close) | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from launch.actions import SetParameter | ||
|
||
# Simplest configuration, sets up a 'set' actuator where true opens id 7 and false closes id 7 | ||
my_actuator: 7 | ||
|
||
# Example of a pulse actuator, will open 1 for 1 second then close | ||
torpedo1: | ||
type: 'pulse' | ||
ports: | ||
open_port: | ||
id: 1 | ||
default: 0 | ||
close_port: | ||
id: -1 | ||
default: 0 | ||
pulse_time: 1 | ||
|
||
# Example of a pulse actuator with 2 valves. When pulse, 3 opens and 4 closes, then both switch after 1 second | ||
dropper: | ||
type: 'pulse' | ||
ports: | ||
open_port: | ||
# Drops | ||
id: 3 | ||
default: 0 | ||
close_port: | ||
# Reloads | ||
id: 4 | ||
default: 1 | ||
pulse_time: 1 | ||
|
||
# Example of a 'set 'actuator with 2 valves. When set true, 6 closes and 5 opens. When false, 6 opens and 5 closes. | ||
gripper: | ||
type: 'set' | ||
ports: | ||
open_port: | ||
id: 6 | ||
default: 1 | ||
close_port: | ||
id: 5 | ||
default: 0 | ||
pulse_time: 1 | ||
</rosparam> | ||
</node> | ||
</launch> | ||
def generate_launch_description(): | ||
return LaunchDescription([ | ||
SetParameter(name='/is_simulation', value='True'), | ||
Node( | ||
package='mil_pneumatic_actuator', | ||
executable='pneumatic_actuator_node', | ||
name='actuator_driver', | ||
output='screen', | ||
parameters=[{ | ||
'port': '/dev/serial/by-id/usb-MIL_Data_Merge_Board_Ports_5_to_8_DMBP58-if00-port0', | ||
'actuators': { | ||
'my_actuator': 7, | ||
'torpedo1': { | ||
'type': 'pulse', | ||
'ports': { | ||
'open_port': {'id': 1, 'default': 0}, | ||
'close_port': {'id': -1, 'default': 0} | ||
}, | ||
'pulse_time': 1 | ||
}, | ||
'dropper': { | ||
'type': 'pulse', | ||
'ports': { | ||
'open_port': {'id': 3, 'default': 0}, | ||
'close_port': {'id': 4, 'default': 1} | ||
}, | ||
'pulse_time': 1 | ||
}, | ||
'gripper': { | ||
'type': 'set', | ||
'ports': { | ||
'open_port': {'id': 6, 'default': 1}, | ||
'close_port': {'id': 5, 'default': 0} | ||
}, | ||
'pulse_time': 1 | ||
} | ||
} | ||
}] | ||
) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.