@@ -203,6 +203,28 @@ def __init__(self, setup_path: str = '/etc/clearpath/') -> None:
203
203
namespace = self .namespace ,
204
204
)
205
205
206
+ # ROS2 socketcan bridges
207
+ ros2_socketcan_package = Package ('ros2_socketcan' )
208
+ self .can_bridges = []
209
+ for can_bridge in self .clearpath_config .platform .can_bridges .get_all ():
210
+ self .can_bridges .append (LaunchFile (
211
+ 'socket_can_receiver' ,
212
+ package = ros2_socketcan_package ,
213
+ args = [
214
+ ('interface' , can_bridge .interface ),
215
+ ('from_can_bus_topic' , f'{ self .namespace } /{ can_bridge .topic_rx } ' ),
216
+ ]
217
+ ))
218
+
219
+ self .can_bridges .append (LaunchFile (
220
+ 'socket_can_sender' ,
221
+ package = ros2_socketcan_package ,
222
+ args = [
223
+ ('interface' , can_bridge .interface ),
224
+ ('to_can_bus_topic' , f'{ self .namespace } /{ can_bridge .topic_tx } ' ),
225
+ ]
226
+ ))
227
+
206
228
# Components required for each platform
207
229
common_platform_components = [
208
230
self .wireless_watcher_node ,
@@ -211,6 +233,9 @@ def __init__(self, setup_path: str = '/etc/clearpath/') -> None:
211
233
self .battery_state_control
212
234
]
213
235
236
+ if len (self .can_bridges ) > 0 :
237
+ common_platform_components .extend (self .can_bridges )
238
+
214
239
self .platform_components = {
215
240
Platform .J100 : common_platform_components + [
216
241
self .imu_0_filter_node ,
0 commit comments