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

[WIP] restructure hardware config #655

Closed
Closed
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
2 changes: 1 addition & 1 deletion cob_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(CATKIN_ENABLE_TESTING)
endif()

### INSTALL ###
install(DIRECTORY components controllers drivers robots tools
install(DIRECTORY bundles controllers drivers modules robots tools
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?xml version="1.0"?>
<launch>
<arg name="robot"/>

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

<arg name="driver_yaml" value="$(arg pkg_hardware_config)/robots/common/cob4_base_driver.yaml"/>
<arg name="controller_yaml" value="$(arg pkg_hardware_config)/robots/common/cob4_base_controller.yaml"/>
<arg name="driver_yaml" value="$(arg pkg_hardware_config)/modules/base/common/base_cob4_driver.yaml"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep cob4 prefix before base prefix. what's your rational to change this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we are grouping by module, I'd have the "module" as prefix...grouping the launch files, too

<arg name="controller_yaml" value="$(arg pkg_hardware_config)/modules/base/common/base_cob4_controller.yaml"/>

<include file="$(find cob_bringup)/components/ros_control_base.launch">
<arg name="robot" value="$(arg robot)"/>
<include file="$(find cob_bringup)/bundles/base_ros_control.launch">
<arg name="base" value="$(arg base)"/>
<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)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
<?xml version="1.0"?>
<launch>
<arg name="robot"/>
<arg name="base"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="sim" default="false"/>

<group unless="$(arg sim)">
<include file="$(find cob_bringup)/drivers/base_driver.launch">
<arg name="robot" value="$(arg robot)"/>
</include>
<include file="$(find cob_bringup)/controllers/base_controller.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="base" value="$(arg base)"/>
</include>
<include file="$(find cob_bringup)/controllers/base_controller.launch"/>
</group>
<group if="$(arg sim)">
<include file="$(find cob_bringup)/controllers/base_controller_plugin.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="base" value="$(arg base)"/>
</include>
<node ns="base" pkg="cob_helper_tools" type="fake_driver.py" name="fake_driver" cwd="node" respawn="false" output="screen"/>
</group>

<group ns="base">
<!-- twist mux -->
<include file="$(find cob_bringup)/tools/twist_mux.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="cmd_vel_out" default="velocity_smoother/command"/>
<arg name="marker_out" default="twist_mux/marker"/>
</include>

<!-- velocity smoother -->
<include file="$(find cob_bringup)/tools/velocity_smoother.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="config_file" default="$(arg pkg_hardware_config)/robots/$(arg robot)/config/velocity_smoother.yaml"/>
<arg name="base" value="$(arg base)"/>
<arg name="config_file" default="$(arg pkg_hardware_config)/modules/base/$(arg base)/velocity_smoother.yaml"/>
<arg name="raw_cmd_vel_topic" default="velocity_smoother/command"/>
<arg name="smooth_cmd_vel_topic" default="twist_controller/command"/>
<arg name="robot_cmd_vel_topic" default="twist_controller/command"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?xml version="1.0"?>
<launch>
<arg name="robot"/>
<arg name="base"/>
<arg name="can_device"/>

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

<arg name="driver_yaml" value="$(arg pkg_hardware_config)/robots/common/raw3_base_driver.yaml"/>
<arg name="controller_yaml" value="$(arg pkg_hardware_config)/robots/common/raw3_base_controller.yaml"/>
<arg name="driver_yaml" value="$(arg pkg_hardware_config)/modules/base/common/base_raw3_driver.yaml"/>
<arg name="controller_yaml" value="$(arg pkg_hardware_config)/modules/base/common/base_raw3_controller.yaml"/>

<include file="$(find cob_bringup)/components/ros_control_base.launch">
<arg name="robot" value="$(arg robot)"/>
<include file="$(find cob_bringup)/bundles/base_ros_control.launch">
<arg name="base" value="$(arg base)"/>
<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)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<launch>
<arg name="robot"/>
<arg name="base"/>
<arg name="driver_yaml"/>
<arg name="controller_yaml"/>

Expand All @@ -14,7 +14,8 @@
<arg name="start_external_sync" value="false"/>

<include unless="$(arg sim)" file="$(find cob_bringup)/drivers/canopen_402.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="module" value="$(arg base)"/>
<arg name="module_type" value="base"/>
<arg name="component_name" value="$(arg component_name)"/>
<arg name="can_device" value="$(arg can_device)"/>
<arg name="interval_ms" value="$(arg interval_ms)"/>
Expand All @@ -37,15 +38,14 @@
<group ns="$(arg component_name)">
<!-- twist mux -->
<include file="$(find cob_bringup)/tools/twist_mux.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="cmd_vel_out" default="velocity_smoother/command"/>
<arg name="marker_out" default="twist_mux/marker"/>
</include>

<!-- velocity smoother -->
<include file="$(find cob_bringup)/tools/velocity_smoother.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="config_file" default="$(arg pkg_hardware_config)/robots/$(arg robot)/config/velocity_smoother.yaml"/>
<arg name="base" value="$(arg base)"/>
<arg name="config_file" default="$(arg pkg_hardware_config)/modules/base/$(arg base)/velocity_smoother.yaml"/>
<arg name="raw_cmd_vel_topic" default="velocity_smoother/command"/>
<arg name="smooth_cmd_vel_topic" default="twist_controller/command"/>
<arg name="robot_cmd_vel_topic" default="twist_controller/command"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<launch>
<arg name="robot"/>
<arg name="module"/>
<arg name="module_type"/>
<arg name="component_name"/>

<arg name="can_device"/>
Expand All @@ -12,7 +13,8 @@
<arg name="sim" default="false"/>

<include unless="$(arg sim)" file="$(find cob_bringup)/drivers/canopen_402.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="module" value="$(arg module)"/>
<arg name="module_type" value="$(arg module_type)"/>
<arg name="component_name" value="$(arg component_name)"/>
<arg name="can_device" value="$(arg can_device)"/>
<arg name="interval_ms" value="$(arg interval_ms)"/>
Expand All @@ -22,11 +24,13 @@
<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"/>

<include file="$(find cob_bringup)/controllers/generic_controller.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="module" value="$(arg module)"/>
<arg name="module_type" value="$(arg module_type)"/>
<arg name="component_name" value="$(arg component_name)"/>
</include>
<include if="$(arg cartesian_control)" file="$(find cob_bringup)/controllers/generic_cartesian_controller.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="module" value="$(arg module)"/>
<arg name="module_type" value="$(arg module_type)"/>
<arg name="component_name" value="$(arg component_name)"/>
<arg name="debug" value="false"/>
</include>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?xml version="1.0"?>
<launch>
<arg name="robot"/>
<arg name="module"/>
<arg name="module_type" default="gripper"/>
<arg name="component_name"/>
<arg name="sim" default="false"/>

<include unless="$(arg sim)" file="$(find cob_bringup)/drivers/schunk_sdhx.launch">
<arg name="component_name" value="$(arg component_name)"/>
</include>
<include if="$(arg sim)" file="$(find cob_bringup)/controllers/generic_controller.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="module" value="$(arg module)"/>
<arg name="module_type" value="$(arg module_type)"/>
<arg name="component_name" value="$(arg component_name)"/>
</include>
</launch>
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
<?xml version="1.0"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still have supported robots using legacy version of schunk components? if not, we can get rid of this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raw3-1 torso is using the legacy schunk_powercube_chain

<launch>
<arg name="robot"/>
<arg name="module"/>
<arg name="module_type"/>
<arg name="component_name"/>
<arg name="sim" default="false"/>

