Skip to content

Latest commit

 

History

History
225 lines (136 loc) · 6.71 KB

File metadata and controls

225 lines (136 loc) · 6.71 KB

motion_stack.ros2.default_node package

Default ROS2 nodes provided by the motion stack.

Created using ros2.base_node as the API. Once you understand the API, feel free to overwrite methods of these default nodes in your own class. With this you can change or add behaviors.

Submodules

motion_stack.ros2.default_node.lvl1 module

class motion_stack.ros2.default_node.lvl1.DefaultLvl1

Bases: Lvl1Node

Default implementation of the Joint node of lvl1.

Refer to ros2.base_node.lvl1 for documentation on linking ros2 and python core of lvl1. This only makes use of this base to create the default implementation and give an example.

Publishers:

Topic Type Note
joint_commands JointState sent to motors (lvl0)
joint_read JointState sent to IK (lvl2)

Subscribers:

Topic Type Note
joint_states JointState coming from sensors (lvl0)
joint_set JointState coming from IK (lvl2)

Service server:

Topic Type Note
advertise_joints ReturnJointState JointState with the name of all joints

Timers: : - Sends to lvl2, freq.= ROS2_PARAMETER[mvmt_update_rate].

Startup: : - Sends empty message to lvl0 with only joint names.

alive_srv = (<class 'std_srvs.srv._empty.Empty'>, 'joint_alive', <rclpy.qos.QoSProfile object>)

Type:    Interf

subscribe_to_lvl2(lvl2_input)

  • Parameters: lvl2_input (Callable [ *[*List [JState ] ] , Any ])

subscribe_to_lvl0(lvl0_input)

  • Parameters: lvl0_input (Callable [ *[*List [JState ] ] , Any ])

publish_to_lvl0(states)

  • Parameters: states (List [JState ])

publish_to_lvl2(states)

  • Parameters: states (List [JState ])

frequently_send_to_lvl2(send_function)

  • Parameters: send_function (Callable [ [ ] , None ])

startup_action(core)

motion_stack.ros2.default_node.lvl1.create_advertise_service(node, lvl1)

Creates the advertise_joints service and its callback.

Callback returns a ReturnJointState.Response wich is a JointState with the name of all joints managed by the node. Other field of JointState are not meant to be used, but are filled with the latest data.

  • Parameters:
    • node (Node) – spinning node
    • lvl1 (JointCore) – lvl1 core

motion_stack.ros2.default_node.lvl1.main(*args, **kwargs)

motion_stack.ros2.default_node.lvl2 module

class motion_stack.ros2.default_node.lvl2.DefaultLvl2

Bases: Lvl2Node

Default implementation of the Joint node of lvl2.

Refer to ros2.base_node.lvl2.Lvl2Node for documentation on linking ros2 and python core of lvl1. This only makes use of this base to create the default implementation and give an example.

alive_srv = (<class 'std_srvs.srv._empty.Empty'>, 'ik_alive', <rclpy.qos.QoSProfile object>)

Type:    Interf

subscribe_to_lvl1(lvl1_input)

  • Parameters: lvl1_input (Callable [ *[*List [JState ] ] , Any ])

subscribe_to_lvl3(lvl3_input)

  • Parameters: lvl3_input (Callable [ [Pose ] , Any ])

publish_to_lvl1(states)

  • Parameters: states (List [JState ])

publish_to_lvl3(pose)

  • Parameters: pose (Pose)

startup_action(lvl2)

motion_stack.ros2.default_node.lvl2.main(*args, **kwargs)

motion_stack.ros2.default_node.mini_sim module

class motion_stack.ros2.default_node.mini_sim.MiniSim

Bases: Node

display_new_joints()

jsRecieved(jsMSG)

  • Return type: None
  • Parameters: jsMSG (JointState)

updateJS(state)

  • Return type: None
  • Parameters: state (JState)

integrateSpeed(state, updateTime)

refreshRviz(names=None)

  • Return type: None
  • Parameters: names (List *[*str ] | None)

send_upward(names=None)

  • Return type: None
  • Parameters: names (List *[*str ] | None)

static jsIsMoving(js)

  • Return type: bool
  • Parameters: js (JState)

getSpeedControledNames()

  • Return type: List[str]

motion_stack.ros2.default_node.mini_sim.main(args=None)

motion_stack.ros2.default_node.trial module

class motion_stack.ros2.default_node.trial.TestNode

Bases: Node

async joints_ready()

async ik_ready()

json_step(n)

  • Parameters: n (int)

async execute_json()

async zero()

async ik_square()

async ik_circle(samples=20)

  • Parameters: samples (int)

async api_demo()

main()

startup()

loop()

motion_stack.ros2.default_node.trial.main(*args)