Skip to content

T265 Upgrade Firmware to 0.2.0.951 - #6176

Merged
ev-mp merged 2 commits into
realsenseai:developmentfrom
radfordi:t265-release-951
Apr 23, 2020
Merged

ev-mp merged 2 commits into
realsenseai:developmentfrom
radfordi:t265-release-951

Conversation

@radfordi

@radfordi radfordi commented Apr 1, 2020

Copy link
Copy Markdown
Contributor
  • Make initial yaw consistent when starting forward, backward, up and down
  • Fix intermittent descriptor/imu corruption

@dorodnic, please wait for feedback on these.

  o Make initial yaw consistent when starting forward, backward, up and down
  o Fix intermittent descriptor/imu corruption
@dorodnic dorodnic added the T260 series Intel® T265 library label Apr 1, 2020
@neilyoung

Copy link
Copy Markdown
Contributor

@radfordi Anything special to test?

@neilyoung

Copy link
Copy Markdown
Contributor

Hi @radfordi, I'm having some questions regarding this firmware. What problem is supposed to be solved by this?

Make initial yaw consistent when starting forward, backward, up and down

Today I was trying (for the first time to be honest) to start the camera pointing up, down and backward. While the up and down results are completely inaccurate, the backward result is similar to the forward.

The initial yaw values for an up and downward start seem to be wrong as before.

I suppose it is still necessary to apply a different transformation to the values as stated here #4080 (comment)

@neilyoung

Copy link
Copy Markdown
Contributor

Wait, maybe it is not that bad at all and I just have some hidden bug in my app. I created a little test script from the old t265_rpy.py example and merged that with parts of the cool project here https://github.com/thien94/vision_to_mavros/blob/master/scripts/t265_to_mavlink.py

I made some quick preliminary tests and the forward and downward results are pretty OK. There was also no need to tilt the cam a bit at start in order to stabilise the yaw.

Maybe you check the math? It was hacked in a rush, maybe there are issues. I could not get good results with the forwarddown setup.

The world reference frame is NED.

#!/usr/bin/python
# -*- coding: utf-8 -*-
## License: Apache 2.0. See LICENSE file in root directory.
## Copyright(c) 2019 Intel Corporation. All Rights Reserved.

#####################################################
##           librealsense T265 rpy example         ##
#####################################################

# First import the library
import pyrealsense2 as rs
import numpy as np
import transformations as tf
import math as m
import argparse
import textwrap


parser = argparse.ArgumentParser(prog='t256_rpy_test',
    formatter_class=argparse.RawDescriptionHelpFormatter,
    description=textwrap.dedent('''
description:
   Pose test
'''),
    epilog=textwrap.dedent('''
'''))
parser.add_argument("-o", "--orientation", type=str, choices=("forward", "down", "forwarddown"), default="forward", help="set start orientation")

args = parser.parse_args()

# From https://github.com/thien94/vision_to_mavros/blob/master/scripts/t265_to_mavlink.py
if args.orientation == 'forward':
    H_aeroRef_T265Ref = np.array([[0,0,-1,0],[1,0,0,0],[0,-1,0,0],[0,0,0,1]])
    H_T265body_aeroBody = np.linalg.inv(H_aeroRef_T265Ref)
else:
    if args.orientation == 'down':
        H_aeroRef_T265Ref = np.array([[0,0,-1,0],[1,0,0,0],[0,-1,0,0],[0,0,0,1]])
        H_T265body_aeroBody = np.array([[0,1,0,0],[1,0,0,0],[0,0,-1,0],[0,0,0,1]])
    else:
        if args.orientation == "forwarddown":
            H_aeroRef_T265Ref = np.array([[0,0,-1,0],[1,0,0,0],[0,-1,0,0],[0,0,0,1]])
            H_T265body_aeroBody = np.array(
                [[ 0.       ,  1.        ,  0.        ,  0.        ],
                [-0.70710676, -0.        , -0.70710676, -0.        ],
                [-0.70710676,  0.        ,  0.70710676,  0.        ],
                [ 0.        ,  0.        ,  0.        ,  1.        ]])
        
        
