ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

peetonn's profile - activity

2022-06-22 04:24:00 -0500 marked best answer Converting received ARKit pose to ROS pose

I'm receiving ARKit's pose as is from iPhone and publishing in a topic. In ROS I need to convert it to the ROS reference frame. ARKit is right-handed x-right, y-up and z-backward so my conversion is two rotations: -90 around X and -90 around Z. However it does not give desired result in rviz. Would appreciate pointing me in the right direction (practical/theoretical) to fix this.

ARKit -> ROS conversion:

tf::Pose convertCameraPoseToRos(const tf::Pose& cameraPose)
{
        // arkit to ros conversion
        // 1. rotate -90 around X
        // 2. rotate -90 around Z
        #define PI 3.1415926535897
        tf::Transform rotate1 = tf::Transform(tf::Quaternion(tf::Vector3(1,0,0), -PI/2));
        tf::Transform rotate2 = tf::Transform(tf::Quaternion(tf::Vector3(0,0,1), -PI/2));

        tf::Transform arCameraRotation = tf::Transform(cameraPose.getRotation());
        tf::Transform arCameraTranslation = tf::Transform(tf::Quaternion(1,0,0,0), cameraPose.getOrigin());

    // tried this one - didn't work
        //return arCameraTranslation * rotate1 * rotate2 * arCameraRotation;

        return cameraPose * rotate1 * rotate2; // this one is current, but doesn't work either
}

ARKit pose obtaining on iOS in swift:

// inside delegate "func session(_ session: ARSession, didUpdate frame: ARFrame)"
self.arKitT = frame.camera.transform 

arKitPose.position_.x_ = arKitT!.columns.3.x
arKitPose.position_.y_ = arKitT!.columns.3.y
arKitPose.position_.z_ = arKitT!.columns.3.z

let poseQ = simd_quatf(self.arKitT!)                    
arKitPose.rotation_.x_ = poseQ.vector.x
arKitPose.rotation_.y_ = poseQ.vector.y
arKitPose.rotation_.z_ = poseQ.vector.z
arKitPose.rotation_.w_ = poseQ.vector.w
// arKitPose is being published as PoseStamped
2022-06-22 04:23:08 -0500 received badge  Notable Question (source)
2022-06-21 14:51:16 -0500 answered a question Converting received ARKit pose to ROS pose

Didn't get my math correct -- needed to rotate -90 around Z, then -90 around Y. Also, the ordering should be different.

2022-05-29 14:54:40 -0500 received badge  Popular Question (source)
2022-05-28 08:29:09 -0500 asked a question Converting received ARKit pose to ROS pose

Converting received ARKit pose to ROS pose I'm receiving ARKit's pose as is from iPhone and publishing in a topic. In RO

2020-12-21 13:26:58 -0500 received badge  Famous Question (source)
2020-01-10 12:28:11 -0500 received badge  Famous Question (source)
2020-01-10 11:54:04 -0500 marked best answer Using roscpp in existing app on Android/iOS

Hi there. I have an existing app, or rather a shared library, that I compile for mobile platforms (currently Android, but iOS will come very soon too). It is a C++ library that have heavy dependencies (“heavy” in terms of cross-compiling and amount of code). Now, I need to publish (and consume) some ROS topics. I was looking at ROS client libraries page and it seems to me that I should use roscpp for my project. However, after following through all the android ndk tutorials I’m still confused on how I would incorporate roscpp into my existing code. I would expect to have a set of .so or .a libraries compiled for the target platform (btw, I use arm64 while docker container compiles for arm7) and a headers folder to include in my source code. My question is – how can I use roscpp in my existing C++ android library? I am not using Android studio, I use ndk-build directly. I noticed there’re Application.mk and Android.mk files in “roscpp_android_ndk” folder, is that shall be used ultimately?

2020-01-10 11:53:19 -0500 answered a question Using roscpp in existing app on Android/iOS

I was able to successfully compile roscpp for Android using this repo. It is a fork of the repo from the tutorial but mo

2020-01-10 11:47:35 -0500 received badge  Notable Question (source)
2020-01-10 11:44:40 -0500 asked a question macOS C++ client for communicating with ROS

macOS C++ client for communicating with ROS I couldn't find any good (let alone official) information on using roscpp fo

2019-12-20 14:41:43 -0500 received badge  Enthusiast
2019-12-14 05:24:54 -0500 received badge  Notable Question (source)
2019-12-10 11:43:57 -0500 marked best answer Where can I find generated C++ files for .msg?

Is it possible to find generated source code for messages? I'm building a (mobile) client that needs to communicate with the server using custom messages. I can see .msg files for them in the server codebase, but can't find source files that I can easily import into the client codebase.

2019-12-10 11:43:57 -0500 received badge  Scholar (source)
2019-12-10 09:09:03 -0500 received badge  Popular Question (source)
2019-12-09 19:04:23 -0500 asked a question Where can I find generated C++ files for .msg?

Where can I find generated C++ files for .msg? Is it possible to find generated source code for messages? I'm building a

2019-11-26 04:31:33 -0500 received badge  Student (source)
2019-11-26 03:47:56 -0500 received badge  Popular Question (source)
2019-11-22 12:10:27 -0500 commented question Native C++ with ROS on Android?

I can't do Java since I have C++ library. This library is used in third-party framework (UnrealEngine). Yes, I need to c

2019-11-21 16:48:09 -0500 commented answer Using roscpp in existing app on Android/iOS

is this the de-facto way to go in the cases like mine? we used ros bridge C# implementation in previous project for Unit

2019-11-21 16:46:37 -0500 received badge  Supporter (source)
2019-11-21 15:35:32 -0500 commented question Using roscpp in existing app on Android/iOS

ROS runs on multple OpenPTrack machines. My mobile client needs to publish specific topics that will be consumed by a RO

2019-11-21 13:25:49 -0500 commented question Native C++ with ROS on Android?

I have some experience with the above and cross-compiling as well.

2019-11-21 13:02:23 -0500 commented question Native C++ with ROS on Android?

could you share any pointers/notes on what you did? I'd appreciate any guidance...

2019-11-21 12:36:26 -0500 edited question Using roscpp in existing app on Android/iOS

Using roscpp in existing app on Android/iOS Hi there. I have an existing app, or rather a shared library, that I compile

2019-11-21 12:34:08 -0500 commented question Native C++ with ROS on Android?

Hi! Have you found a solution to your problem? I'm facing a similar one.

2019-11-21 12:33:54 -0500 asked a question Using roscpp in existing app on Android/iOS

Using roscpp in existing app on Android/iOS Hi there. I have an existing app, or rather a shared library, that I compile