Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ateam_msgs/msg/RobotMotionCommand.msg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ float64 limit_acc_angular # (rad/s/s)
# pivot parameters
float64 pivot_orbit_radius # (m)
float64 pivot_inset_angle # (rad)
uint8 pivot_direction # orbit drive direction: PD_FORWARD=0, PD_BACKWARD=1
bool pivot_compute_inset_angle # if true, firmware derives inset_angle from peak angular vel

uint8 kick_request
float32 kick_speed # (m/s)
Expand All @@ -25,11 +27,16 @@ uint8 KR_CHIP_NOW = 5
uint8 KR_CHIP_TOUCH = 6
uint8 KR_CHIP_CAPTURED = 7

# pivot direction (orbit drive direction)
uint8 PD_FORWARD = 0
uint8 PD_BACKWARD = 1

# body control modes
uint8 BCM_OFF = 0
uint8 BCM_GLOBAL_POSITION = 1
uint8 BCM_GLOBAL_VELOCITY = 2
uint8 BCM_LOCAL_VELOCITY = 3
uint8 BCM_GLOBAL_ACCEL = 4
uint8 BCM_LOCAL_ACCEL = 5
uint8 BCM_PIVOT = 6
uint8 BCM_HEADING_PIVOT = 6
uint8 BCM_POINT_PIVOT = 7
25 changes: 21 additions & 4 deletions radio/ateam_radio_bridge/src/radio_bridge_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,31 @@ class RadioBridgeNode : public rclcpp::Node
static_cast<float>(command.acceleration.theta),
};
break;
case ateam_msgs::msg::RobotMotionCommand::BCM_PIVOT:
control_msg.body_control_mode = BCM_PIVOT;
control_msg.cmd.pivot = {
case ateam_msgs::msg::RobotMotionCommand::BCM_HEADING_PIVOT:
control_msg.body_control_mode = BCM_HEADING_PIVOT;
control_msg.cmd.heading_pivot = {
static_cast<float>(command.pose.theta),
static_cast<float>(command.limit_vel_angular),
static_cast<float>(command.limit_acc_angular),
static_cast<float>(command.pivot_orbit_radius),
static_cast<float>(command.pivot_inset_angle)
static_cast<float>(command.pivot_inset_angle),
static_cast<PivotDirection>(command.pivot_direction),
static_cast<uint8_t>(command.pivot_compute_inset_angle),
{0, 0}
};
break;
case ateam_msgs::msg::RobotMotionCommand::BCM_POINT_PIVOT:
control_msg.body_control_mode = BCM_POINT_PIVOT;
control_msg.cmd.point_pivot = {
static_cast<float>(command.pose.x),
static_cast<float>(command.pose.y),
static_cast<float>(command.limit_vel_angular),
static_cast<float>(command.limit_acc_angular),
static_cast<float>(command.pivot_orbit_radius),
static_cast<float>(command.pivot_inset_angle),
static_cast<PivotDirection>(command.pivot_direction),
static_cast<uint8_t>(command.pivot_compute_inset_angle),
{0, 0}
};
break;
default:
Expand Down
3 changes: 2 additions & 1 deletion radio/ateam_radio_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ set(RADIO_STRUCTS_TO_GENERATE
LocalVelocityCommand
GlobalAccelerationCommand
LocalAccelerationCommand
PivotCommand
PointPivotCommand
HeadingPivotCommand
BasicTelemetry
ErrorTelemetry
ExtendedTelemetry
Expand Down
Loading