Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
)
from clearpath_config.manipulators.types.grippers import FrankaGripper
from clearpath_config.platform.battery import BatteryConfig
from clearpath_config.platform.wireless import PeplinkRouter
from clearpath_generator_common.common import LaunchFile, Package
from clearpath_generator_common.launch.generator import LaunchGenerator
from clearpath_generator_common.launch.writer import LaunchWriter
Expand Down Expand Up @@ -142,6 +143,56 @@ def __init__(self, setup_path: str = '/etc/clearpath/') -> None:
remappings=[('/diagnostics', 'diagnostics'),],
)

# Onboard router & base station
if isinstance(self.clearpath_config.platform.wireless.router, PeplinkRouter):
self.wireless_router_node = LaunchFile.Node(
package='peplink_router_driver',
executable='peplink_router_node',
name='router_node',
namespace=f'{self.namespace}/network/router',
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we namespace this under wireless/router instead to keep naming consistent? Wireless watcher should probably be under the same namespace too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hesitant to change the wireless watcher namespace since that's already been published in our platform API and we may have users (e.g. outdoornav) already relying on that topic as-is.

As for network/router and network/base_station vs wireless/router and wireless/base_station I have no strong opinions either way. I chose network since it's broader in case we ever expand to non-wireless networking equipment. But that may be unnecessary future-proofing.

Copy link
Contributor

Choose a reason for hiding this comment

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

That is true, some of our MCUs look at the platform/wifi_connected topic to control the HMI wifi LED. I think one of the issues we have seen though is that when the robot is not using onboard wifi, the LED will be off even though it is connected through a peplink. It would be nice to have a single topic indicating wifi connection status regardless of source.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think for now that's probably out-of-scope for this MR. Definitely a good future feature to include though.

parameters=[
{
'ip_address':
self.clearpath_config.platform.wireless.router.ip_address,
'username':
self.clearpath_config.platform.wireless.router.username,
'password':
self.clearpath_config.platform.wireless.router.password,
'enable_gps':
self.clearpath_config.platform.wireless.router.enable_gps,
'publish_passwords':
self.clearpath_config.platform.wireless.router.publish_passwords,
}
],
remappings=[('/diagnostics', 'diagnostics'),],
)
else:
self.wireless_router_node = None
if isinstance(self.clearpath_config.platform.wireless.base_station, PeplinkRouter):
self.base_station_node = LaunchFile.Node(
package='peplink_router_driver',
executable='peplink_router_node',
name='base_station_node',
namespace=f'{self.namespace}/network/base_station',
parameters=[
{
'ip_address':
self.clearpath_config.platform.wireless.base_station.ip_address,
'username':
self.clearpath_config.platform.wireless.base_station.username,
'password':
self.clearpath_config.platform.wireless.base_station.password,
'enable_gps':
self.clearpath_config.platform.wireless.base_station.enable_gps,
'publish_passwords':
self.clearpath_config.platform.wireless.base_station.publish_passwords,
}
],
remappings=[('/diagnostics', 'diagnostics'),],
)
else:
self.base_station_node = None

# Diagnostics launch args
self.diag_updater_params = LaunchFile.LaunchArg(
'diagnostic_updater_params',
Expand Down Expand Up @@ -395,8 +446,20 @@ def __init__(self, setup_path: str = '/etc/clearpath/') -> None:
if self.bms_launch_file is None and self.bms_node is None:
common_platform_components.append(self.battery_state_estimator)

if self.clearpath_config.platform.enable_wireless_watcher:
if self.clearpath_config.platform.wireless.enable_wireless_watcher:
common_platform_components.append(self.wireless_watcher_node)
if (
self.wireless_router_node is not None
and self.clearpath_config.platform.wireless.router is not None
and self.clearpath_config.platform.wireless.router.launch_enabled
):
common_platform_components.append(self.wireless_router_node)
if (
self.base_station_node is not None
and self.clearpath_config.platform.wireless.base_station is not None
and self.clearpath_config.platform.wireless.base_station.launch_enabled
):
common_platform_components.append(self.base_station_node)

if len(self.can_bridges) > 0:
common_platform_components.extend(self.can_bridges)
Expand Down
1 change: 1 addition & 0 deletions clearpath_generator_robot/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<exec_depend>imu_filter_madgwick</exec_depend>
<exec_depend>canopen_inventus_bringup</exec_depend>
<exec_depend>micro_ros_agent</exec_depend>
<exec_depend>peplink_router_driver</exec_depend>
<exec_depend>python3-apt</exec_depend>
<exec_depend>sevcon_traction</exec_depend>
<exec_depend>valence_bms_driver</exec_depend>
Expand Down
Loading