Skip to content

Commit

Permalink
Merge pull request #1519 from 708yamaguchi/add-m5stack-rosserial-master
Browse files Browse the repository at this point in the history
[jsk_fetch_startup] Add launch to use m5stack sensors via rosserial + bluetooth
  • Loading branch information
k-okada authored Jul 1, 2022
2 parents ffa8970 + be111ef commit f61ee79
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jsk_fetch_robot/jsk_fetch_startup/launch/fetch_bringup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,9 @@
</rosparam>
</node>

<!-- Two robots cannot use one rosserial device at the same time -->
<group if="$(eval hostname == 'fetch1075')">
<include file="$(find jsk_fetch_startup)/launch/fetch_rosserial.launch" />
</group>

</launch>
79 changes: 79 additions & 0 deletions jsk_fetch_robot/jsk_fetch_startup/launch/fetch_rosserial.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<launch>
<!-- The rfcomm device names (e.g. /dev/rfcomm0) corresponds to
the order of /var/lib/robot/rfcomm_devices.yaml -->
<!-- To bind rfcomm devices, https://github.com/jsk-ros-pkg/jsk_robot/pull/1401 is used -->

<!-- The firmwares are https://github.com/jsk-ros-pkg/jsk_3rdparty/pull/289 -->
<!-- Set logger leve to error to supress WARN when the device is not connected -->

<arg name="sgp30_ns" value="sgp30" />
<arg name="pdm_spm1423_ns" value="pdm_spm1423" />
<arg name="mlx90640_ns" value="mlx90640" />
<arg name="unitv_ns" value="unitv" />

<!-- rosseiral via Bluetooth -->
<!-- sgp30 gas sensor -->
<group ns="$(arg sgp30_ns)">
<node pkg="rosserial_python" type="serial_node.py" name="serial_node"
respawn="true" respawn_delay="10">
<rosparam subst_value="true">
port: /dev/rfcomm0
baud: 115200
</rosparam>
</node>
<node pkg="rosservice" type="rosservice" name="set_logger_level"
args="call --wait /$(arg sgp30_ns)/serial_node/set_logger_level 'rosout' 'error'" />
</group>
<!-- pdm_spm1423 microphone -->
<group ns="$(arg pdm_spm1423_ns)">
<node pkg="rosserial_python" type="serial_node.py" name="serial_node"
respawn="true" respawn_delay="10">
<rosparam subst_value="true">
port: /dev/rfcomm1
baud: 115200
</rosparam>
</node>
<node pkg="rosservice" type="rosservice" name="set_logger_level"
args="call --wait /$(arg pdm_spm1423_ns)/serial_node/set_logger_level 'rosout' 'error'" />
</group>
<!-- mlx90640 thermography -->
<group ns="$(arg mlx90640_ns)">
<node pkg="rosserial_python" type="serial_node.py" name="serial_node"
respawn="true" respawn_delay="10">
<rosparam subst_value="true">
port: /dev/rfcomm2
baud: 115200
</rosparam>
</node>
<node pkg="rosservice" type="rosservice" name="set_logger_level"
args="call --wait /$(arg mlx90640_ns)/serial_node/set_logger_level 'rosout' 'error'" />
</group>
<!-- unitv AI camera -->
<group ns="$(arg unitv_ns)">
<node pkg="rosserial_python" type="serial_node.py" name="serial_node"
respawn="true" respawn_delay="10">
<rosparam subst_value="true">
port: /dev/rfcomm3
baud: 115200
</rosparam>
</node>
<node pkg="rosservice" type="rosservice" name="set_logger_level"
args="call --wait /$(arg unitv_ns)/serial_node/set_logger_level 'rosout' 'error'" />
<!-- decompress unitv image -->
<node pkg="image_transport" type="republish" name="republish" args="compressed raw">
<remap from="in" to="unitv_image" />
<remap from="out" to="unitv_image" />
</node>
<!-- draw recognized result on unitv image -->
<node name="draw_rects" pkg="jsk_perception" type="draw_rects">
<remap from="~input" to="unitv_image" />
<remap from="~input/rects" to="unitv_image/rects" />
<remap from="~input/class" to="unitv_image/class" />
<rosparam>
use_classification_result: true
label_size: 0.3
resolution_factor: 2.0
</rosparam>
</node>
</group>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[program:jsk-rfcomm-bind]
command=/bin/bash -c ". /opt/ros/roscore_poststart.bash && . /home/fetch/ros/melodic/devel/setup.bash && roslaunch jsk_robot_startup rfcomm_bind.launch --wait"

stopsignal=TERM
directory=/home/fetch/ros/melodic
autostart=true
autorestart=false
stdout_logfile=/var/log/ros/jsk-rfcomm-bind.log
stderr_logfile=/var/log/ros/jsk-rfcomm-bind.log
user=root
environment=ROSCONSOLE_FORMAT="[${severity}] [${time}] [${node}:${logger}]: ${message}",PYTHONUNBUFFERED=1
priority=200
1 change: 1 addition & 0 deletions jsk_fetch_robot/jsk_fetch_startup/tmuxinator_yaml/log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ windows:
- jsk-dialog: tail -f -n 1000 /var/log/ros/jsk-dialog.log
- jsk-gdrive: tail -f -n 1000 /var/log/ros/jsk-gdrive.log
- jsk-shutdown: tail -f -n 1000 /var/log/ros/jsk-shutdown.log
- jsk-rfcomm-bind: tail -f -n 1000 /var/log/ros/jsk-rfcomm-bind.log

0 comments on commit f61ee79

Please sign in to comment.