Skip to content

TFJS Examples Cart Pole Renderer Bug #8538

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

Open
Kinvert opened this issue Apr 3, 2025 · 0 comments
Open

TFJS Examples Cart Pole Renderer Bug #8538

Kinvert opened this issue Apr 3, 2025 · 0 comments
Assignees
Labels
type:bug Something isn't working

Comments

@Kinvert
Copy link

Kinvert commented Apr 3, 2025

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.

@Kinvert Kinvert added the type:bug Something isn't working label Apr 3, 2025
@shmishra99 shmishra99 self-assigned this Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants