Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsk_fetch_startup] Enable shutdown selector using filtered relay #1570

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions jsk_fetch_robot/jsk_fetch_startup/launch/fetch_shutdown.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<launch>

<arg name="shutdown_topic" default="/shutdown" doc="Original shutdown topic. When this topic is published, it do shutdown." />
<arg name="shutdown_unchecked_topic" default="/shutdown_unchecked" doc="Unchecked shutdown topic. When battery_state.is_charging is False and this topic is published, shutdown_topic is published and shutdown is executed." />
<arg name="battery_state_topic" default="/battery_state" doc="battery_state_topic. If is_charging is True, the battery is charging." />

<node name="shutdown_selector"
pkg="jsk_topic_tools" type="boolean_node.py"
output="screen"
clear_params="true"
respawn="true" >
<remap from="~input1" to="$(arg battery_state_topic)" />
<remap from="~input2" to="$(arg shutdown_unchecked_topic)" />
<remap from="~output/and" to="/execute_shutdown" />
<rosparam>
number_of_input: 2
input1_condition: "m.is_charging is False"
input2_condition: "(rospy.Time.now() - t).to_sec() &lt; 1.0"
</rosparam>
</node>

<group ns="shutdown_selector" >
<node name="filtered_relay"
pkg="jsk_topic_tools" type="filtered_relay.py"
output="screen"
clear_params="true" >
<remap from="~input" to="/execute_shutdown" />
<remap from="~output" to="$(arg shutdown_topic)" />
<rosparam>
output_type: std_msgs/Empty
import: [std_msgs]
filter: "m.data is True"
</rosparam>
</node>
</group>

</launch>