How I can plot a vehicle's velocity at different points on a map

I am working on driverless car. I have rosbag data. Now I have to plot imu and Gps data on a given map. How can I do that. Such that at every point on map I have knowledge of at what point what was yaw angle, what was velocity, acceleration etc.

Answers (1)

I would use the mapping toolbox or this function and you can pretty much plot like normal. Everything is just converted into lat and long points. For example your code might look something like this:
% Use map toolbox to plot region of interest and coastlines
figure
worldmap('Canada')
c = load('coast.mat');
plotm(c.lat,c.long,'k')
% Combine lat, long, and magnitude and rearrange by magnitude
latLongMag = [latCoord; longCoord; magValueNum]';
latLongMag = sortrows(latLongMag,3);
% Create a color map for the data points (blue low red high)
colors = jet(length(latLongMag));
% Plot the results
scatterm(latLongMag(:,1),latLongMag(:,2),20,colors)

7 Comments

Thank you for your help.
But this code is just marking latitude and longitude on map. What I want, is to extract data from rosbag /imu topic and plot those information on the map.
Suppose I have image1.jpg(Map of our college campus) now we have to plot velocity acceleration on the map which we extracted.
The code I supplied plots the magnitude of a variable (e.g - angular velocity) as a function of color in the lat and long coordinate system.
Can you please clarify what you want your x and y (or even z) axis to be? I am confused how you want acclereration to translate to a 2D image? If you can find an example online that would be even better!
I have attached the image file. We have rosbag data file which contains imu and gps topic. Now the question is how we can plot GPS data points and IMU vector at different points on map.
If there is any mathworks related article then please attach the link here.
actually the driverless car moved in our campus and sensors present in car recorded data. Now while moving, data got recorded corresponding to different locations. Now we want to represent those data on the map of the place where it moved.
Thank you for your response sir. I went through the link but, In this source link which you provided, to use the world map they are using geoshow('landareas.shp')
How to convert my map image which is in jpg to shp. Also, how to construct the geodata structure in shp format like this which is uploaded here
S = shaperead('concord_roads.shp')

Sign in to comment.

Asked:

on 15 Dec 2018

Commented:

on 17 Dec 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!