Ask Your Question

turtlesim's draw_square only draws 3/4 of the square (like "|_|") and then it spins forever

asked 2018-05-30 03:22:25 -0600

updated 2018-05-30 04:05:15 -0600

The draw_square node from the turtlesim package, if installed from source , only draws "|_|" (3/4 of the square instead of a full square) and then the turtle spins forever.

Strangely, if I run draw_square from the built-in turtilesim everything looks normal. Has anyone encountered this issue?

Alternatively, I would need to know how to get the exact source code that was used to build into the built-in turtlesim.

I tried to retrieve source with "apt-get source turtlesim", but the command failed saying that "E: Unable to find a source package for turtlesim". Also I am unsure whether that command would retrieve the right version. Any idea? Thanks.

$ cat /etc/apt/sources.list.d/ros-latest.list

deb xenial main

deb-src xenial main

edit retag flag offensive close merge delete


What branch were you on when it only drew part of the square?

jarvisschultz gravatar image jarvisschultz  ( 2018-05-30 08:20:26 -0600 )edit

branch: melodic-devel, commit-hash: 821a8ae33c6da1a70e21453392f6980380f670f8

Zhoulai Fu gravatar image Zhoulai Fu  ( 2018-05-30 17:15:38 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-31 11:46:42 -0600

updated 2018-06-01 08:40:54 -0600

The error is almost certainly related to this commit that was merged in via this PR. The issue is that the draw_square node they don't check for goals being in the range of [-pi,pi). The result is not properly handling angle wrapping when checking if the turtle has reached its goal.

As a fast fix, you could just check out an older branch and everything should work.

I've filed a bug report.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-05-30 03:22:25 -0600

Seen: 436 times

Last updated: Jun 01 '18