Skip to content

Commit

Permalink
Merge pull request #14 from iwatake2222/fix_callback_without_executor
Browse files Browse the repository at this point in the history
fix: read architecture which has callbacks without executor
  • Loading branch information
iwatake2222 authored Jun 26, 2024
2 parents 4f6ce18 + 04258d4 commit 7850aca
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/dear_ros_node_viewer/caret_extend_callback_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,30 @@ def create_callback_group_list(node, dict_cbgroup2executor, dict_cbgroup2color):
callback_names = callback_group['callback_names']
callback_group_info['callback_group_name'] = callback_group_name
callback_group_info['callback_group_type'] = callback_group_type
callback_group_info['executor_name'] = dict_cbgroup2executor[callback_group_name]
callback_group_info['color'] = dict_cbgroup2color[callback_group_name]
if callback_group_name in dict_cbgroup2executor:
callback_group_info['executor_name'] = dict_cbgroup2executor[callback_group_name]
callback_group_info['color'] = dict_cbgroup2color[callback_group_name]
else:
is_display_none_excutor = False
if is_display_none_excutor:
callback_group_info['executor_name'] = 'None'
callback_group_info['color'] = [255, 255, 255]
else:
continue
callback_group_info['callback_detail_list'] = []
for callback_name in callback_names:
callback_detail = create_callback_detail(callbacks, callback_name)
if callback_detail:
callback_group_info['callback_detail_list'].append(callback_detail)
max_callback_detail_list = 50
if len(callback_group_info['callback_detail_list']) < max_callback_detail_list:
callback_group_info['callback_detail_list'].append(callback_detail)
elif len(callback_group_info['callback_detail_list']) == max_callback_detail_list:
logger.warning(f'Too many callbacks exist in {node["node_name"]}. The following callback is ignored. {callback_detail}')
callback_detail = {
'callback_name': 'Too many callbacks',
'callback_type': '',
'description': 'Too many callbacks'}
callback_group_info['callback_detail_list'].append(callback_detail)
callback_group_list.append(callback_group_info)
return callback_group_list

Expand Down

0 comments on commit 7850aca

Please sign in to comment.