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

Multi-Robot setup and detection #767

Open
wants to merge 14 commits into
base: indigo_dev
Choose a base branch
from
Open
Show file tree
Hide file tree
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
22,718 changes: 22,718 additions & 0 deletions can_filter_chain:

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion cob_bringup/components/cob4_base.launch
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<arg name="can_device" default="can0"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="sim" default="false"/>
<arg name="multi_robot" default="false"/>

<arg name="driver_yaml" default="$(arg pkg_hardware_config)/robots/cob4/config/cob4_base_driver.yaml"/>
<arg name="controller_yaml" default="$(arg pkg_hardware_config)/robots/cob4/config/cob4_base_controller.yaml"/>
Expand All @@ -14,9 +15,9 @@
<arg name="pkg_hardware_config" value="$(arg pkg_hardware_config)"/>
<arg name="driver_yaml" value="$(arg driver_yaml)"/>
<arg name="controller_yaml" value="$(arg controller_yaml)"/>

<arg name="can_device" value="$(arg can_device)"/>

<arg name="multi_robot" value="$(arg multi_robot)" />
<arg name="sim" value="$(arg sim)"/>
</include>
</launch>
2 changes: 2 additions & 0 deletions cob_bringup/components/raw3_base.launch
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="sim" default="false"/>
<arg name="multi_robot" default="false"/>

<arg name="driver_yaml" value="$(arg pkg_hardware_config)/robots/raw3/config/raw3_base_driver.yaml"/>
<arg name="controller_yaml" value="$(arg pkg_hardware_config)/robots/raw3/config/raw3_base_controller.yaml"/>
Expand All @@ -19,6 +20,7 @@
<arg name="stuck_detector_timeout" value="4.0" />
<arg name="stuck_detector_threshold" value="0.5" />

<arg name="multi_robot" value="$(arg multi_robot)"/>
<arg name="sim" value="$(arg sim)"/>
</include>
</launch>
16 changes: 13 additions & 3 deletions cob_bringup/components/ros_control_base.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<arg name="robot"/>
<arg name="driver_yaml"/>
<arg name="controller_yaml"/>
<arg name="multi_robot" default="false"/>

<arg name="can_device" default="can0"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
Expand Down Expand Up @@ -37,9 +38,18 @@
</group>
<node if="$(arg sim)" ns="$(arg component_name)" pkg="cob_helper_tools" type="fake_driver.py" name="fake_driver" cwd="node" respawn="false" output="screen"/>

<group ns="base">
<rosparam command="load" file="$(arg controller_yaml)"/>
<node pkg="controller_manager" type="controller_manager" name="base_controller_spawner" args="spawn joint_state_controller twist_controller odometry_controller" respawn="false" output="screen"/>
<group if="$(arg sim)">
<group ns="base" unless="$(arg multi_robot)">
<rosparam command="load" file="$(arg controller_yaml)"/>
<node pkg="controller_manager" type="controller_manager" name="base_controller_spawner" args="spawn joint_state_controller twist_controller odometry_controller" respawn="false" output="screen"/>
</group>
</group>

<group unless="$(arg sim)">
<group ns="base" if="$(arg multi_robot)">
<rosparam command="load" file="$(arg controller_yaml)"/>
<node pkg="controller_manager" type="controller_manager" name="base_controller_spawner" args="spawn joint_state_controller twist_controller odometry_controller" respawn="false" output="screen"/>
</group>
</group>

<group ns="$(arg component_name)">
Expand Down
6 changes: 5 additions & 1 deletion cob_bringup/robot.launch
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?xml version="1.0"?>
<launch>

<param name="/use_sim_time" value="false"/>
<arg name="sim" default="$(optenv SIMULATION false)"/>
<param name="/use_sim_time" value="$(arg sim)"/>
<arg name="robot" default="$(optenv ROBOT !!NO_ROBOT_SET!!)"/>
<arg name="env-script" default="$(find cob_bringup)/env.sh"/>
<arg name="multi_robot" default="false"/>

<include file="$(find cob_bringup)/robots/$(arg robot).launch">
<arg name="env-script" value="$(arg env-script)"/>
<arg name="sim" value="$(arg sim)" />
<arg name="multi_robot" value="$(arg multi_robot)"/>
</include>

</launch>
8 changes: 7 additions & 1 deletion cob_bringup/robots/cob4-18.launch
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<?xml version="1.0"?>
<launch>

<arg name="sim" default="false"/>
<arg name="env-script" default="$(find cob_bringup)/env.sh"/>
<arg name="multi_robot" default="false"/>

<include file="$(find cob_bringup)/robots/cob4-18.xml">
<arg name="cob4-18-b1" value="cob4-18-b1"/>
<arg unless="$(arg sim)" name="cob4-18-b1" value="cob4-18-b1"/>
<arg if="$(arg sim)" name="cob4-18-b1" value="localhost"/>
<arg name="env-script" value="$(arg env-script)"/>
<arg name="sim" value="$(arg sim)" />
<arg name="multi_robot" value="$(arg multi_robot)" />

</include>

</launch>
3 changes: 2 additions & 1 deletion cob_bringup/robots/cob4-18.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<launch>

<!-- args -->
<arg name="robot" value="cob4-18"/>
<arg name="cob4-18-b1" default="localhost"/>
<arg name="env-script" default="$(find cob_bringup)/env.sh"/>
<arg name="sim" default="false"/>
<arg name="multi_robot" default="false"/>

<!-- upload robot description -->
<include file="$(find cob_hardware_config)/upload_robot.launch">
Expand Down Expand Up @@ -56,6 +56,7 @@
<include file="$(find cob_bringup)/components/cob4_base.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="sim" value="$(arg sim)"/>
<arg name="multi_robot" value="$(arg multi_robot)" />
</include>
<include file="$(find cob_bringup)/drivers/light.launch">
<arg name="robot" value="$(arg robot)"/>
Expand Down
11 changes: 8 additions & 3 deletions cob_bringup/robots/raw3-1.launch
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<?xml version="1.0"?>
<launch>

<arg name="sim" default="false"/>
<arg name="env-script" default="$(find cob_bringup)/env.sh"/>
<arg name="multi_robot" default="false"/>

<include file="$(find cob_bringup)/robots/raw3-1.xml">
<arg name="pc1" value="raw3-1-pc1"/>
<arg name="pc2" value="raw3-1-pc2"/>
<arg name="ur_ip" value="192.168.141.40"/>
<arg unless="$(arg sim)" name="pc1" value="raw3-1-pc1"/>
<arg unless="$(arg sim)" name="pc2" value="raw3-1-pc2"/>
<arg unless="$(arg sim)" name="ur_ip" value="192.168.141.40"/>

<arg name="env-script" value="$(arg env-script)"/>
<arg name="sim" value="$(arg sim)"/>
<arg name="multi_robot" value="$(arg multi_robot)" />
</include>

</launch>
2 changes: 2 additions & 0 deletions cob_bringup/robots/raw3-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<arg name="env-script" default="$(find cob_bringup)/env.sh"/>
<arg name="sim" default="false"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="multi_robot" default="false"/>

<!-- upload robot description -->
<include file="$(find cob_hardware_config)/upload_robot.launch">
Expand Down Expand Up @@ -51,6 +52,7 @@
<arg name="robot" value="$(arg robot)" />
<arg name="can_device" value="can2" />
<arg name="sim" value="$(arg sim)"/>
<arg name="multi_robot" value="$(arg multi_robot)"/>
</include>
<include file="$(find cob_bringup)/components/canopen_generic.launch">
<arg name="robot" value="$(arg robot)"/>
Expand Down
6 changes: 5 additions & 1 deletion cob_bringup/robots/raw3-3.launch
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?xml version="1.0"?>
<launch>

<arg name="sim" default="false"/>
<arg name="env-script" default="$(find cob_bringup)/env.sh"/>
<arg name="multi_robot" default="false"/>

<include file="$(find cob_bringup)/robots/raw3-3.xml">
<arg name="env-script" value="$(arg env-script)"/>
<arg name="sim" value="$(arg sim)"/>
<arg name="multi_robot" value="$(arg multi_robot)" />
</include>

</launch>
</launch>
2 changes: 2 additions & 0 deletions cob_bringup/robots/raw3-3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<arg name="pc2" default="localhost"/>
<arg name="env-script" default="$(find cob_bringup)/env.sh"/>
<arg name="sim" default="false"/>
<arg name="multi_robot" default="false"/>

