yaw, pitch and roll to direction and elevation

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Robert Yeatman
Newbie
Newbie
Posts: 5
Joined: Mon May 19, 2008 12:00 am

yaw, pitch and roll to direction and elevation

Post by Robert Yeatman » Thu Jul 25, 2013 10:07 am

Hi,
I have a sensor in a borehole probe that outputs yaw (azimuth), pitch and roll. I would like to convert the output to Direction and Elevation (for example the probe has a direction of 37.5 degrees from north and is tilted down at an angle of 82.4 degrees from the horizontal). Then I want to make a 3D plot showing the probe's direction and tilt. The conversion from yaw, pitch and roll to direction and elevation is not as easy as it seems because it requires a 3D translation. I have searched Google looking for some good example code for the translation but not found the solution yet.

Any help on converting yaw (azimuth), pitch and roll to Direction and Elevation and then plotted an image of the probe in TeeChart would be very much appreciated!

Lost at the moment.
Thanks,

Robert Yeatman

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: yaw, pitch and roll to direction and elevation

Post by Yeray » Mon Jul 29, 2013 2:06 pm

Hello Robert,

I understand you need to find how to do this conversion in order to represent it in a chart, but this doesn't look as a problem directly related with the charting tool supported by Steema Software.
I can tell you that wikipedia seems to explain what these angles mean in quite detail, but I haven't found delphi code to transform yaw, pitch and roll values to direction and elevation.
Actually, I'm not sure if the conversion you ask for is possible. Aren't you just trying to eliminate the roll?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Robert Yeatman
Newbie
Newbie
Posts: 5
Joined: Mon May 19, 2008 12:00 am

Re: yaw, pitch and roll to direction and elevation

Post by Robert Yeatman » Mon Aug 05, 2013 6:55 am

Hi Yeray,

Thanks for responding. I would like to display in real-time a probe in 3D space showing its direction and tilt using TeeChart. You are right that the calculations are the problem - not TeeChart at the moment ;-). I was hoping that someone else may have also plotted a Yaw, Pitch and Roll sensor in TeeChart and could provide some more insight into converting the Yaw, Pitch and Roll values into a direction (something like NE at 47 degree) and dip (downwards at 82 degrees).

I have seen the info on wikipedia but I am still at a loss of how exactly to convert the 3 sensor values into something useful for TeeChart. The matrix math and/or the use of a quaternion makes me confused. There is also the possible problem of Gimbal lock (loss of 2 degrees of freedom) when the probe is near vertical and the loss of 1 degree of freedom when the probe is near horizontal. Ugh!

I would greatly appreciate it if someone could explain how this is done (or can suggest where else I can look).

Best regards,
Robert

Robert Yeatman
Newbie
Newbie
Posts: 5
Joined: Mon May 19, 2008 12:00 am

Re: yaw, pitch and roll to direction and elevation

Post by Robert Yeatman » Tue Nov 12, 2013 3:59 pm

HI,
I have my probe working fairly well and would like to plot it. What would be the best way to plot the probe's direction (yaw, pitch, roll) using teechart?
The probe is in a borehole so its basically point downwards. I would like to hold (fix) the back of the probe at the top and center of a 3d space and then have the probe body point with the given yaw, pitch and roll.
I think this might be possible using the arrow series. It would be better if I could show the probe as a cylinder (perhaps an image) in a 3D coord system. Maybe it would be better to use something like the Teehouse???
Any suggestions of how to make this plot would be appreciated.
Thanks
Robert

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: yaw, pitch and roll to direction and elevation

Post by Narcís » Tue Nov 12, 2013 4:13 pm

Hi Robert,

Can you point us to an example image, similar to what you need?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Robert Yeatman
Newbie
Newbie
Posts: 5
Joined: Mon May 19, 2008 12:00 am

Re: yaw, pitch and roll to direction and elevation

Post by Robert Yeatman » Thu Nov 14, 2013 2:06 pm

