Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Conversation

@oswinso
Copy link
Contributor

@oswinso oswinso commented Nov 6, 2019

Description

We currently have no idea what values our MBED is sending to the motors, which is kind of scary, and hard to debug controls problems.

This PR does the following:

  • Creates a igvc_msgs::motor_control message type for modelling the MBED output to the motors (0 - 255)
  • Updates the igvc.pb.c and igvc.pb.h to include the new left_output and right_output fields
  • Updated motor_controller to extract the motor outputs and publish them.

Fixes #403.

Testing steps (If relevant)

Test on Jessii

  1. Launch motor_controller on Jessii and a joystick node, with wheels decoupled
  2. rostopic echo /motor_output
  3. Move the joystick around

Expectation: It should values corresponding to what you are joysticking

Self Checklist

  • I have formatted my code using make format
  • I have tested that the new behaviour works

Created motor_control message type for motor output
Updated motor_controller to extract and publish motor output
@oswinso oswinso added type ➤ new feature New features, improvements to existing features. level ➤ easy Easy difficulty area ➤ firmware Issues relating to firmware labels Nov 6, 2019
Copy link
Contributor

@Dallas-D Dallas-D left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some questions about some of your changes

motor_control.left = static_cast<uint8_t>(response.left_output);
motor_control.right = static_cast<uint8_t>(response.right_output);
motor_control.duration = ros::Duration(response.dt_sec);
motor_control.header.stamp = ros::Time::now() - motor_control.duration;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you subtracted duration from the current time. What do you want the header time to represent?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area ➤ firmware Issues relating to firmware level ➤ easy Easy difficulty type ➤ new feature New features, improvements to existing features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return motor controller PWM values

3 participants