Skip to content

Comments

Mock Encoder Speed Up#2

Merged
phantamanta44 merged 26 commits intomasterfrom
MockEncoderSpeedUp
Apr 7, 2021
Merged

Mock Encoder Speed Up#2
phantamanta44 merged 26 commits intomasterfrom
MockEncoderSpeedUp

Conversation

@bennowotny
Copy link
Contributor

This branch has been tested to alter the encoder speed appropriately when running with the RoboclawMocks. This also creates an (optional) time_warp parameter in ROSlaunch files to control the factor by which the encoders' speed is changed.

This also resolves #1.

…P variable that affects how fast each encoder changes.
… well and pass it into the MockVelCtrl's static TIME_WARP variable.
…pass that through to the RoboclawMock if applicable.
… 1) and pass that through as a parameter to the roboclaw initialization.
@bennowotny bennowotny requested a review from phantamanta44 April 4, 2021 02:43
bennowotny added a commit to WisconsinRobotics/WRover_Software_23-24 that referenced this pull request Apr 4, 2021
…e to track an independent max speed for each MockVelCtrl.
…e_warp` variable due to transition to the instance implementation.
…t/right max encoder speed and pass the new max speeds to the appropriate MockVelCtrl.
…anges to treat the encoders as dictionaries and added a method to safely get encoder properties from those dictionaries. Added functionality to pass max encoder speeds down to the Roboclaws through their updated interface.
…RoboclawMock as they are not available at that time.
…ncoder dictionary rather than a simple t/f flag.
bennowotny added a commit to WisconsinRobotics/WRover_Software_23-24 that referenced this pull request Apr 5, 2021
@bennowotny
Copy link
Contributor Author

The NEW implementation of encoder speed-ups is now available in this PR. In this new version, rather than one TIME_WARP variable, separate max_speed variables are available for each encoder in each RoboclawMock. This requires changing encoder-dependent config files slightly, making the encoders a dictionary like the following example:

enc_left:
  enabled: true
  max_speed: 10000
enc_right:
  enabled: true
  max_speed: 10000

-Approx. quote @phantamanta44

Another example of how this works can be found in WisconsinRobotics/WRover_Software_23-24@abf59d6.

…rases relating to 'encoder', removed RoboclawMock TODO.
…g to ClawDef.__init__ in a manner that forces an error if the encoder dictionary is not defined correctly.
@bennowotny bennowotny requested a review from phantamanta44 April 7, 2021 02:07
@bennowotny
Copy link
Contributor Author

Program passed testing with the WRover21_Software arm control system as of 5847d77.

@phantamanta44 phantamanta44 merged commit 3023e1f into master Apr 7, 2021
@bennowotny bennowotny deleted the MockEncoderSpeedUp branch April 7, 2021 23:39
bennowotny added a commit to WisconsinRobotics/WRover_Software_23-24 that referenced this pull request Apr 8, 2022
* Actually added the Arm MoveIt files this time.

* Added a wr_control_arm package.

* Created the Action server file.

* Added ArmControlSystem source file with default logic for a simple action server.

* Added wr_control_arm package build files, currently debugging a build error on catkin_make.

* Build succeeds on changes logged.

* Recompiled wroboarm_21 for ROS package detection.

* Added a RViz launch file to test MoveIt/WRobot integration.

* Moved wr_control_arm to pre-existing package wr_control_drive_arm and tested the SimpleActionServer with MoveIt configuration in the demo_test.launch wroboarm_21 launch file.  MoveIt confirmed to be talking to the server and hearing the A-OK message.

* Added an ArmMotor class to represent the per motor logic and abstract/avoid repitition on the details of driving to a position and setting power.

* More progress on ArmMotor.cpp, implemented simple runToTarget methods and server actions.

* Control loop added, missing ROS logic (spins and such) and publishing TF/Joint State data.

* Added framework of publishing Joint State data.

* Moved and resorted the CMakeLists and package files for the arm and science control subsystems.

* Modified the demo_test.launch file to run the 'real' robot and read joint states from the right source.

* Updated source code to correctly implement header functions, avoid duplicate definition, include all methods used, and compile.

* Modified CMakeLists and package.xml to depend on the new sensor_msgs needed for publishing Joint State data and to compile ArmControlSystem.cpp and ArmMotor.cpp together.

* Re-referenced the wroboclaw topics; wroboclaw topics aren't spelled with the leading 'w'.

* Updated motor power message types for the arm control system to use Int16 and not UInt16.  Patched the warning of integer overflow for the COUNTS_PER_ROTATION constant.

* Updated ArmMotor to fix ArmControlSystem encoder issue; patch reached by making the ArmMotor array into an ArmMotor* array, which avoids instantiation entirely until necessary.

* Modified the ArmMotor constructor to accept NodeHandle pointers rather than NodeHandles themselves.

* Changed ArmMotor constructor parameter error messages to more accurately reflect the problem described.

* Changed ArmMotor rad->enc and enc->rad methods to accurately compute the radians or encoders on their proper bounds, moved the two methods closer for readability.

* Updated encoder math to reflect the boundries of the encoders and use the right datatypes to encapsulate the values; made the encoder bounds and COUNTS_PER_ROTATION into static constant variables.

* Updated encoder datatypes to reflect C++ standard for data size requirement.

* Added test launch script for the arm control stack.

* Removed noisy debugging code from ArmControlSystem.cpp; errors not removed with it.

* Modified the encoder/radian transformation to actually modify the actual transformation desired in accordance with the tests here: https://www.desmos.com/calculator/j8zidhiefy

* Modified the formulas again due to C++ negative modulus behaviour.  Added some moderately noisy but tolerable debugging information.

* Added a sleep rate for realism for the actual robot, amped the speed of the arm for testing purposes.

* Improved readability of ArmControlSystem.cpp.

* Added an Euclidean-correct modulus function for mathematical consistency and updated the rad<->enc conversion functions to be consistent with https://www.desmos.com/calculator/nwxtenccc6.

* Updated `COUNTS_PER_ROTATION` to be the actual UINT32 limit; apparently UINT_FAST32 is something else.

* Updated the default encoder tolerance to statically reflect ±0.1 degree tolerance w.r.t. the `COUNTS_PER_ROTATION`.

* Added the `time_warp` parameter to the mock launch file in anticipation of WisconsinRobotics/wroboclaw#2.

* Updated the demo_test.launch file to disable trajectory execution timeouts.  This could be replaced in the future with the multiplier parameter `move_group/trajectory_execution/allowed_execution_duration_scaling` that extends the execution timout by a scalar multiplier or `move_group/trajectory_execution/allowed_goal_duration_margin` for adding a fixed time tolerance to motions.

* Updated the Arm Control stack test script to re-navigate back to the original directory, regarless of where the script was called.

* Updated encoder data types to reflect the amount of data stored in them (x64 processors default to 32 bits/integer).

* Updated the roboclaw_mock launch file and the roboclaw_enc config file to be prepared for the new implementation of WisconsinRobotics/wroboclaw#2.

* Started documentation, removed unneccesary checks from the code.

* Continued documentation, removed use of `temp` variable to track if the current position is completed as the value can be stored in the existing variable already.

* Continued documentation, added `TODO`s for future work.

* Continued documentation.

* Updated documentation to be doxygen-compatible.

* Updated Doxygen link.

* Added ArmMotor.hpp doxygen documentation, removed unneeded methods.

* Added doxygen comments to ArmMotor.cpp, removed unecessary methods and logic.

* Updated ArmMotor::corrMod to a simpler implementation.

* Added velocity scaling to the arm, assumed speed 0.1 on the last motion.  Added debugging information relavant to velocity scaling.

* Added TODO for future type conversion

The future type conversion creates platform independence, since only 64 bit processors have 32 bit integers. (32 bit processors would throw errors)

* Updated TODO by migrating encoder data types to `uint32_t` for platform independence.

* Added a signal handler to kill the action server if `^C` or `SIGINT` signal is given.

* Adding support for PID position control to arm joints.

* Updated PID calculation method to use radians instead of encoder counts, resolved pointer-based error occurring when server.setSucceeded is called.

* Updating the arm URDF files to contain joint limits to prevent overturning.

* Adding rqt_plot to the arm launch script to see joint state data and controller responses.

* Adding support for PID control, post-testing.

* PID Tuning.

* Updated arm teleop logic, currently segfaults.

* Added the arm teleop file (the one that currently segfaults).

* Added a 'control' group tag to the wr_control_drive_arm nodes for organization.

* Added effective `rosrun` control to wr_logic_teleop_arm.

* Modified the ArmTeleopLogic system to plan to a predetermined spot and move there.  Confirmed to work.

* Removed the visual to set the goal of the arm from the RViz layout for cleanliness.

* Modified stepping logic and how the test simulation works.

* Disabled `rqt_plot` tracking by comment, lengthened the timing to start the ArmTeleopLogic `rosrun`.

* Adding the `apt` dependency to `ros-noetic-moveit` to the build script.

* Added controller functionality for the Arm (yay!).  Tested with XBox-like controller.

* Adding rotational logic and controller support.

* Updating rotation calculations to no transformations.

* fixed drive science cmake files

* fixed teleop bug, changed vel/accel scaling, rviz panels hidden by default

* Removed Yaw(i think and some basic configuration)

* atomic reference trigger

* fixed cached msg bug - TOFIX: isDone not functioning correctly

* fixed blocked planning, bad state info w/ async plan method

* working dummy link

* Added link 7 to some places and chmod file

* dummy axis fully integrated in IK

* c++ pointers are dumb

* added redundant linear transformation function

* add differential transmission

* Using ssh instead of git to pull.

* Working model.

* Dev/arm stall (#19) (#20)

* header for differential joint class

* joint progress: non functional

* simple joint compiles, does not work

* differential joint - compiles - untested

* position handoff is working, velocity untested

* gpp is very unhappy

* almost

* added checks for stall in ArmMotor and up

* debugging

* debugging: fixed issues with incompatible variables, added TODO in execute method of ArmControlSystem

* Updated implementation incorporating actual motor current publishers

* Began services

* More service/client implementation and comments

* Dev/differential joint (#18)

* compiles

* execution working, error with wrist  matrix

* fully functional - need mocked writst logic

* Dev/new urdf (#17)

* model working, trajectory data if wrong

* working :)

* good joint limits

* controller mapping changes

* simple joint abstraction workging with new model

* differentail joint working

* fixed entry point launch file conflicts

* fixed teleop bug and combined arm test into one launch file

* Arm viz (#16)

* added motor specfic bound + offset for arm

* mocked roboclaws working with new encoders

* fixed encToRad

* ready to test

* fixed launch files

* fixed diff joint encoder reading

* Config file and setup changes due allow robot to run normally, and then add visualization on top.  There are pending logical and setup errors in at minimum ArmControlSystem.cpp that must be fixed prior to testing.

* debugging for publish()

* Updating `corrMod` implementation.

* lint

* lint-b-gone

* liiiiiiiiiiiint

* Tuning/preliminary homing updates.

* Parameterizing offset/ratio parameters for the arm.  Initializing default position to be offset ("home").

* Further tuning updates.

Co-authored-by: Nicholas Underwood <ndunderwood@wisc.edu>
Co-authored-by: WR-BaseStation <wisconsinrobotics@cae.wisc.edu>
Co-authored-by: Arthur Wang <arwang5@wisc.edu>

Co-authored-by: Nicholas <nachos.underwood@gmail.com>
Co-authored-by: Nicholas Underwood <ndunderwood@wisc.edu>
Co-authored-by: WR-BaseStation <wisconsinrobotics@cae.wisc.edu>
Co-authored-by: Arthur Wang <arwang5@wisc.edu>

Co-authored-by: Nicholas <nachos.underwood@gmail.com>
Co-authored-by: Nicholas Underwood <ndunderwood@wisc.edu>
Co-authored-by: WR-BaseStation <wisconsinrobotics@cae.wisc.edu>
Co-authored-by: Arthur Wang <arwang5@wisc.edu>

Co-authored-by: Nicholas <nachos.underwood@gmail.com>
Co-authored-by: Arthur Wang <arwang5@wisc.edu>
Co-authored-by: Nicholas Underwood <ndunderwood@wisc.edu>
Co-authored-by: WR-BaseStation <wisconsinrobotics@cae.wisc.edu>

Co-authored-by: Nicholas <nachos.underwood@gmail.com>
Co-authored-by: Arthur Wang <arwang5@wisc.edu>
Co-authored-by: Nicholas Underwood <ndunderwood@wisc.edu>
Co-authored-by: WR-BaseStation <wisconsinrobotics@cae.wisc.edu>

Co-authored-by: Nicholas <nachos.underwood@gmail.com>
Co-authored-by: Dev <devmehrotra63@gmail.com>
Co-authored-by: Arthur <arthur.wang200255@outlook.com>
Co-authored-by: Arthur Wang <arwang5@wisc.edu>
Co-authored-by: Nicholas Underwood <ndunderwood@wisc.edu>
Co-authored-by: WR-BaseStation <wisconsinrobotics@cae.wisc.edu>
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

Successfully merging this pull request may close these issues.

WRoboclaw Mock Encoders Move Too Slow for Testing Purposes.

2 participants