BCLab-UNM / SC2

Swarmathon Team Code for the NASA Space Challenge 2 Competition
MIT License
2 stars 0 forks source link

Fix/Update driving controller for Finals #158

Closed Carter90 closed 3 years ago

Carter90 commented 3 years ago

So the ability to drive the rover was completely broken they even removed the controller, luckily there are many off the shelf that should do a better job currently take your pick https://github.com/ros-controls/ros_controllers/

useful files to know where they live

./SC2/srcp2-competitors/ros_workspace/install/share/srcp2_models_final/urdf/rovers/small_scout/small_scout.xacro ./SC2/srcp2-competitors/ros_workspace/install/share/srcp2_models_final/urdf/rovers/common/universal_wheel.xacro

install me

sudo apt install ros-noetic-four-wheel-steering-controller sudo apt install ros-noetic-teleop-twist-keyboard

files to start with

wget https://raw.githubusercontent.com/ros-controls/ros_controllers/noetic-devel/four_wheel_steering_controller/test/config/four_wheel_steering_controller_twist_cmd.yaml wget https://raw.githubusercontent.com/ros-controls/ros_controllers/noetic-devel/four_wheel_steering_controller/test/launch/four_wheel_steering_common.launch

NOTE

I was unsuccessful restoring the old controller to a working state I got it to run but was unable to connect to it with teleop after lots of digging probably for the best roslaunch simple_robot_controller.launch robot_name:=small_scout_1 many other files and launches modified

Carter90 commented 3 years ago

So Runaround Robotics says there is a pull req https://gitlab.com/scheducation/srcp2-final-public/-/issues/62 I'm guessing its https://github.com/ros-controls/ros_controllers/pull/441

abbypribis commented 3 years ago

Check driver-controller branch for beginnings of controller To test:

  1. cd SC2, catkin clean -y, source srcp2-final-public/ros_workspace/install/setup.bash, catkin build, source ./devel/setup.bash
  2. Start sim - srcp2-final-public/docker/scripts/run_srcp2_final
  3. Start drive controller - rosrun drive-controller drive-controller.py - should get message init_node
  4. Drive robot around - rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=/small_scout_1/cmd_vel - hold down Shift for strafing
  5. Kill sim - docker kill $(docker ps -q)
abbypribis commented 3 years ago

Robot does not go backwards correctly (wheels freak out) and overturns.

Implement the turning limits from the code we borrowed - see if that fixes it.

Also, gotta fix that semaphore/blocking so that drive messages aren't getting written over/interrupted