<group unless="$(arg sim)">
<include file="$(find cob_bringup)/drivers/schunk_powercube_chain_driver.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="module" value="$(arg module)"/>
<arg name="module_type" value="$(arg module_type)"/>
<arg name="component_name" value="$(arg component_name)"/>
</include>
<include file="$(find cob_bringup)/controllers/cob_trajectory_controller.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="module" value="$(arg module)"/>
<arg name="module_type" value="$(arg module_type)"/>
<arg name="component_name" value="$(arg component_name)"/>
</include>
</group>

<group if="$(arg sim)">
<include file="$(find cob_bringup)/controllers/generic_controller.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="module" value="$(arg module)"/>
<arg name="module_type" value="$(arg module_type)"/>
<arg name="component_name" value="$(arg component_name)"/>
</include>
<node ns="$(arg component_name)" pkg="cob_helper_tools" type="fake_driver.py" name="fake_driver" cwd="node" respawn="false" output="screen"/>
Expand Down
3 changes: 0 additions & 3 deletions cob_bringup/controllers/base_controller.launch
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?xml version="1.0"?>
<launch>

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

<group ns="base">

<!-- start undercarriage ctrl -->
Expand Down
6 changes: 3 additions & 3 deletions cob_bringup/controllers/base_controller_plugin.launch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0"?>
<launch>

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

<group ns="base">

<!-- load controller configs -->
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/base_controller.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/base_joint_limits.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/base/$(arg base)/base_controller.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/base/$(arg base)/base_joint_limits.yaml"/>

<!-- start controllers -->
<node pkg="controller_manager" type="controller_manager" name="base_controller_spawner" args="spawn joint_state_controller twist_controller odometry_controller" respawn="false" output="screen"/>
Expand Down
5 changes: 3 additions & 2 deletions cob_bringup/controllers/cob_trajectory_controller.launch
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0"?>
<launch>

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

<group ns="$(arg component_name)">

<!-- parameter description of the trajectory controller -->
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/$(arg component_name)_controller.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/$(arg module_type)/$(arg module)/$(arg component_name)_controller.yaml"/>

<!-- The trajectory controller listens for JointTrajectoryFollowAction and sends velocity commands to the CANopen node -->
<node pkg="cob_trajectory_controller" type="cob_trajectory_controller" name="joint_trajectory_controller" cwd="node" respawn="false" output="screen"/>
Expand Down
7 changes: 4 additions & 3 deletions cob_bringup/controllers/generic_cartesian_controller.launch
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?xml version="1.0"?>
<launch>

<arg name="robot" default="$(optenv ROBOT !!NO_ROBOT_SET!!)"/>
<arg name="module"/>
<arg name="module_type"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="component_name"/>
<arg name="debug" default="false"/>

<group ns="$(arg component_name)">

<!-- load Cartesian controller config -->
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/$(arg component_name)_cartesian_controller.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/$(arg component_name)_self_collision.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/$(arg module_type)/$(arg module)/$(arg component_name)_cartesian_controller.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/$(arg module_type)/$(arg module)/$(arg component_name)_self_collision.yaml"/>

<!-- Cartesian controllers -->
<node pkg="cob_twist_controller" type="cob_twist_controller_node" name="twist_controller" cwd="node" respawn="false" output="screen">
Expand Down
7 changes: 4 additions & 3 deletions cob_bringup/controllers/generic_controller.launch
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?xml version="1.0"?>
<launch>

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

<group ns="$(arg component_name)">

<!-- load controller configs -->
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/$(arg component_name)_controller.yaml"/>
<!--rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/$(arg component_name)_joint_limits.yaml"/-->
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/$(arg module_type)/$(arg module)/$(arg component_name)_controller.yaml"/>
<!--rosparam command="load" file="$(arg pkg_hardware_config)/modules/$(arg module_type)/$(arg module)/$(arg component_name)_joint_limits.yaml"/-->

<!-- start_controllers -->
<node pkg="controller_manager" type="controller_manager" name="$(arg component_name)_controller_spawner" args="spawn joint_state_controller" respawn="false" output="screen"/>
Expand Down
4 changes: 2 additions & 2 deletions cob_bringup/drivers/base_driver.launch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0"?>
<launch>

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

<group ns="base">

<!-- upload parameters -->
<param name="IniDirectory" value="$(arg pkg_hardware_config)/robots/$(arg robot)/config/base/"/>
<param name="IniDirectory" value="$(arg pkg_hardware_config)/modules/base/$(arg base)/base/"/>
<param name="timeout" value="0.2"/>
<param name="PublishEffort" value="false"/>
<param name="max_trans_velocity" value="1.1"/> <!-- default: 1.1 m/s -->
Expand Down
6 changes: 3 additions & 3 deletions cob_bringup/drivers/bms.launch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<launch>

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

<node unless="$(arg sim)" name="bms" pkg="cob_bms_driver" type="bms_driver_node" output="screen" clear_params="true">
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/bms.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/base/$(arg base)/bms.yaml"/>
</node>
<node if="$(arg sim)" name="bms" pkg="cob_bms_driver" type="fake_bms.py" output="screen" clear_params="true">
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/bms.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/base/$(arg base)/bms.yaml"/>
</node>

<node ns="bms" name="power_state_aggregator" pkg="cob_bms_driver" type="power_state_aggregator.py" output="screen">
Expand Down
5 changes: 3 additions & 2 deletions cob_bringup/drivers/canopen_402.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0"?>
<launch>

<arg name="robot" default="$(optenv ROBOT !!NO_ROBOT_SET!!)"/>
<arg name="module"/>
<arg name="module_type"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="component_name"/>
<arg name="can_device"/>
Expand All @@ -17,7 +18,7 @@

<!-- start canopen node -->
<node ns="$(arg component_name)" pkg="canopen_motor_node" type="canopen_motor_node" name="driver" output="screen">
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/$(arg component_name)_driver.yaml"/>
<rosparam command="load" file="$(arg pkg_hardware_config)/modules/$(arg module_type)/$(arg module)/$(arg component_name)_driver.yaml"/>
<rosparam subst_value="True">{bus: { device: $(arg can_device) } }</rosparam>
<rosparam subst_value="True" if="$(arg use_external_sync)">{sync: { interval_ms: $(arg interval_ms), overflow: $(arg overflow) } }</rosparam>
<param name="bus/master_allocator" value="canopen::ExternalMaster::Allocator" if="$(arg use_external_sync)"/>
Expand Down
7 changes: 4 additions & 3 deletions cob_bringup/drivers/joy.launch
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" ?>
<launch>

<arg name="robot" default="$(optenv ROBOT !!NO_ROBOT_SET!!)"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="dev" default="/dev/input/js0"/>
<arg name="deadzone" default="0.12"/>

<!-- run joystick -->
<node pkg="joy" type="joy_node" name="$(anon joy_node)">
<rosparam command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/joy.yaml"/>
<rosparam param="dev" subst_value="True">$(arg dev)</rosparam>
<rosparam param="deadzone" subst_value="True">$(arg deadzone)</rosparam>
</node>

</launch>
5 changes: 2 additions & 3 deletions cob_bringup/drivers/laser_scan_filter.launch
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0"?>
<launch>

<arg name="robot"/>
<arg name="pkg_hardware_config" default="$(find cob_hardware_config)"/>
<arg name="name"/>
<arg name="scan_intervals"/>

<!-- scan filters-->
<rosparam ns="$(arg name)" command="load" file="$(arg pkg_hardware_config)/robots/$(arg robot)/config/$(arg name).yaml"/>
<rosparam ns="$(arg name)" param="scan_intervals" subst_value="True">$(arg scan_intervals)</rosparam>
<node ns="$(arg name)" pkg="cob_sick_s300" type="cob_scan_filter" name="scan_filter" respawn="false" output="screen">
<remap from="scan_in" to="scan_raw"/>
<remap from="scan_out" to="scan"/>
Expand Down
Loading