Package: pyagxrobots
This is Python API for Agilex RoboticsThis is a python API for CAN communication with Agilex RoboticsInstallationNotes:Make sure that python version >=3.4. if you have python3 and python2 ,please use python3Communication protocolRobotProtocol V2CANSupport StatusScout 2.0YYActiveScout MiniYYActiveHunter 2.0YYActiveBunkerYYActiveTracerYYActivepip$pip3installpyagxrobotsNotes:Make sure that pip3 version >= 9.0.0.cheak the pip3 version$pip3-Vupdata pip3$python3-mpipinstall--upgradepipSetup CAN-To-USB adapterEnable gs_usb kernel module$sudomodprobegs_usbBringup can device$sudoiplinksetcan0uptypecanbitrate500000If no error occured during the previous steps, you should be able to see the can device now by using command$ifconfig-aInstall and use can-utils to test the hardware$sudoaptinstallcan-utilsTesting command# receiving data from can0$candumpcan0# send data to can0$cansendcan0001#1122334455667788You can run  step 1-5  for the first-time setup and run step 2 to bring up the device each time you  unplug and re-plug the adapter.import to your project#!/usr/bin/env python3# coding=utf-8importpyagxrobotsrobots=pyagxrobots.pysdkugv.robotstype()#    robotstype depend on your robotfunction list:EnableCAN()SetMotionCommand()SetLightCommand()GetRobotStae:MotionCommandMessage:GetLinearVelocity()GetAngularVelocity()GetLateralVelocity()GetSteeringAngle()LightCommandMessage:GetLightCmdCtrl()GetFrontMode()GetFrontCustom()GetRearMode()GetRearCustom()SystemStateMessage:GetVehicleState()GetControlMode()GetBatteryVoltage()GetErrorCode()RcStateMessage:OdometryMessage:GetLeftWheel()GetRightWheel()ActuatorStateMessageV2:rpm()current()pulse_count()driver_voltage()driver_temp()motor_temp()driver_state()EnableCANPrototype:EnableCAN()Description: Enable command and control mode.SetMotionCommandPrototype:SetMotionCommand()Description:Send Version Request to robots.Parameterslinear_vel:(float)angular_vel:(float)lateral_velocity:(float)steering_angle:(float)GetLinearVelocityPrototype:GetLinearVelocity()Description:Get the linear velocity from robotReturn:linear velocityGetAngularVelocityPrototype:GetAngularVelocity()Description:Get the angular velocity from robot.Return:angular velocityGetSteeringAnglePrototype:GetSteeringAngle()Description:Get the steering angle from robot .Return:steering angleGetLateralVelocityPrototype:GetLateralVelocity()Description:Get the lateral velocity from robot .Return:lateral velocityGetControlModePrototype:GetControlMode()Description:Get the control mode from robot .Return:control modeGetLeftWheelOdeomPrototype:GetLeftWheelOdeo()Description:get robots LeftWheelOdom .Return:LeftWheelOdomGetRightWheelOdomPrototype:GetRightWheelOdom()Description:get robots RightWheelOdom .Return:RightWheelOdeomGetBatteryVoltagePrototype:GetBatteryVoltage()Description:Get the battery voltage from robotReturn:battery voltageGetErrorCodePrototype:GetErrorCode()Description:Get the error code from robotReturn:error codeExampleNote:For safety, please ensure that the robot's wheels are off the ground1.ScoutMini#!/usr/bin/env python3# coding=UTF-8importpyagxrobotsimporttimescoutmini=pyagxrobots.pysdkugv.ScoutMiniBase()scoutmini.EnableCAN()num=5whilenum>0:scoutmini.SetMotionCommand(linear_vel=0.1)print(scoutmini.GetLinearVelocity())time.sleep(0.3)num-=12.Bunker#!/usr/bin/env python3# coding=UTF-8importpyagxrobotsimporttimebunker=pyagxrobots.pysdkugv.BunkerBase()bunker.EnableCAN()num=5whilenum>0:bunker.SetMotionCommand(linear_vel=0.1)print(bunker.GetLinearVelocity())time.sleep(0.3)num-=1