Skip to content
Snippets Groups Projects
Commit fb5de5ff authored by Tommy Persson's avatar Tommy Persson
Browse files

Adding service call for changing which camera to use in H20T and H20.

parent 2131424c
Branches
No related tags found
No related merge requests found
...@@ -99,6 +99,7 @@ set(msg_files ...@@ -99,6 +99,7 @@ set(msg_files
"srv/MissionWpUpload.srv" "srv/MissionWpUpload.srv"
"srv/MissionWpAction.srv" "srv/MissionWpAction.srv"
"srv/MissionWpGetInfo.srv" "srv/MissionWpGetInfo.srv"
"srv/ChangeH264Source.srv"
) )
rosidl_generate_interfaces(${PROJECT_NAME} rosidl_generate_interfaces(${PROJECT_NAME}
......
...@@ -4,6 +4,44 @@ Fixed messages and services definitions from dji_osdk_ros. Plus a mapping file. ...@@ -4,6 +4,44 @@ Fixed messages and services definitions from dji_osdk_ros. Plus a mapping file.
The problem with the original definitions is that they use characters that are not allowed in constants and firldname in ROS2. The problem with the original definitions is that they use characters that are not allowed in constants and firldname in ROS2.
## Patches to ros1 bridge needed
Pattern file: resource/interface_factories.cpp.em
auto & @(field["ros2"]["name"])2 = req2.@(field["ros2"]["name"]);
@[ end if]@
@[ if field["basic"]]@
@[ if frm == "1"]@
@(field["ros2"]["name"])@(to) = @(field["ros1"]["name"])@(frm);
@[ else]@
@(field["ros1"]["name"])@(to) = @(field["ros2"]["name"])@(frm);
@[ end if]@
@[ else]@
@[ if frm == "1"]@
Factory<@(field["ros1"]["cpptype"]),@(field["ros2"]["cpptype"])>::convert_@(frm)_to_@(to)(@
@(field["ros1"]["name"])@(frm), @(field["ros2"]["name"])@(to));
@[ else]@
Factory<@(field["ros1"]["cpptype"]),@(field["ros2"]["cpptype"])>::convert_@(frm)_to_@(to)(@
@(field["ros2"]["name"])@(frm), @(field["ros1"]["name"])@(to));
@[ end if]@
@[ end if]@
@[ if field["array"]]@
}
@[ end if]@
Same place as below:
# This must be wrong, different name with same type will now be allowed, changing it
#if ros1_type != ros2_type or ros1_name != ros2_name:
if ros1_type != ros2_type:
Fix case with arrays in service calls:
```python
if (ros1_type.rstrip("[]"), ros2_type.rstrip("[]")) not in message_string_pairs:
match = False
break
```
## Getting started ## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps. To make it easy for you to get started with GitLab, here's a list of recommended next steps.
......
# NO_1 = 0
# NO_2 = 1
# NO_3 = 2
# FPV = 7
#
# H20_WIDE=1
# H20T_WIDE=1
# H20_ZOOM=2
# H20T_ZOOM=2
# H20T_IT=3
uint8 camera
uint8 source
---
bool result
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment