Robots¶
B-bot kinematic models. See Robot Models for a conceptual overview and command dictionaries.
Factory¶
robots
¶
HolonomicRobot
¶
Bases: BaseRobot
Source code in src/hivebr/engine/robots/holonomic.py
initial_pose
instance-attribute
¶
set_initial_pose
¶
reset
¶
state
¶
step
¶
Source code in src/hivebr/engine/robots/holonomic.py
draw_path
¶
draw
¶
Source code in src/hivebr/engine/robots/holonomic.py
DifferentialRobot
¶
Bases: BaseRobot
Source code in src/hivebr/engine/robots/differential.py
initial_pose
instance-attribute
¶
battery_charge_rate
instance-attribute
¶
enable_battery
¶
set_charging
¶
set_battery_parameters
¶
set_battery_parameters(
c_idle,
c_v,
c_w,
critical_battery=20,
working_battery=90,
battery_charge_rate=20,
)
Source code in src/hivebr/engine/robots/differential.py
set_battery_parameters_from_specs
¶
set_battery_parameters_from_specs(
voltage,
ah,
power_electronics,
power_motors_cruise,
v_cruise,
omega_cruise=0.0,
)
Calculates battery consumption coefficients from physical specifications. E_total = V * Ah * 3600 (Joules) Consumption (%/s) = (Power (W) / E_total) * 100
Source code in src/hivebr/engine/robots/differential.py
update_battery
¶
Updates battery level. If charging is True, increases battery at charge_rate (%/s).
Source code in src/hivebr/engine/robots/differential.py
set_initial_pose
¶
reset
¶
state
¶
step
¶
Source code in src/hivebr/engine/robots/differential.py
draw_path
¶
draw
¶
Source code in src/hivebr/engine/robots/differential.py
AckermannRobot
¶
Bases: BaseRobot
Source code in src/hivebr/engine/robots/ackermann.py
initial_pose
instance-attribute
¶
set_initial_pose
¶
reset
¶
state
¶
step
¶
Source code in src/hivebr/engine/robots/ackermann.py
draw_path
¶
draw
¶
Source code in src/hivebr/engine/robots/ackermann.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
BoatRobot
¶
Bases: BaseRobot
Source code in src/hivebr/engine/robots/boat.py
initial_pose
instance-attribute
¶
set_initial_pose
¶
reset
¶
state
¶
step
¶
Source code in src/hivebr/engine/robots/boat.py
draw_path
¶
draw
¶
Source code in src/hivebr/engine/robots/boat.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
DifferentialRobotFirstOrder
¶
Bases: DifferentialRobot
Source code in src/hivebr/engine/robots/differential_firstorder.py
reset
¶
state
¶
set_initial_pose
¶
step
¶
Source code in src/hivebr/engine/robots/differential_firstorder.py
LineFollowerRobot
¶
Bases: DifferentialRobot
Robô diferencial com um arranjo de sensores analógicos de linha.
Mantém a mesma cinemática do :class:DifferentialRobot (comandos
{"v": ..., "omega": ...}), mas adiciona um conjunto de sensores
TCRT5000 montados numa barra horizontal na frente do corpo. O corpo é um
quadrado de length x width (padrão 10cm x 10cm).
Os sensores são amostrados a partir de um :class:LineTrackMap através de
:meth:read_line_sensors, que retorna valores analógicos em [0, 1]
(1 = linha preta, 0 = fundo claro) e calcula o erro de posição da
linha em relação ao centro do robô.
Configuração (bloco robot):
num_sensors
Número de sensores (tipicamente 2, 5 ou 8). Padrão 5.
sensor_offset
Distância à frente do centro do robô, em metros.
sensor_span
Largura total ocupada pelo arranjo, em metros.
sensor_aperture
Raio da área amostrada por cada sensor, em metros.
sensor_noise
Desvio-padrão do ruído analógico adicionado à leitura.
line_threshold
Limiar acima do qual o sensor é considerado "sobre a linha".
Source code in src/hivebr/engine/robots/line_follower.py
sensor_offset
instance-attribute
¶
lap_detection_radius
instance-attribute
¶
reset_laps
¶
Zera o cronômetro e as estatísticas de voltas/percurso.
Source code in src/hivebr/engine/robots/line_follower.py
reset
¶
set_initial_pose
¶
state
¶
Source code in src/hivebr/engine/robots/line_follower.py
lap_statistics
¶
Resumo das voltas (contagem, última, média, melhor, pior).
Source code in src/hivebr/engine/robots/line_follower.py
sensor_world_position
¶
Posição no mundo do sensor index.
Source code in src/hivebr/engine/robots/line_follower.py
read_line_sensors
¶
Amostra os sensores e atualiza line_error/line_lost.
Parameters¶
line_map:
Um :class:LineTrackMap. Se None, devolve leituras nulas.
Returns¶
numpy.ndarray
Leituras analógicas em [0, 1] (1 = linha preta).
Source code in src/hivebr/engine/robots/line_follower.py
step
¶
draw
¶
Source code in src/hivebr/engine/robots/line_follower.py
create_robot
¶
Source code in src/hivebr/engine/robots/__init__.py
create_fleet
¶
Build the list of B-bots from config['robots'].
Falls back to a single robot built from config['robot'] when no fleet
is declared, so mono-robot scenarios are just N=1. Each entry may override
any field of config['robot'] (type, initial_pose, radius, ...) and may
carry an optional color used for rendering and path tracing.
Source code in src/hivebr/engine/robots/__init__.py
Base class¶
BaseRobot
¶
Differential drive¶
DifferentialRobot
¶
Bases: BaseRobot
Source code in src/hivebr/engine/robots/differential.py
initial_pose
instance-attribute
¶
battery_charge_rate
instance-attribute
¶
set_charging
¶
set_battery_parameters
¶
set_battery_parameters(
c_idle,
c_v,
c_w,
critical_battery=20,
working_battery=90,
battery_charge_rate=20,
)
Source code in src/hivebr/engine/robots/differential.py
set_battery_parameters_from_specs
¶
set_battery_parameters_from_specs(
voltage,
ah,
power_electronics,
power_motors_cruise,
v_cruise,
omega_cruise=0.0,
)
Calculates battery consumption coefficients from physical specifications. E_total = V * Ah * 3600 (Joules) Consumption (%/s) = (Power (W) / E_total) * 100
Source code in src/hivebr/engine/robots/differential.py
update_battery
¶
Updates battery level. If charging is True, increases battery at charge_rate (%/s).
Source code in src/hivebr/engine/robots/differential.py
enable_battery
¶
set_initial_pose
¶
reset
¶
state
¶
step
¶
Source code in src/hivebr/engine/robots/differential.py
draw_path
¶
draw
¶
Source code in src/hivebr/engine/robots/differential.py
Differential drive (first order)¶
DifferentialRobotFirstOrder
¶
Bases: DifferentialRobot
Source code in src/hivebr/engine/robots/differential_firstorder.py
initial_pose
instance-attribute
¶
battery_charge_rate
instance-attribute
¶
reset
¶
state
¶
set_initial_pose
¶
step
¶
Source code in src/hivebr/engine/robots/differential_firstorder.py
draw
¶
Source code in src/hivebr/engine/robots/differential.py
clear_path
¶
enable_battery
¶
set_charging
¶
set_battery_parameters
¶
set_battery_parameters(
c_idle,
c_v,
c_w,
critical_battery=20,
working_battery=90,
battery_charge_rate=20,
)
Source code in src/hivebr/engine/robots/differential.py
set_battery_parameters_from_specs
¶
set_battery_parameters_from_specs(
voltage,
ah,
power_electronics,
power_motors_cruise,
v_cruise,
omega_cruise=0.0,
)
Calculates battery consumption coefficients from physical specifications. E_total = V * Ah * 3600 (Joules) Consumption (%/s) = (Power (W) / E_total) * 100
Source code in src/hivebr/engine/robots/differential.py
update_battery
¶
Updates battery level. If charging is True, increases battery at charge_rate (%/s).
Source code in src/hivebr/engine/robots/differential.py
Differential drive with line sensors (TCRT5000)¶
LineFollowerRobot
¶
Bases: DifferentialRobot
Robô diferencial com um arranjo de sensores analógicos de linha.
Mantém a mesma cinemática do :class:DifferentialRobot (comandos
{"v": ..., "omega": ...}), mas adiciona um conjunto de sensores
TCRT5000 montados numa barra horizontal na frente do corpo. O corpo é um
quadrado de length x width (padrão 10cm x 10cm).
Os sensores são amostrados a partir de um :class:LineTrackMap através de
:meth:read_line_sensors, que retorna valores analógicos em [0, 1]
(1 = linha preta, 0 = fundo claro) e calcula o erro de posição da
linha em relação ao centro do robô.
Configuração (bloco robot):
num_sensors
Número de sensores (tipicamente 2, 5 ou 8). Padrão 5.
sensor_offset
Distância à frente do centro do robô, em metros.
sensor_span
Largura total ocupada pelo arranjo, em metros.
sensor_aperture
Raio da área amostrada por cada sensor, em metros.
sensor_noise
Desvio-padrão do ruído analógico adicionado à leitura.
line_threshold
Limiar acima do qual o sensor é considerado "sobre a linha".
Source code in src/hivebr/engine/robots/line_follower.py
sensor_offset
instance-attribute
¶
lap_detection_radius
instance-attribute
¶
initial_pose
instance-attribute
¶
battery_charge_rate
instance-attribute
¶
reset_laps
¶
Zera o cronômetro e as estatísticas de voltas/percurso.
Source code in src/hivebr/engine/robots/line_follower.py
reset
¶
set_initial_pose
¶
state
¶
Source code in src/hivebr/engine/robots/line_follower.py
lap_statistics
¶
Resumo das voltas (contagem, última, média, melhor, pior).
Source code in src/hivebr/engine/robots/line_follower.py
sensor_world_position
¶
Posição no mundo do sensor index.
Source code in src/hivebr/engine/robots/line_follower.py
read_line_sensors
¶
Amostra os sensores e atualiza line_error/line_lost.
Parameters¶
line_map:
Um :class:LineTrackMap. Se None, devolve leituras nulas.
Returns¶
numpy.ndarray
Leituras analógicas em [0, 1] (1 = linha preta).
Source code in src/hivebr/engine/robots/line_follower.py
step
¶
draw
¶
Source code in src/hivebr/engine/robots/line_follower.py
clear_path
¶
enable_battery
¶
set_charging
¶
set_battery_parameters
¶
set_battery_parameters(
c_idle,
c_v,
c_w,
critical_battery=20,
working_battery=90,
battery_charge_rate=20,
)
Source code in src/hivebr/engine/robots/differential.py
set_battery_parameters_from_specs
¶
set_battery_parameters_from_specs(
voltage,
ah,
power_electronics,
power_motors_cruise,
v_cruise,
omega_cruise=0.0,
)
Calculates battery consumption coefficients from physical specifications. E_total = V * Ah * 3600 (Joules) Consumption (%/s) = (Power (W) / E_total) * 100
Source code in src/hivebr/engine/robots/differential.py
update_battery
¶
Updates battery level. If charging is True, increases battery at charge_rate (%/s).
Source code in src/hivebr/engine/robots/differential.py
Holonomic¶
HolonomicRobot
¶
Bases: BaseRobot
Source code in src/hivebr/engine/robots/holonomic.py
initial_pose
instance-attribute
¶
set_initial_pose
¶
reset
¶
state
¶
step
¶
Source code in src/hivebr/engine/robots/holonomic.py
draw_path
¶
draw
¶
Source code in src/hivebr/engine/robots/holonomic.py
Ackermann¶
AckermannRobot
¶
Bases: BaseRobot
Source code in src/hivebr/engine/robots/ackermann.py
initial_pose
instance-attribute
¶
set_initial_pose
¶
reset
¶
state
¶
step
¶
Source code in src/hivebr/engine/robots/ackermann.py
draw_path
¶
draw
¶
Source code in src/hivebr/engine/robots/ackermann.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
Boat¶
BoatRobot
¶
Bases: BaseRobot
Source code in src/hivebr/engine/robots/boat.py
initial_pose
instance-attribute
¶
set_initial_pose
¶
reset
¶
state
¶
step
¶
Source code in src/hivebr/engine/robots/boat.py
draw_path
¶
draw
¶
Source code in src/hivebr/engine/robots/boat.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |