Skip to content

Commit

Permalink
Update documentation + add missing includes and fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
biancabnd committed Dec 22, 2023
1 parent fcdd7ce commit 9aec5e9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/documentation/Contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ The `psdk_ros2` wrapper is released under the [Mozilla Public License version 2.

### 3rd Party Source Code

It's important to note that the DJI Payload-SDK, a critical component integrated within the `psdk_ros2` wrapper, is released under the MIT license. The MIT license is a permissive open-source license that allows you to use, modify, and distribute the Payload-SDK in accordance with its terms. The MIT license file for the DJI Payload-SDK is included within the designated 3rd party folder of this repository.
It's important to note that the DJI Payload-SDK, a critical component integrated within the `psdk_ros2` wrapper, is released under the MIT license. The MIT license is a permissive open-source license that allows you to use, modify, and distribute the Payload-SDK in accordance with its terms.
5 changes: 2 additions & 3 deletions docs/documentation/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ The following parameters can be configured in the *psdk_wrapper/cfg/psdk_params.
| app_license | String | - | Add your App license |
| developer_account | String | - | Add your developer account (not mandatory) |
| baudrate | String | 921600 | - |
| hardware_connection | String | "DJI_USE_UART_AND_USB_BULK_DEVICE" | Depends on your connection method |
| uart_dev_1 | String | "/dev/dji_serial" | As defined in udev rules |
| uart_dev_2 | String | "/dev/dji_advanced_sensing" | As defined in udev rules |
| link_config_file_path | String | "absolute/path/to/config.json" | (Optional) Default: cfg/link_config.json |
| imu_frame | String | "psdk_imu_link" | - |
| body_frame | String | "psdk_base_link" | - |
| map_frame | String | "psdk_map_enu" | - |
Expand All @@ -61,6 +59,7 @@ The following parameters can be configured in the *psdk_wrapper/cfg/psdk_params.
| - control_information | Integer | 50 | - |


To configure the hardware connection type and to specify the exact ports that need to be used, please use the *psdk_wrapper/cfg/link_config.json* file. This file follows a similar strategy to the file one must configure before running the DJI PSDK samples. Thus, for simplicity, the psdk_ros2 wrapper follows the same approach. Please notice, that the App configuration (e.g. app_id, app_key) has been kept in the ros parameter file.

## Udev rules

Expand Down
2 changes: 2 additions & 0 deletions psdk_wrapper/include/psdk_wrapper/psdk_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <tf2_ros/static_transform_broadcaster.h>
#include <tf2_ros/transform_broadcaster.h>

#include <ament_index_cpp/get_package_share_directory.hpp>
#include <cmath>
#include <geometry_msgs/msg/accel_stamped.hpp>
#include <geometry_msgs/msg/quaternion_stamped.hpp>
Expand All @@ -53,6 +54,7 @@

#include "dji_camera_manager.h" //NOLINT
#include "dji_camera_stream_decoder.hpp" //NOLINT
#include "dji_config_manager.h" //NOLINT
#include "dji_gimbal_manager.h" //NOLINT
#include "hal_network.h" //NOLINT
#include "hal_uart.h" //NOLINT
Expand Down
2 changes: 1 addition & 1 deletion psdk_wrapper/src/modules/telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ PSDKWrapper::attitude_callback(const uint8_t *data, uint16_t data_size,
attitude_pub_->publish(quaternion_msg);

/* Save current attitude */
current_attitude_ = current_quat_FLU2ENU;
current_state_.attitude = current_quat_FLU2ENU;
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}

Expand Down
4 changes: 0 additions & 4 deletions psdk_wrapper/src/psdk_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ PSDKWrapper::set_environment()
}
RCLCPP_INFO(get_logger(), "Registered HAL handler");

#if (HARDWARE_CONNECTION == DJI_USE_UART_AND_USB_BULK_DEVICE)
return_code = DjiUserConfigManager_LoadConfiguration(
params_.link_config_file_path.c_str());
if (return_code != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
Expand Down Expand Up @@ -265,7 +264,6 @@ PSDKWrapper::set_environment()
return_code);
return false;
}
#elif (HARDWARE_CONNECTION == DJI_USE_UART_AND_NETWORK_DEVICE)
}
else if (linkConfig.type == DJI_USER_LINK_CONFIG_USE_UART_AND_NETWORK_DEVICE)
{
Expand All @@ -281,13 +279,11 @@ PSDKWrapper::set_environment()
"Register HAL Network handler error. Error code is: %ld",
return_code);
}
#elif (HARDWARE_CONNECTION == DJI_USE_ONLY_UART)
}
else
{
RCLCPP_INFO(get_logger(), "Using DJI_USE_ONLY_UART");
}
#endif

// Attention: if you want to use camera stream view function, please uncomment
// it.
Expand Down

0 comments on commit 9aec5e9

Please sign in to comment.