<!-- upload robot description -->
<include file="$(find cob_hardware_config)/upload_robot.launch">
Expand Down Expand Up @@ -54,6 +55,7 @@
<arg name="robot" value="$(arg robot)" />
<arg name="can_device" value="can0" />
<arg name="sim" value="$(arg sim)"/>
<arg name="multi_robot" value="$(arg multi_robot)"/>
</include>

<!-- start common nodes used in hardware and simulation -->
Expand Down
6 changes: 3 additions & 3 deletions cob_bringup/tools/base_collision_observer.launch
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<!-- start collision velocity filter node-->
<node pkg="cob_collision_velocity_filter" type="collision_velocity_filter" name="collision_velocity_filter" output="screen">
<!-- remap incoming variables -->
<remap from="command_in" to="/base/collision_velocity_filter/command"/>
<remap from="command_in" to="base/collision_velocity_filter/command"/>
<!-- remap outgoing variables -->
<remap from="command" to="/base/twist_mux/command_safe"/>
<remap from="relevant_obstacles" to="/base/collision_velocity_filter/relevant_obstacles"/>
<remap from="command" to="base/twist_mux/command_safe"/>
<remap from="relevant_obstacles" to="base/collision_velocity_filter/relevant_obstacles"/>
<!-- setup costmap -->
<rosparam file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/local_costmap_params.yaml" command="load" ns="anti_collision_costmap"/>
<!-- load parameter file -->
Expand Down
1 change: 0 additions & 1 deletion cob_bringup/tools/battery_monitor.launch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!-- start battery monitor node -->
<node name="battery_monitor" pkg="cob_monitoring" type="battery_monitor.py" respawn="false" output="screen">
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/battery_monitor.yaml"/>
<remap from="power_state" to="/power_state"/>
</node>

</launch>
7 changes: 4 additions & 3 deletions cob_bringup/tools/robot_state_publisher.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

<arg name="robot" default="$(optenv ROBOT !!NO_ROBOT_SET!!)"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="tf_prefix" default=""/>

<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen"/>
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
<param name="tf_prefix" value="$(arg tf_prefix)" />
</node>

<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher" output="screen">
<remap from="robot_description" to="/robot_description"/>
<remap from="joint_states" to="/joint_states"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/joint_state_publisher.yaml"/>
</node>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
scan_filter_chain:
- name: range
type: LaserScanRangeFilter
params:
use_message_range_limits: true
upper_threshold: 29.5
upper_replacement_value: 29.5
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rate: 100 #Hz
source_list: [/base/joint_states]
source_list: [base/joint_states]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rate: 100 #Hz
source_list: [/base/joint_states]
source_list: [base/joint_states]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
scan_filter_chain:
- name: range
type: LaserScanRangeFilter
params:
use_message_range_limits: true
upper_threshold: 29.5
upper_replacement_value: 29.5
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rate: 100 #Hz
source_list: [/base/joint_states, /arm/joint_states, /torso/joint_states]
source_list: [base/joint_states, arm/joint_states, torso/joint_states]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rate: 100 #Hz
source_list: [/base/joint_states]
source_list: [base/joint_states]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ scan_filter_chain:
- name: range
type: LaserScanRangeFilter
params:
use_message_range_limits: false
upper_threshold: 10.0
upper_replacement_value: 10.0
use_message_range_limits: true
upper_threshold: 29.5
upper_replacement_value: 29.5
3 changes: 2 additions & 1 deletion cob_hardware_config/upload_robot.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<launch>

<arg name="robot" default="$(optenv ROBOT !!NO_ROBOT_SET!!)"/>
<arg name="robot_namespace" default=""/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>

<!-- send cob urdf to param server -->
<param name="robot_description" command="$(find xacro)/xacro --inorder '$(arg pkg_hardware_config)/robots/$(arg robot)/urdf/$(arg robot).urdf.xacro'" />
<param name="robot_description" command="$(find xacro)/xacro --inorder '$(arg pkg_hardware_config)/robots/$(arg robot)/urdf/$(arg robot).urdf.xacro' robot_namespace:=$(arg robot_namespace)" />

</launch>