Skip to content

TFJS Examples Cart Pole Renderer Bug #8538

Open
@Kinvert

Description

@Kinvert

Please make sure that this is a bug. As per our
GitHub Policy,
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: No
  • TensorFlow.js installed from (npm or script link): Your demo
  • TensorFlow.js version (use command below): Your demo
  • Browser version: Chrome
  • Tensorflow.js Converter Version: Your demo

Describe the current behavior
Pole leans the wrong way

Describe the expected behavior
Pole leans the correct way

Standalone code to reproduce the issue
const poleTopX =
halfW + scale * (cartPole.x + Math.cos(angle) * cartPole.length);

Other info / logs
It's in your demo

I'd like to fix:

const poleTopX =
halfW + scale * (cartPole.x + Math.cos(angle) * cartPole.length);

to:

const poleTopX =
halfW + scale * (cartPole.x - Math.cos(angle) * cartPole.length);

I wanted to just create a PR but https://github.com/tensorflow/tfjs-examples?tab=readme-ov-file#contributing says to make an issue first. I went to make an issue there, but couldn't. So I used the link you provided and it took me to this repo instead.

I just want to make a PR to swap that negative and get Cart Pole to render properly in your demo.

I've already got the clone and have it working. I would have just submitted the PR but your instructions made it sound like you wanted this Issue created first.

Metadata

Metadata

Assignees

Labels

type:bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions