Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Forwarding RTCM Data with Rtk Plugin #195

Open
Ba0Nguyen opened this issue Dec 13, 2024 · 1 comment
Open

Question: Forwarding RTCM Data with Rtk Plugin #195

Ba0Nguyen opened this issue Dec 13, 2024 · 1 comment

Comments

@Ba0Nguyen
Copy link

Ba0Nguyen commented Dec 13, 2024

`

        val inputStream = socket.getInputStream()
        val buffer = ByteArray(512)
        var bytesRead: Int
        while (inputStream.read(buffer).also { bytesRead = it } != -1) {
            // Output the binary data
            CoroutineScope(Dispatchers.IO).launch {
                val rtcmEncodedString: String = android.util.Base64.encodeToString(buffer, android.util.Base64.NO_WRAP)
                val rtkData = RtcmData(rtcmEncodedString)
                val completable = rtk.sendRtcmData(rtkData)
                completable.subscribe({
                    Log.d("RTCM DATA Forwarding", "Forwarding Success, ${rtkData.data}")
                }, { e ->
                    Log.d("RTCM DATA Forwarding", "Forwarding Failed: error ${e.message}")
                })
            }
        }

`

Is this the correct way of forwarding RTCM Data to the drone to achieve RTK Fixed?
I got forwarding data result Success but my horizontal uncertainty and vertical uncertainty from the RawGps plugin is still very high. If I leave my FlightController in one place and not move it for 5 minutes, the position uncertainty could get down to less than 3 cm and the flight controller can achieve RTK Fixed status. My goal is to achieve RTK Fixed status at all time when RTCM data is forwarded. Do you think the way I'm forwarding RTCM Data might affect the position uncertainty? Or could it be that the data I'm getting is not very effective?

MavSDK v2.0.1 with Ardupilot v4.4.4
Thank you.

@julianoes
Copy link
Contributor

This should be fixed with v3 where base64 is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants