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

My robot turns too much #133

Open
Pattapol2005 opened this issue Dec 8, 2024 · 2 comments
Open

My robot turns too much #133

Pattapol2005 opened this issue Dec 8, 2024 · 2 comments

Comments

@Pattapol2005
Copy link

My robot, when setting a navigation2 goal, turns more than expected. For example, when it needs to rotate 180 degrees to turn around, it rotates about 230 degrees and then turns to the right for a while before it can move straight towards the target. When it reaches the destination, the robot keeps spinning several times before stopping. Is this issue related to the PID settings in the Hardware Config? I have attached a YouTube video of the RViz window below. Thank you.

Rplidar A1M8 / Teenny 4.0 / Mecanum wheel

https://youtu.be/rKUoffeMrdY

@hippo5329
Copy link
Contributor

First, you should verify your RPM with test_motors and a tachometer. You should check the "stop", distance to stop. You should also run a full loaded test_acc.

https://github.com/hippo5329/linorobot2_hardware/wiki#test-the-motors-and-encoders

Next, you should verify your xxx_config.h for the wheels dimension and distance. And the urdf,

https://github.com/hippo5329/linorobot2_hardware/wiki#configure-urdf-in-linorobot2

For Mecanum driver, you will need to update the velocity smoother.

https://github.com/hippo5329/linorobot2_hardware/wiki#velocity-smoother---optional

The left-right wheels distance should be larger than that of differential drive. You should try front-right to rear-left distance.

@Pattapol2005
Copy link
Author

When I ran the command robot@Robot-ROS:~/linorobot2_hardware-master/test_motors$ pio run -e teensy40 -t upload, I encountered an issue as shown in the image.
Capture6 1 68

robot@Robot-ROS:~/linorobot2_hardware-master/test_motors$ pio run -e teensy40 -t upload
Processing teensy40 (board: teensy40; platform: teensy; framework: arduino)
----------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy (5.0.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES: 
 - framework-arduinoteensy @ 1.159.0 (1.59) 
 - tool-teensy @ 1.159.0 (1.59) 
 - toolchain-gccarmnoneeabi-teensy @ 1.110301.0 (11.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing importlib-resources with pip at PlatformIO environment
/home/robot/.platformio/penv/bin/python -m pip install importlib-resources
Requirement already satisfied: importlib-resources in /home/robot/.platformio/penv/lib/python3.8/site-packages (6.4.5)
Requirement already satisfied: zipp>=3.1.0 in /home/robot/.platformio/penv/lib/python3.8/site-packages (from importlib-resources) (3.20.2)
Installing pyyaml with pip at PlatformIO environment
/home/robot/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/robot/.platformio/penv/lib/python3.8/site-packages (6.0.2)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/robot/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/robot/.platformio/penv/lib/python3.8/site-packages (2.0.1)
Installing empy==3.3.4 with pip at PlatformIO environment
/home/robot/.platformio/penv/bin/python -m pip install empy==3.3.4
Requirement already satisfied: empy==3.3.4 in /home/robot/.platformio/penv/lib/python3.8/site-packages (3.3.4)
Configuring teensy40 with transport serial
Downloading micro-ROS dev dependencies
KeyError: 'foxy':
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/robot/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/robot/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/robot/.platformio/platforms/teensy/builder/main.py", line 175:
    target_elf = env.BuildProgram()
  File "/home/robot/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
    return self.method(*nargs, **kwargs)
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piobuild.py", line 62:
    env.ProcessProjectDeps()
  File "/home/robot/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
    return self.method(*nargs, **kwargs)
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piobuild.py", line 152:
    plb = env.ConfigureProjectLibBuilder()
  File "/home/robot/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
    return self.method(*nargs, **kwargs)
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 1202:
    project.install_dependencies()
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 987:
    if _is_builtin(spec):
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 979:
    for lb in self.env.GetLibBuilders():
  File "/home/robot/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
    return self.method(*nargs, **kwargs)
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 1115:
    lb = LibBuilderFactory.new(env, lib_dir)
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 60:
    obj = globals()[clsname](env, path, verbose=verbose)
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 153:
    self.process_extra_options()
  File "/home/robot/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 301:
    self.env.SConscript(
  File "/home/robot/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/robot/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/robot/linorobot2_hardware-master/test_motors/.pio/libdeps/teensy40/micro_ros_platformio/extra_script.py", line 171:
    build_microros()
  File "/home/robot/linorobot2_hardware-master/test_motors/.pio/libdeps/teensy40/micro_ros_platformio/extra_script.py", line 113:
    builder.run('{}/metas/{}'.format(main_path, selected_board_meta), cmake_toolchain.path, microros_user_meta)
  File "/home/robot/linorobot2_hardware-master/test_motors/.pio/libdeps/teensy40/micro_ros_platformio/microros_utils/library_builder.py", line 63:
    self.download_dev_environment()
  File "/home/robot/linorobot2_hardware-master/test_motors/.pio/libdeps/teensy40/micro_ros_platformio/microros_utils/library_builder.py", line 92:
    for repo in Sources.dev_environments[self.distro]:
=========================== [FAILED] Took 4.01 seconds ===========================

Environment    Status    Duration
-------------  --------  ------------
teensy40       FAILED    00:00:04.014
===================== 1 failed, 0 succeeded in 00:00:04.014 =====================

I have checked mecanum_properties.urdf.xacro and lino_base_config.h, and the values match the actual measurements of my robot.
Capture6 1 68 2
Capture6 1 68 3
Capture6 1 68 4

I have added a velocity smoother to navigation.yaml, but the robot still oversteers as before.
Capture6 1 68 5

Thank you for your assistance. I've been trying to resolve this issue on my own for a while, but I still haven't been able to fix it

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

2 participants