Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get lat lon from gps into map #1

Open
RCMast3r opened this issue Apr 11, 2024 · 0 comments
Open

get lat lon from gps into map #1

RCMast3r opened this issue Apr 11, 2024 · 0 comments

Comments

@RCMast3r
Copy link
Contributor

// The ./types module provides helper types for your Input events and messages.
import { Input, Message } from "./types";

// Your script can output well-known message types, any of your custom message types, or
// complete custom message types.
//
// Use `Message` to access types from the schemas defined in your data source:
// type Twist = Message<"geometry_msgs/Twist">;
//
type gps = Message<"evelogger_vectornav_position">
import {LocationFix} from "@foxglove/schemas";
// Import from the @foxglove/schemas package to use foxglove schema types:
// import { Pose, LocationFix } from "@foxglove/schemas";
//
// Conventionally, it's common to make a _type alias_ for your script's output type
// and use that type name as the return type for your script function.
// Here we've called the type `Output` but you can pick any type name.
type Output = {
  hello: string;
};

// These are the topics your script "subscribes" to. Studio will invoke your script function
// when any message is received on one of these topics.
export const inputs = ["evelogger_vectornav_position_data"];

// Any output your script produces is "published" to this topic. Published messages are only visible within Studio, not to your original data source.
export const output = "/studio_script/output_topic";

// This function is called with messages from your input topics.
// The first argument is an event with the topic, receive time, and message.
// Use the `Input<...>` helper to get the correct event type for your input topic messages.
export default function script(event: Input<"evelogger_vectornav_position_data">): LocationFix {
  return {
    timestamp: event.receiveTime,
    frame_id: "joe",
    position_covariance: [0,0,0,0,0,0,0,0,0],
    latitude: event.message.evelogger_vectornav_latitude,
    longitude: event.message.evelogger_vectornav_longitude,
    position_covariance_type: 0,
    altitude: 0
  };
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant