- 博客(14)
- 收藏
- 关注
原创 123153513
start_pose = group.get_current_pose().pose # 获取当前机械臂状态。group.set_start_state_to_current_state() # 设置起点为当前状态。group.set_pose_target(start_pose) # 设置为目标起始状态。goal_pose.position.x = 0.11 # 设置目标点的 X 坐标。group.set_pose_target(goal_pose) # 设置目标点。# 设置规划时间和规划器。
2024-12-27 20:57:41
367
原创 算法fsdsd
ECA-RRTstar 是基于 RRT* 的改进版本,添加了启发式搜索和路径平滑功能。/** @brief 存储规划的最终目标运动 *//** @brief 规划器的随机数生成器 *//** @brief 设置启发式函数权重 *//** @brief 获取启发式函数权重 *//** @brief 清除规划器数据 *//** @brief 获取规划器数据 *//** @brief 启发式权重 *//** @brief 构造函数 *//** @brief 析构函数 */* @return 平滑后的路径。
2024-12-27 14:54:43
329
原创 moveitrrt2
joint_trajectory_point.time_from_start = rospy.Duration(0.1 * len(joint_trajectory.points)) # 每个点间隔0.1秒。t = np.linspace(0, 1, num_points - degree + 1) # 内部节点。start = [0.0, -0.5, 0.5, 0.0, 0.0, 0.0] # 起点。goal = [1.0, 0.0, -0.5, 0.5, 0.0, 0.0] # 终点。
2024-12-25 12:59:56
480
原创 moveit-rrt1
joint_trajectory_point.time_from_start = rospy.Duration(0.1 * len(joint_trajectory.points)) # 每个点间隔0.1秒。start = [0.0, -0.5, 0.5, 0.0, 0.0, 0.0] # 起点。goal = [1.0, 0.0, -0.5, 0.5, 0.0, 0.0] # 终点。[-3.14, 3.14], # J4:全角度旋转。[-3.14, 3.14], # J5:全角度旋转。
2024-12-25 12:57:28
725
原创 moveit-rrt
joint_trajectory_point.time_from_start = rospy.Duration(0.1 * len(joint_trajectory.points)) # 每个点间隔0.1秒。start = [0.0, -0.5, 0.5, 0.0, 0.0, 0.0] # 起点。goal = [1.0, 0.0, -0.5, 0.5, 0.0, 0.0] # 终点。[-3.14, 3.14], # J4:全角度旋转。[-3.14, 3.14], # J5:全角度旋转。
2024-12-24 20:40:35
817
原创 sajdldnias
target_pose.pose.position.x = 0.15 # 目标位置的 X 坐标。target_pose.pose.position.y = 0.0 # 目标位置的 Y 坐标。target_pose.pose.position.z = 0.2 # 目标位置的 Z 坐标。target_pose.header.frame_id = "base_link" # 基座坐标系。print(f"轨迹规划时间:{planning_time} 秒")
2024-12-24 16:13:13
330
原创 jdbhsf
pose_array.header.frame_id = "base_link" # 机械臂的基础坐标系。print(f"路径总长度: {total_length:.2f} 单位长度")print(f"路径规划时间: {planning_time:.2f} 秒")rospy.logerr(f"机械臂初始化失败: {e}")print(f"环境复杂度: {complexity:.2f}")print(f"起点坐标: {start_point}")print(f"终点坐标: {goal_point}")
2024-12-24 15:13:56
347
原创 todxjqr
pose_array.header.frame_id = "base_link" # 机械臂的基础坐标系。print(f"路径总长度: {total_length:.2f} 单位长度")print(f"路径规划时间: {planning_time:.2f} 秒")print(f"环境复杂度: {complexity:.2f}")print(f"起点坐标: {start_point}")print(f"终点坐标: {goal_point}")# 发布路径到 RViz 的话题。# 发布路径到 RViz。
2024-12-24 14:47:58
378
原创 完善代码:
self.group.set_max_acceleration_scaling_factor(0.5) # 减小加速度,提高成功率。self.group.set_max_velocity_scaling_factor(0.5) # 减小速度,提高成功率。self.group.set_planning_time(60) # 增加规划时间。# 将所有四元数设置为固定值 (0, 0, 0, 1)num_segments = 5 # 将路径分为5段。# 打印每个路径点的信息。# 移动机械臂到第一个轨迹点。
2024-07-12 14:09:11
635
原创 代码-补充
self.group.set_planning_time(30) # 增加规划时间。# 将所有四元数设置为默认值 (0, 0, 0, 1)# 打印每个路径点的信息。
2024-07-10 20:14:02
260
原创 unity-ros数据传输
from moveit_commander import RobotCommander, PlanningSceneInterface, MoveGroupCommander # 导入 MoveIt 相关库。from moveit_commander import roscpp_initialize, roscpp_shutdown # 导入 ROS-C++ 桥接库相关函数。roscpp_initialize(sys.argv) # 初始化 ROS-C++ 桥接。# 如果规划成功,执行机械臂运动。
2024-07-09 17:38:35
1336
原创 ros,moveit显示报错[ERROR] PluginlibFactory: The plugin for class ‘moveit_rviz_plugin/MotionPlanning‘ fai
[ERROR] PluginlibFactory: The plugin for class 'moveit_rviz_plugin/MotionPlanning' failed to load. Error: Failed to load library /opt/ros/noetic/lib/libmoveit_motion_planning_rviz_plugin.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro i
2024-07-06 15:38:56
823
原创 通讯rosunity
public void PublishTrajectory(List path) // 接收一个List类型的路径点列表。// 四元数(x, y, z, w)// ROS话题名称。// 用于Unity和ROS的TCP连接。group_name = "arm" # 根据你的机械臂配置修改。
2024-06-11 16:20:32
933
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人