# Declare RealSense pipeline, encapsulating the actual device and sensors
pipe = rs.pipeline()

# Build config object and request pose data
cfg = rs.config()
cfg.enable_stream(rs.stream.pose)

# Start streaming with requested config
pipe.start(cfg)

try:
    while (True):
        # Wait for the next set of frames from the camera
        frames = pipe.wait_for_frames()

        # Fetch pose frame
        pose = frames.get_pose_frame()
        if pose:
            # Print some of the pose data to the terminal
            data = pose.get_pose_data()

            H_T265Ref_T265body = tf.quaternion_matrix([data.rotation.w, data.rotation.x,data.rotation.y,data.rotation.z]) # in transformations, Quaternions w+ix+jy+kz are represented as [w, x, y, z]!
            H_T265Ref_T265body[0][3] = data.translation.x
            H_T265Ref_T265body[1][3] = data.translation.y
            H_T265Ref_T265body[2][3] = data.translation.z  
            
            # transform to aeronautic coordinates (body AND reference frame!)
            H_aeroRef_aeroBody = H_aeroRef_T265Ref.dot( H_T265Ref_T265body.dot( H_T265body_aeroBody ))
            
            rotation = np.array(tf.euler_from_matrix(H_aeroRef_aeroBody, 'sxyz'))  
            translation = tf.translation_from_matrix(H_aeroRef_aeroBody)
            
            roll = rotation[0] * 180/m.pi
            pitch = rotation[1] * 180/m.pi
            yaw = rotation[2] * 180/m.pi
            x = translation[0]
            y = translation[1]
            z = translation[2]

            print("pitch: {0:5.2f}, roll: {1:5.2f}, yaw: {2:5.2f}       x: {3:5.2f}, y: {4:5.2f}, z: {5:5.2f}".format(roll, pitch, yaw, x, y, z))

finally:
    pipe.stop()

@neilyoung

Copy link
Copy Markdown
Contributor

@dorodnic, please wait for feedback on these.

@radfordi, @dorodnic Sorry guys. You seem to wait for feedback but ignoring it the same time. Do I have to understand that? But maybe you mean "internal feedback", then of course I'm out here...

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown

how to update to 0.2.0.951? I download the sdk2.34.0

@neilyoung

Copy link
Copy Markdown
Contributor

You need to download the SDK, compile it, run Realsense Viewer or your application. Power cycle the cam. Somewhen you'll have it on the device.

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown

程序

您需要下载,编译,运行Realsense Viewer或您的应用程序。重启凸轮。当您将其安装在设备上时。

yep,I did it all but not any shows could update my t265. tried 20times at last , have the same result.

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown
  • 向前,向后,向上和向下启动时,使初始偏航保持一致
  • 修复间歇性描述符/ IMU损坏

@dorodnic,请等待这些反馈。

hi,how can I update t265 to 0.2.0.951 ??

@toolagu

toolagu commented Apr 4, 2020 via email

Copy link
Copy Markdown

@neilyoung

neilyoung commented Apr 4, 2020 •

Copy link
Copy Markdown
Contributor

I had this also sometimes. This is if a previous installation has not been removed completely. You need to make sudo make uninstall from your build directory. Then start realsenseviewer If there is something, then you need to find it and remove it, since it has not been removed last time. Then make && sudo make install again. Once you have the proper realsenseviewer running, you will get the latest fw. BTW: Did you apply this PR? This needs to be done before compilation:

git pull origin pull/6176/head

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown

有时我也有这个。这是以前的安装尚未完全删除的情况。您需要sudo make uninstall从构建目录中进行构建。然后开始realsenseviewer如果有东西,那么您需要找到它并删除它,因为上次它还没有被删除。然后make && sudo make install再说一次。一旦realsenseviewer运行正常,您将获得最新的固件。顺便说一句:您是否应用了此PR?这需要在编译之前完成:

git pull origin pull/6176/head

I use it on windows10, seems what you said is on linux

@neilyoung

Copy link
Copy Markdown
Contributor

:) No git is git :)

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown

:)没有git是git :)

