Node(
package='tf2_ros',
executable="static_transform_publisher",
arguments=["0", "0.2", "0", "0", "0",
"0", "map", "wessling-hand1-base"]
),
wessling_hand_urdf_dir = get_package_share_directory('wessling_hand_urdf')
This points to:
install/wessling_hand_urdf/share/wessling_hand_urdf/
In your workspace
import launch
from launch.launch_description_sources import PythonLaunchDescriptionSource
wessling_hand_sim_dir = get_package_share_directory('wessling_hand_sim')
included_launch = launch.actions.IncludeLaunchDescription(
PythonLaunchDescriptionSource([
wessling_hand_sim_dir,
'/wessling_hand_sim.launch.py'
]
)
)
def generate_launch_description():
return launch.LaunchDescription([
included_launch,
# Node(
# package='tf2_ros',
# executable="static_transform_publisher",
# arguments=["0", "0.2", "0", "0", "0",
# "0", "map", "wessling-hand1-base"]
# ),
# kuka arm right
#),
])
http://design.ros2.org/articles/ros_command_line_arguments.html
https://roboticsbackend.com/ros2-yaml-params/
talker_node = Node(
package="demo_nodes_cpp",
executable="talker",
name="my_talker",
remappings=[
("chatter", "my_chatter")
]
)
listener_node = Node(
package="demo_nodes_py",
executable="listener",
remappings=[
("chatter", "my_chatter")
]
)
Create an empty file in the particular directory to ignore with the following filename:
ROS1 (noetic):
CATKIN_IGNORE
ROS2 (foxy):
COLCON_IGNORE
https://roboticsbackend.com/ros2-rclcpp-parameter-callback/
In python the param callback receives a list of "Parameter" objects as argument and the user must return a "SetParameterResult" object as return value
Objects:
Parameter: https://docs.ros2.org/latest/api/rclpy/api/parameters.html
SetParameterResult: Not documented!
SetParamenterResult can be created with:
result=SetParameterResult()
And it can be used like this:
result.successful = true;
result.reason = "success";
https://github.com/ros2/rclcpp/blob/master/rclcpp_action/src/server_goal_handle.cpp
For an action like this:
# Goal fields
geometry_msgs/Pose goal
geometry_msgs/Twist precision
builtin_interfaces/Time timeout
---
#Result fields
string result
---
# Feedback fields
geometry_msgs/Twist distance
geometry_msgs/Twist velocity
In the callback you must create and return a action result object:
from rbc_actions.action import VF as VFaction
my_result=VFaction.Result()
my_result.result = "Arrived!" # .result is the _result_ field of the ROS2 action
return(my_result)
You need to give some feedback:
https://docs.ros2.org/latest/api/rclpy/index.html
https://index.ros.org/r/common_interfaces/github-ros2-common_interfaces/
https://github.com/ros2/common_interfaces/tree/foxy
https://answers.ros.org/question/189073/rostopic-pub-multiarray/
Introduction to launch files:
https://medium.com/@danieljeswin/introduction-to-programming-with-ros2-launch-files-52eac873f9d0
https://roboticsbackend.com/ros2-launch-file-example/
[1] https://answers.ros.org/question/306935/ros2-include-a-launch-file-from-a-launch-file/
[2] https://design.ros2.org/articles/roslaunch.html