Unity-Robotics-Hub icon indicating copy to clipboard operation
Unity-Robotics-Hub copied to clipboard

Unity project file - pick and place. code error (PLEASE UPDATE the code changes)

Open cheabdullahjz opened this issue 9 months ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

filename = NiryoTrajectoryMsg.cs Moveit.RobotTrajectoryMsg // (this give error) i changed this to NiryoMoveit.NiryoTrajectoryMsg // (no error)

filename = TrajectoryPlanner.cs foreach (var t in response.trajectories[poseIndex].joint_trajectory.points) // (this give error)

is there any update that is not reflected in the Unity Projet folder/file e.g.: the pick and place. i am just following the instructions here - https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/pick_and_place/2_ros_tcp.md

and, Unity console show errors after doing Menu -- Robotic -- Generate ROS messages

Thanks Zul

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Console logs / stack traces Please wrap in triple backticks (```) to make it easier to read.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots or videos to help explain your problem.

Environment (please complete the following information, where applicable):

  • Unity Version: [e.g. Unity 2020.2.0f1]
  • Unity machine OS + version: [e.g. Windows 10]
  • ROS machine OS + version: [e.g. Ubuntu 18.04, ROS Noetic]
  • ROS–Unity communication: [e.g. Docker]
  • Branch or version: [e.g. v0.2.0]

Additional context Add any other context about the problem here.

cheabdullahjz avatar Apr 24 '25 10:04 cheabdullahjz

Filename = TrajectoryPlanner.cs //foreach (var t in response.trajectories[poseIndex].joint_trajectory.points) foreach (var t in response.trajectories[poseIndex].trajectory) { //var jointPositions = t.positions; var jointPositions = t.trajectory; var result = jointPositions.Select(r => (float)r * Mathf.Rad2Deg).ToArray();

Severity Code Description Project File Line Suppression State Error CS0030 Cannot convert type 'RosMessageTypes.NiryoMoveit.NiryoTrajectoryMsg' to 'float' Unity.Robotics.PickAndPlace F:\UnityTransfer\EXPERIMENTAL\UNITY_ROS\Unity-Robotics-Hub-main\tutorials\pick_and_place\PickAndPlaceProject\Assets\Scripts\TrajectoryPlanner.cs 184 Active

cheabdullahjz avatar Apr 24 '25 10:04 cheabdullahjz