UML – bug_m PY node
bug_m combines the two behaviours go_to_point.py ans wall_follow.py in order to reach a given position in a indoor environment with walls.
IN particular,
(state 2) the robot is still, waiting for a target
(a target distant at minimum 0.35m comes…)
( state 0 : go to point ) go ahead in straight line
change to state 1 if the robot encounters an obstacle
change to state 0 if the robot reaches the target
( state 1 : wall following ) find and follow the wall
change to 0 if the robot cannot go on (the robot could get stuck in a blind corner)
change to state 2 if the robot is in the target
the robot reaches a target with a threshold distance of 0.35m from the marker.
SCHEMA
HOW TO use the node – basic way
it requires another node listening for the odom channel and checking when to deactivate the service
set
des_pos_x,des_pos_yanddes_yawinto the paramater serveractivate the service with a request to
/bug_m_switchof typestd_srvs/SetBool(flagSetBool.Request.data=True)… wait until the robot is near enough to the point
turn off the node (flag
SetBool.Request.data=False)
HOW TO use the node – user interface
the node can signal another node when the final position hasn’t been reached.
set
des_pos_x,des_pos_yanddes_yawinto the paramater serveractivate the service with a request to
/bug_m_switchof typestd_srvs/SetBool(flagSetBool.Request.data=True)open a client with
/bug_m_signalof typestd_srvs/Empty… wait …
when the robot is near to the target point, the node bug_m calls the service
from this, the node can infer that the node has reached the final position