Skip to content

Wheel lights #21

@RobertBlakeAnderson

Description

@RobertBlakeAnderson

I'm working on a feature to control the Pioneer wheel lights. Here's my service callback. It's based on the Aria example mtxWheelLights.cpp

bool RosArnlNode::wheel_light_cb(rosarnl::WheelLight::Request& request, rosarnl::WheelLight::Response& response)
{
  // Validate input
  if (request.mode < 1 || request.mode > 10 || request.value < 0 || request.value > 100) {
    return false;
  }

  struct {
    ArTypes::UByte pattern;
    ArTypes::Byte value;
    ArTypes::UByte flags;
    ArTypes::UByte flags2;
  } msg;

  msg.pattern = request.mode;
  msg.value = request.value;
  msg.flags = 0;
  msg.flags2 = 0;

  arnl.robot->comDataN(ArCommands::WHEEL_LIGHT, (const char*)&msg, 4);

  return true;
}

When I call the service, the wheel lights will flash the commanded mode for an instant, then go back to Ready mode. Is there something else I need to do to make the command stick?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions