@@ -1645,11 +1645,12 @@ Blockly.Blocks['niryo_one_vision_is_object_detected'] = {
1645
1645
1646
1646
Blockly . Blocks [ 'niryo_one_get_img_compressed' ] = {
1647
1647
init : function ( ) {
1648
- this . appendDummyInput ( )
1649
- . appendField ( 'Get image compressed' )
1648
+ this . appendDummyInput ( ) . appendField ( 'Get image compressed' ) ;
1650
1649
this . setOutput ( true , 'String' ) ;
1651
1650
this . setColour ( vision_color ) ;
1652
- this . setTooltip ( 'Get image from video stream in a compressed format. Returns string containing a JPEG compressed image.' ) ;
1651
+ this . setTooltip (
1652
+ 'Get image from video stream in a compressed format. Returns string containing a JPEG compressed image.'
1653
+ ) ;
1653
1654
this . setHelpUrl ( '' ) ;
1654
1655
}
1655
1656
} ;
@@ -1662,7 +1663,9 @@ Blockly.Blocks['niryo_one_set_brightness'] = {
1662
1663
this . setPreviousStatement ( true , null ) ;
1663
1664
this . setNextStatement ( true , null ) ;
1664
1665
this . setColour ( vision_color ) ;
1665
- this . setTooltip ( 'Modify video stream brightness.How much to adjust the brightness. 0.5 will give a darkened image, 1 will give the original image while 2 will enhance the brightness by a factor of 2.' ) ;
1666
+ this . setTooltip (
1667
+ 'Modify video stream brightness.How much to adjust the brightness. 0.5 will give a darkened image, 1 will give the original image while 2 will enhance the brightness by a factor of 2.'
1668
+ ) ;
1666
1669
this . setHelpUrl ( '' ) ;
1667
1670
}
1668
1671
} ;
@@ -1675,7 +1678,9 @@ Blockly.Blocks['niryo_one_set_contrast'] = {
1675
1678
this . setPreviousStatement ( true , null ) ;
1676
1679
this . setNextStatement ( true , null ) ;
1677
1680
this . setColour ( vision_color ) ;
1678
- this . setTooltip ( 'Modify video stream contrast. While a factor of 1 gives original image. Making the factor towards 0 makes the image greyer, while factor>1 increases the contrast of the image.' ) ;
1681
+ this . setTooltip (
1682
+ 'Modify video stream contrast. While a factor of 1 gives original image. Making the factor towards 0 makes the image greyer, while factor>1 increases the contrast of the image.'
1683
+ ) ;
1679
1684
this . setHelpUrl ( '' ) ;
1680
1685
}
1681
1686
} ;
@@ -1688,18 +1693,21 @@ Blockly.Blocks['niryo_one_set_saturation'] = {
1688
1693
this . setPreviousStatement ( true , null ) ;
1689
1694
this . setNextStatement ( true , null ) ;
1690
1695
this . setColour ( vision_color ) ;
1691
- this . setTooltip ( 'Modify video stream saturation. How much to adjust the saturation. 0 will give a black and white image, 1 will give the original image while 2 will enhance the saturation by a factor of 2.' ) ;
1696
+ this . setTooltip (
1697
+ 'Modify video stream saturation. How much to adjust the saturation. 0 will give a black and white image, 1 will give the original image while 2 will enhance the saturation by a factor of 2.'
1698
+ ) ;
1692
1699
this . setHelpUrl ( '' ) ;
1693
1700
}
1694
1701
} ;
1695
1702
1696
1703
Blockly . Blocks [ 'niryo_one_get_image_parameters' ] = {
1697
1704
init : function ( ) {
1698
- this . appendDummyInput ( )
1699
- . appendField ( 'Get image parameters' ) ;
1705
+ this . appendDummyInput ( ) . appendField ( 'Get image parameters' ) ;
1700
1706
this . setOutput ( true , 'String' ) ;
1701
1707
this . setColour ( vision_color ) ;
1702
- this . setTooltip ( 'Get last stream image parameters: Brightness factor, Contrast factor, Saturation factor.' ) ;
1708
+ this . setTooltip (
1709
+ 'Get last stream image parameters: Brightness factor, Contrast factor, Saturation factor.'
1710
+ ) ;
1703
1711
this . setHelpUrl ( '' ) ;
1704
1712
}
1705
1713
} ;
@@ -1709,29 +1717,22 @@ Blockly.Blocks['niryo_one_get_target_pose_from_rel'] = {
1709
1717
this . appendDummyInput ( ) . appendField ( 'Get robot pose relative to pose' ) ;
1710
1718
this . appendDummyInput ( )
1711
1719
. appendField ( 'x' )
1712
- . appendField (
1713
- new Blockly . FieldNumber ( 0 , 0 , 1 , 0.001 ) ,
1714
- 'POSE_X'
1715
- )
1720
+ . appendField ( new Blockly . FieldNumber ( 0 , 0 , 1 , 0.001 ) , 'POSE_X' )
1716
1721
. appendField ( 'y' )
1717
- . appendField (
1718
- new Blockly . FieldNumber ( 0 , 0 , 1 , 0.001 ) ,
1719
- 'POSE_Y'
1720
- )
1722
+ . appendField ( new Blockly . FieldNumber ( 0 , 0 , 1 , 0.001 ) , 'POSE_Y' )
1721
1723
. appendField ( 'z' )
1722
- . appendField (
1723
- new Blockly . FieldNumber ( 0 , 0 , 1 , 0.001 ) ,
1724
- 'POSE_Z'
1725
- )
1724
+ . appendField ( new Blockly . FieldNumber ( 0 , 0 , 1 , 0.001 ) , 'POSE_Z' ) ;
1726
1725
this . appendValueInput ( 'HEIGHT_OFFSET' )
1727
1726
. setCheck ( 'Number' )
1728
1727
. appendField ( 'with heigh offset' ) ;
1729
- this . appendValueInput ( 'WORKSPACE_NAME' )
1728
+ this . appendValueInput ( 'WORKSPACE_NAME' )
1730
1729
. setCheck ( 'String' )
1731
1730
. appendField ( 'in workspace' ) ;
1732
1731
this . setOutput ( true , 'niryo_one_pose' ) ;
1733
1732
this . setColour ( vision_color ) ;
1734
- this . setTooltip ( 'Given a pose (x_rel, y_rel, yaw_rel) relative to a workspace, this function returns the robot pose in which the current tool will be able to pick an object at this pose. The height_offset argument (in m) defines how high the tool will hover over the workspace. If height_offset = 0, the tool will nearly touch the workspace.' ) ;
1733
+ this . setTooltip (
1734
+ 'Given a pose (x_rel, y_rel, yaw_rel) relative to a workspace, this function returns the robot pose in which the current tool will be able to pick an object at this pose. The height_offset argument (in m) defines how high the tool will hover over the workspace. If height_offset = 0, the tool will nearly touch the workspace.'
1735
+ ) ;
1735
1736
this . setHelpUrl ( '' ) ;
1736
1737
}
1737
1738
} ;
@@ -1747,13 +1748,15 @@ Blockly.Blocks['niryo_one_get_target_pose_from_cam'] = {
1747
1748
. appendField ( 'with height offset' ) ;
1748
1749
this . appendValueInput ( 'SHAPE' )
1749
1750
. setCheck ( 'niryo_one_vision_shape' )
1750
- . appendField ( 'for object of shape' )
1751
+ . appendField ( 'for object of shape' ) ;
1751
1752
this . appendValueInput ( 'COLOR' )
1752
1753
. setCheck ( 'niryo_one_vision_color' )
1753
1754
. appendField ( 'and color' ) ;
1754
1755
this . setOutput ( true , 'niryo_one_pose' ) ;
1755
1756
this . setColour ( vision_color ) ;
1756
- this . setTooltip ( 'First detects the specified object using the camera and then returns the robot pose in which the object can be picked with the current tool' ) ;
1757
+ this . setTooltip (
1758
+ 'First detects the specified object using the camera and then returns the robot pose in which the object can be picked with the current tool'
1759
+ ) ;
1757
1760
this . setHelpUrl ( '' ) ;
1758
1761
}
1759
1762
} ;
@@ -1769,13 +1772,15 @@ Blockly.Blocks['niryo_one_move_to_object'] = {
1769
1772
. appendField ( 'with height offset' ) ;
1770
1773
this . appendValueInput ( 'SHAPE' )
1771
1774
. setCheck ( 'niryo_one_vision_shape' )
1772
- . appendField ( 'for object of shape' )
1775
+ . appendField ( 'for object of shape' ) ;
1773
1776
this . appendValueInput ( 'COLOR' )
1774
1777
. setCheck ( 'niryo_one_vision_color' )
1775
1778
. appendField ( 'and color' ) ;
1776
1779
this . setOutput ( true , 'niryo_one_pose' ) ;
1777
1780
this . setColour ( vision_color ) ;
1778
- this . setTooltip ( 'Same as get_target_pose_from_cam but directly moves to this position' ) ;
1781
+ this . setTooltip (
1782
+ 'Same as get_target_pose_from_cam but directly moves to this position'
1783
+ ) ;
1779
1784
this . setHelpUrl ( '' ) ;
1780
1785
}
1781
1786
} ;
@@ -1785,7 +1790,9 @@ Blockly.Blocks['niryo_one_get_camera_intrinsics'] = {
1785
1790
this . appendDummyInput ( ) . appendField ( 'Get camera intrinsics' ) ;
1786
1791
this . setOutput ( true , 'String' ) ;
1787
1792
this . setColour ( vision_color ) ;
1788
- this . setTooltip ( 'Get calibration object: camera intrinsics, distortions coefficients' ) ;
1793
+ this . setTooltip (
1794
+ 'Get calibration object: camera intrinsics, distortions coefficients'
1795
+ ) ;
1789
1796
this . setHelpUrl ( '' ) ;
1790
1797
}
1791
1798
} ;
@@ -1795,8 +1802,8 @@ Blockly.Blocks['niryo_one_save_workspace_from_robot_poses'] = {
1795
1802
this . appendValueInput ( 'WORKSPACE_NAME' )
1796
1803
. setCheck ( 'String' )
1797
1804
. appendField ( 'Save workspace under name' ) ;
1798
- this . appendDummyInput ( ) . appendField ( 'from the 4 corners defined by' )
1799
- this . appendDummyInput ( ) . appendField ( '\n' )
1805
+ this . appendDummyInput ( ) . appendField ( 'from the 4 corners defined by' ) ;
1806
+ this . appendDummyInput ( ) . appendField ( '\n' ) ;
1800
1807
this . appendValueInput ( 'POSE_1' )
1801
1808
. setCheck ( 'niryo_one_pose' )
1802
1809
. appendField ( 'pose 1' ) ;
@@ -1812,7 +1819,9 @@ Blockly.Blocks['niryo_one_save_workspace_from_robot_poses'] = {
1812
1819
this . setPreviousStatement ( true , null ) ;
1813
1820
this . setNextStatement ( true , null ) ;
1814
1821
this . setColour ( vision_color ) ;
1815
- this . setTooltip ( 'Save workspace by giving the poses of the robot to point its 4 corners with the calibration Tip. Corners should be in the good order. Markers’ pose will be deduced from these poses' ) ;
1822
+ this . setTooltip (
1823
+ 'Save workspace by giving the poses of the robot to point its 4 corners with the calibration Tip. Corners should be in the good order. Markers’ pose will be deduced from these poses'
1824
+ ) ;
1816
1825
this . setHelpUrl ( '' ) ;
1817
1826
}
1818
1827
} ;
@@ -1822,8 +1831,8 @@ Blockly.Blocks['niryo_one_save_workspace_from_points'] = {
1822
1831
this . appendValueInput ( 'WORKSPACE_NAME' )
1823
1832
. setCheck ( 'String' )
1824
1833
. appendField ( 'Save workspace under name' ) ;
1825
- this . appendDummyInput ( ) . appendField ( 'from the 4 corners defined by' )
1826
- this . appendDummyInput ( ) . appendField ( '\n' )
1834
+ this . appendDummyInput ( ) . appendField ( 'from the 4 corners defined by' ) ;
1835
+ this . appendDummyInput ( ) . appendField ( '\n' ) ;
1827
1836
this . appendValueInput ( 'POINT_1' )
1828
1837
. setCheck ( 'niryo_one_point' )
1829
1838
. appendField ( 'point 1' ) ;
@@ -1839,7 +1848,9 @@ Blockly.Blocks['niryo_one_save_workspace_from_points'] = {
1839
1848
this . setPreviousStatement ( true , null ) ;
1840
1849
this . setNextStatement ( true , null ) ;
1841
1850
this . setColour ( vision_color ) ;
1842
- this . setTooltip ( 'Save workspace by giving the points of worskpace’s 4 corners. Points are written as [x, y, z] Corners should be in the good order.' ) ;
1851
+ this . setTooltip (
1852
+ 'Save workspace by giving the points of worskpace’s 4 corners. Points are written as [x, y, z] Corners should be in the good order.'
1853
+ ) ;
1843
1854
this . setHelpUrl ( '' ) ;
1844
1855
}
1845
1856
} ;
@@ -3551,16 +3562,19 @@ BlocklyPy['niryo_one_get_target_pose_from_rel'] = function (block) {
3551
3562
var height_offset_value =
3552
3563
BlocklyPy . valueToCode ( block , 'HEIGHT_OFFSET' , BlocklyPy . ORDER_ATOMIC ) ||
3553
3564
'(0)' ;
3554
- height_offset_value = height_offset_value . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3565
+ height_offset_value = height_offset_value . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3555
3566
3556
3567
var workspace_name =
3557
3568
BlocklyPy . valueToCode ( block , 'WORKSPACE_NAME' , BlocklyPy . ORDER_ATOMIC ) ||
3558
3569
'(0)' ;
3559
3570
workspace_name = workspace_name . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3560
3571
3561
3572
var code =
3562
- 'n.get_target_pose_from_rel(' + workspace_name + ', ' +
3563
- height_offset_value + ', ' +
3573
+ 'n.get_target_pose_from_rel(' +
3574
+ workspace_name +
3575
+ ', ' +
3576
+ height_offset_value +
3577
+ ', ' +
3564
3578
value_x +
3565
3579
', ' +
3566
3580
value_y +
@@ -3579,23 +3593,29 @@ BlocklyPy['niryo_one_get_target_pose_from_cam'] = function (block) {
3579
3593
var height_offset_value =
3580
3594
BlocklyPy . valueToCode ( block , 'HEIGHT_OFFSET' , BlocklyPy . ORDER_ATOMIC ) ||
3581
3595
'(0)' ;
3582
- height_offset_value = height_offset_value . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3596
+ height_offset_value = height_offset_value . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3583
3597
3584
3598
// Color (int) value (see g_shape_values at top of this file)
3585
3599
var value_color =
3586
- BlocklyPy . valueToCode ( block , 'COLOR' , BlocklyPy . ORDER_ATOMIC ) ||
3587
- '(0)' ;
3600
+ BlocklyPy . valueToCode ( block , 'COLOR' , BlocklyPy . ORDER_ATOMIC ) || '(0)' ;
3588
3601
value_color = value_color . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3589
3602
3590
3603
// Shape (int) value (see g_shape_values at top of this file)
3591
3604
var value_shape =
3592
- BlocklyPy . valueToCode ( block , 'SHAPE' , BlocklyPy . ORDER_ATOMIC ) ||
3593
- '(0)' ;
3605
+ BlocklyPy . valueToCode ( block , 'SHAPE' , BlocklyPy . ORDER_ATOMIC ) || '(0)' ;
3594
3606
value_shape = value_shape . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3595
3607
3596
- var code = 'n.get_target_pose_from_cam(' + workspace_name + ', ' + height_offset_value + ', ' + value_color + ', ' + value_shape + ')\n' ;
3608
+ var code =
3609
+ 'n.get_target_pose_from_cam(' +
3610
+ workspace_name +
3611
+ ', ' +
3612
+ height_offset_value +
3613
+ ', ' +
3614
+ value_color +
3615
+ ', ' +
3616
+ value_shape +
3617
+ ')\n' ;
3597
3618
return [ code , BlocklyPy . ORDER_NONE ] ;
3598
-
3599
3619
} ;
3600
3620
3601
3621
BlocklyPy [ 'niryo_one_move_to_object' ] = function ( block ) {
@@ -3607,31 +3627,37 @@ BlocklyPy['niryo_one_move_to_object'] = function (block) {
3607
3627
var height_offset_value =
3608
3628
BlocklyPy . valueToCode ( block , 'HEIGHT_OFFSET' , BlocklyPy . ORDER_ATOMIC ) ||
3609
3629
'(0)' ;
3610
- height_offset_value = height_offset_value . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3630
+ height_offset_value = height_offset_value . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3611
3631
3612
3632
// Color (int) value (see g_shape_values at top of this file)
3613
3633
var value_color =
3614
- BlocklyPy . valueToCode ( block , 'COLOR' , BlocklyPy . ORDER_ATOMIC ) ||
3615
- '(0)' ;
3634
+ BlocklyPy . valueToCode ( block , 'COLOR' , BlocklyPy . ORDER_ATOMIC ) || '(0)' ;
3616
3635
value_color = value_color . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3617
3636
3618
3637
// Shape (int) value (see g_shape_values at top of this file)
3619
3638
var value_shape =
3620
- BlocklyPy . valueToCode ( block , 'SHAPE' , BlocklyPy . ORDER_ATOMIC ) ||
3621
- '(0)' ;
3639
+ BlocklyPy . valueToCode ( block , 'SHAPE' , BlocklyPy . ORDER_ATOMIC ) || '(0)' ;
3622
3640
value_shape = value_shape . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3623
3641
3624
- var code = 'n.move_to_object(' + workspace_name + ', ' + height_offset_value + ', ' + value_color + ', ' + value_shape + ')\n' ;
3642
+ var code =
3643
+ 'n.move_to_object(' +
3644
+ workspace_name +
3645
+ ', ' +
3646
+ height_offset_value +
3647
+ ', ' +
3648
+ value_color +
3649
+ ', ' +
3650
+ value_shape +
3651
+ ')\n' ;
3625
3652
return [ code , BlocklyPy . ORDER_NONE ] ;
3626
-
3627
3653
} ;
3628
3654
3629
3655
BlocklyPy [ 'niryo_one_get_camera_intrinsics' ] = function ( block ) {
3630
3656
var code = 'n.get_camera_intrinsics()\n' ;
3631
3657
return code ;
3632
3658
} ;
3633
3659
3634
- BlocklyPy [ 'niryo_one_save_workspace_from_robot_poses' ] = function ( block ) {
3660
+ BlocklyPy [ 'niryo_one_save_workspace_from_robot_poses' ] = function ( block ) {
3635
3661
var workspace_name =
3636
3662
BlocklyPy . valueToCode ( block , 'WORKSPACE_NAME' , BlocklyPy . ORDER_ATOMIC ) ||
3637
3663
'(0)' ;
@@ -3665,15 +3691,22 @@ BlocklyPy['niryo_one_save_workspace_from_robot_poses'] = function (block) {
3665
3691
) ;
3666
3692
value_pose_4 = value_pose_4 . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3667
3693
3668
- var code = 'n.save_workspace_from_robot_poses(' + workspace_name + ', ' +
3669
- value_pose_1 + ', ' +
3670
- value_pose_2 + ', ' +
3671
- value_pose_3 + ', ' +
3672
- value_pose_4 + ')\n' ;
3694
+ var code =
3695
+ 'n.save_workspace_from_robot_poses(' +
3696
+ workspace_name +
3697
+ ', ' +
3698
+ value_pose_1 +
3699
+ ', ' +
3700
+ value_pose_2 +
3701
+ ', ' +
3702
+ value_pose_3 +
3703
+ ', ' +
3704
+ value_pose_4 +
3705
+ ')\n' ;
3673
3706
return code ;
3674
3707
} ;
3675
3708
3676
- BlocklyPy [ 'niryo_one_save_workspace_from_points' ] = function ( block ) {
3709
+ BlocklyPy [ 'niryo_one_save_workspace_from_points' ] = function ( block ) {
3677
3710
var workspace_name =
3678
3711
BlocklyPy . valueToCode ( block , 'WORKSPACE_NAME' , BlocklyPy . ORDER_ATOMIC ) ||
3679
3712
'(0)' ;
@@ -3707,15 +3740,22 @@ BlocklyPy['niryo_one_save_workspace_from_points'] = function (block) {
3707
3740
) ;
3708
3741
value_point_4 = value_point_4 . replace ( '(' , '' ) . replace ( ')' , '' ) ;
3709
3742
3710
- var code = 'n.save_workspace_from_points(' + workspace_name + ', ' +
3711
- value_point_1 + ', ' +
3712
- value_point_2 + ', ' +
3713
- value_point_3 + ', ' +
3714
- value_point_4 + ')\n' ;
3743
+ var code =
3744
+ 'n.save_workspace_from_points(' +
3745
+ workspace_name +
3746
+ ', ' +
3747
+ value_point_1 +
3748
+ ', ' +
3749
+ value_point_2 +
3750
+ ', ' +
3751
+ value_point_3 +
3752
+ ', ' +
3753
+ value_point_4 +
3754
+ ')\n' ;
3715
3755
return code ;
3716
3756
} ;
3717
3757
3718
- BlocklyPy [ 'niryo_one_delete_workspace' ] = function ( block ) {
3758
+ BlocklyPy [ 'niryo_one_delete_workspace' ] = function ( block ) {
3719
3759
var workspace_name =
3720
3760
BlocklyPy . valueToCode ( block , 'WORKSPACE_NAME' , BlocklyPy . ORDER_ATOMIC ) ||
3721
3761
'(0)' ;
0 commit comments