JetBot

Inherits from: WheeledRobot

JetBot

JetBot(ip, locomotion_port, camera_port)

Initialize a JetBot robot instance.

Arguments
ip (str)
required

IP address of the JetBot.

locomotion_port (str), optional

defaults to “8040”. Port number for locomotion control. Defaults to “8040”.

camera_port (str), optional

defaults to “8050”. Port number for camera access. Defaults to “8050”.

Returns

getPosition

JetBot.getPosition()

getPosition is not implemented for JetBot

getOrientation

JetBot.getOrientation()

getOrientation is not implemented for JetBot

getImage

JetBot.getImage(camera_name: Union[str, None], image_type: Union[str, None])

Return the image of camera. JetBot only has one camera so the arguments are ignored.

Arguments
camera_name (optional, Union[str, None])
required

unused, jetbot only has one camera

image_type (optional, Union[str, None])
required

unused, jetbot only has rgb images

Returns

Image

requested image and it capture parameters

setMotors

JetBot.setMotors(left_speed: float, right_speed: float)

Sets the speed of the motors for the JetBot. These values should be [-1.0, 1.0]

Arguments
left_speed (float)
required

Speed of the left motor [-1, 1]

right_speed (float)
required

Speed of the right motor [-1, 1]

Returns

stop

JetBot.stop()

Stops the motors of the JetBot

setCarControls

JetBot.setCarControls(steering: float, throttle: float, brake: float)

Control the JetBot using ackermann steering. Does not adjust speed, only steering

Arguments
steering (float)
required

yaw [-1, 1] radians

throttle (float), optional

None

brake (float), optional

None

Returns

setCarTargetSpeed

JetBot.setCarTargetSpeed(velocity: float, scaling_factor: float)

Set the speed of the JetBot for Ackermann control. Does not adjust steering

Arguments
velocity (float)
required

speed [0, 1]

scaling_factor (float), optional

Reduce the speed of the jetbot since 1.0 for jetbot is considerably faster than AirGenCar

Returns

None

rotate

JetBot.rotate(rate: float, duration: Union[float, None], scaling_factor: float)

Rotate the JetBot in place

Arguments
rate (float)
required

Throttle rate to apply during rotation. Positive rotates right, negative rotates left

duration (optional, Union[float, None])
required

How long to rotate in seconds

scaling_factor (float), optional

defaults to 8. Scaling factor for the rate to make it behave similar to simulation. Defaults to 8.0

Returns

Was this page helpful?