I still can't understand how can I update my t265,I already do what exactly you say several times。And on the windows 10。It's nothing happen!Could you tell me have you update the lastest?And also you really on windows 10?What's step you have do?

@smartynenko

Copy link
Copy Markdown
Contributor

@toolagu are you building from original repo or pulling code from @radfordi ‘s fork created for this PR? If you building off the official repo you will need to replicate updates to your copy

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown

@toolagu are you building from original repo or pulling code from @radfordi ‘s fork created for this PR? If you building off the official repo you will need to replicate updates to your copy

no,I just download from
https://github.com/IntelRealSense/librealsense/releases/tag/v2.34.0
win10 64bit and install the .exe.
is this wrong?

@smartynenko

Copy link
Copy Markdown
Contributor

This PR is not merged yet. You will need to download and make all utilities from below repo

https://github.com/radfordi/librealsense/tree/t265-release-951

Alternatively (if you are cloning master) you can update CMake and fw versions in your local copy, but then you still will need to rebuild all tools

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown

This PR is not merged yet. You will need to download and make all utilities from below repo

https://github.com/radfordi/librealsense/tree/t265-release-951

Alternatively (if you are cloning master) you can update CMake and fw versions in your local copy, but then you still will need to rebuild all tools

I will try bro. Thank you for your patient!You are really gentleman!then,I'll let you know.

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown

This PR is not merged yet. You will need to download and make all utilities from below repo

https://github.com/radfordi/librealsense/tree/t265-release-951

Alternatively (if you are cloning master) you can update CMake and fw versions in your local copy, but then you still will need to rebuild all tools

I downloaded the source code of the branch, but in win10 and tx2 (linux)can not compile, too many errors.Do you have such a problem?

@neilyoung

neilyoung commented Apr 4, 2020 •

Copy link
Copy Markdown
Contributor

You should not download the source code of the branch, however you did that and whatever you downloaded.

These are the general steps to be performed. A short look at the Windows instructions let me strongly recommend to not try to compile IR on Windows.

But if you have a Linux, then checkout the Linux instructions first. That should work fine.

One major step of the preparations is to clone the IR repository to your machine.

This is done via git:

git clone https://github.com/IntelRealSense/librealsense.git

The next step is usually to create a build directory in the cloned directory and call cmake with some parameters (check instructions) from there. Before you are issuing make you need to apply this PR to the master branch.

git pull origin pull/6176/head

After that call make && sudo make install and you'll have it.

@toolagu

toolagu commented Apr 4, 2020

Copy link
Copy Markdown

You should not download the source code of the branch, however you did that and whatever you downloaded.

These are the general steps to be performed. A short look at the Windows instructions let me strongly recommend to not try to compile IR on Windows.

But if you have a Linux, then checkout the Linux instructions first. That should work fine.

One major step of the preparations is to clone the IR repository to your machine.

This is done via git:

git clone https://github.com/IntelRealSense/librealsense.git

The next step is usually to create a build directory in the cloned directory and call cmake with some parameters (check instructions) from there. Before you are issuing make you need to apply this PR to the master branch.

git pull origin pull/6176/head

After that call make && sudo make install and you'll have it.

Sorry I didn't make it clear that I was cloning the source code from the link you gave me, but I couldn't execute “git pull origin pull/6176/head”
A error is “fatal:Couldn't find remote ref pull/6176/head”
what happened?

@neilyoung

neilyoung commented Apr 4, 2020 •

Copy link
Copy Markdown
Contributor

I don't know, I don't know your setup. This is what happens here:

~/Documents/librealsense $ git pull origin pull/6176/head
From https://github.com/IntelRealSense/librealsense
 * branch                refs/pull/6176/head -> FETCH_HEAD
Already up to date.
~/Documents/librealsense $ 

This is OK, since the PR has already been applied.

EDIT: I think this is really basic stuff. You don't have to make or cmake. Just clone the repo and apply the PR. That MUST work IMHO

@ev-mp
ev-mp changed the base branch from master to development April 23, 2020 14:10

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@radfordi , thank you.

@ev-mp
ev-mp merged commit 59eac0b into realsenseai:development Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T260 series Intel® T265 library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants