How to get the height of the map?

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
Jenn77
Posts: 2
Joined: Sat Dec 11, 2021 2:11 am

How to get the height of the map?

Post by Jenn77 »

I am looking for a function or something to get the heights of the map(near the robot). It should be a 2-D matrix with heights as each element. I want to use the matrix to represent the geographic information which the robot is in. Is there any solution to do that? Thanks for answering!
eduardo98m
Posts: 2
Joined: Fri Dec 24, 2021 2:59 pm

Re: How to get the height of the map?

Post by eduardo98m »

I tried this recently and the most successful, way to do this was to use ray testtig in the x, y coordinate you want to know the height of.
The function you will be looking for may be:

Code: Select all

p.rayTest((x, y, z_f),(x, y, z_o)) 
There is also a variant to perform a batch rayTest.

You may also want to check if the ray collides with the terrain ant not the robot. In the case the ray collydes with the robot try castin the ray from below the terrain.
Post Reply