HI,
I now have a start to what I need. I setup a 3D TeeChart with each axis set to 0 to 10. I added an image of a compass rose on the bottom axis. I plot a vector from the center of the top (5,10,5) to the positions given to me by the sensor (see the image below). The vector the represents the direction and dip of the probe. This works but I have a few problems still. 1) I would like to increase the line thickness of the probe vector (red) but I don't find anyway to do this. 2) I would like to draw to lines across the two top axes - to define the starting point of the vector. In the image I made the top front -to-back center line using a grid line for the axis (is there a way to show the grid lines without the axis values?). I cannot find a way to setup an axis grid line to make the top right-to-left line. For now I used a second vector line to make the top right-to-left line. It looks a bit funny because it has an associated arrow head (I cannot find a way to hide the arrow head either).
Any suggestion on how to make the vector line thicker (or thicker and wider); how to draw the top center lines or how to remove the vector arrow head would be appreciated.
Best regards,
Robert
Attachments
3D plot1.jpg
3D chart using a vector to show probe orientation on compass rose.
3D plot1.jpg (25.21 KiB) Viewed 12287 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: yaw, pitch and roll to direction and elevation

Post by Narcís » Thu Nov 14, 2013 2:22 pm

Hi Robert,
1) I would like to increase the line thickness of the probe vector (red) but I don't find anyway to do this.
How are you drawing it? Custom drawing on the chart canvas or using a built-in series? Most likely you need to change the Pen.Width of the object you use, for example:

Code: Select all

  Chart1.Canvas.Pen.Width:=3;
2) I would like to draw to lines across the two top axes - to define the starting point of the vector. In the image I made the top front -to-back center line using a grid line for the axis (is there a way to show the grid lines without the axis values?).
I'm afraid not. There's a trick you can do though, you can make blank spaced labels so that grid lines are drawn and labels are not visible and also modify Ticks and MinorTicks, for example:

Code: Select all

procedure TForm2.Chart1GetAxisLabel(Sender: TChartAxis; Series: TChartSeries;
  ValueIndex: Integer; var LabelText: string);
begin
  if Sender = Chart1.Axes.Left then
  begin
    LabelText:=' ';
  end;
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
  Chart1.Axes.Left.TickLength:=0;
  Chart1.Axes.Left.MinorTicks.Visible:=False;
end;
I cannot find a way to setup an axis grid line to make the top right-to-left line. For now I used a second vector line to make the top right-to-left line.
You may need to make the DepthTop axis visible:

Code: Select all

  Chart1.Axes.DepthTop.Visible:=True;
It looks a bit funny because it has an associated arrow head (I cannot find a way to hide the arrow head either).
Any suggestion on how to make the vector line thicker (or thicker and wider);
Changing Pen.Width as I suggested earlier. If this doesn't help please attach a simple example project we can run "as-is" to reproduce the problem here.
how to draw the top center lines or how to remove the vector arrow head would be appreciated.
Using DepthTop axis.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Robert Yeatman
Newbie
Newbie
Posts: 5
Joined: Mon May 19, 2008 12:00 am

Re: yaw, pitch and roll to direction and elevation

Post by Robert Yeatman » Fri Nov 15, 2013 10:08 am

Hi Narcís,
Thanks for the impressively fast response! I originally used the Vector 3D series to draw the “probe position” and I did not find a line thickness for this series. Changing the pen width for the series did make the probe’s vector arrow thicker. Thanks for the idea.
I eventually changed to use the TPoint3DSeries. When the line is thick it makes a nice looking cylinder (a good representation of the probe).
I tried to use the DepthTop axis and grid to make the Left-right top center line (to define the start of the vector) but I cannot make it work. The DepthTop grid is shown on the yellow wall and the bottom compass image. The DepthTop grid seems to grid the same walls as the DepthRight grid. I cannot find a way to show a grid that covers the top of the chart “cube”. I ending up using MoveTo3D and MoveTo3D to draw the “grid” line. Works great!

Thanks much for the help.
Robert

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: yaw, pitch and roll to direction and elevation

Post by Narcís » Fri Nov 15, 2013 10:18 am

Hi Robert,

You're very welcome.
Robert Yeatman wrote: I tried to use the DepthTop axis and grid to make the Left-right top center line (to define the start of the vector) but I cannot make it work. The DepthTop grid is shown on the yellow wall and the bottom compass image. The DepthTop grid seems to grid the same walls as the DepthRight grid. I cannot find a way to show a grid that covers the top of the chart “cube”. I ending up using MoveTo3D and MoveTo3D to draw the “grid” line. Works great!
I see, grid lines for the DepthTop axis are painted on the left wall. Glad to see you found a workaround.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply