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

2D Plot Node Template: Unions are not allowed in return type #613

Open
rowandempster opened this issue Apr 6, 2021 · 0 comments · May be fixed by #624
Open

2D Plot Node Template: Unions are not allowed in return type #613

rowandempster opened this issue Apr 6, 2021 · 0 comments · May be fixed by #624

Comments

@rowandempster
Copy link

rowandempster commented Apr 6, 2021

Copying directly from the given template:

import { Input, Messages } from "ros";
import { TwoDimensionalPlot, TwoDimensionalPlotLine } from "./types";

type GlobalVariables = { id: number };

export const inputs = ["/mpc_stats"];
export const output = "/webviz_node/";

// Populate 'Input' with a parameter to properly type your inputs, e.g. 'Input<"/your_input_topic">'
const publisher = (
  message: Input<"/mpc_stats">,
  globalVars: GlobalVariables
): TwoDimensionalPlot => {
  const lines: TwoDimensionalPlotLine[] = [];
  const points: TwoDimensionalPlotLine[] = [];
  const polygons: TwoDimensionalPlotLine[] = [];

  return {
    lines,
    points,
    polygons
  };
};

export default publisher;

Gives the TS compilation error Unions are not allowed in return type.DatatypeExtraction

TwoDimensionalPlot contains the union PointStyle, is this the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant